Skip to content

Deploy immutable images from selected build Machines - #842

Merged
nick-potts merged 6 commits into
mainfrom
t3code/implement-803
Sep 9, 2026
Merged

nick-potts merged 6 commits into
mainfrom
t3code/implement-803

Conversation

@nick-potts

@nick-potts nick-potts commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

ployz deploy --remote=<Machine> builds on the selected Machine and deploys its completed images without inspecting local Docker or publishing to a registry. Runtime Services bind to manifest digests, so reusing a requested tag cannot substitute another build’s content.

Builds run in dependency order, including service: contexts served from the dependency’s actual build Machine. All required builds finish before application changes. Destination platform checks cover architecture aliases and known ARM generations; direct transfer retains per-Machine successes, failures, and omissions.

Temporary image tags stay alive through dependent builds and delivery, then are released with the completed image results. Captured source and credential files retain their original cleanup lifetime.

Validation:

  • Rung 1: 26 ployz-build library tests, including reserved-tag validation; destination architecture/ARM compatibility checks.
  • Rung 2: 357 ployz library tests and 25 build integration tests passed. All 9 daemon Build tests passed, including remote image retention and release. Local clone/drop and remote drop regressions were rerun after the final ownership adjustment.
  • Workspace Clippy with warnings denied, formatting, and Layer 3 runner registration checks passed.
  • Rung 4: the original implementation passed remote_build_delivers_dependency_content_and_deploys_without_a_registry on two real Docker Machines, including cross-Machine dependency builds. The added temporary-tag cleanup assertions have not been rerun on real Machines.

After merging the queue/admission changes from main, validation passed again: 31 shared Build unit tests, 14 daemon Build tests, 10 remote client tests, 2 remote CLI tests, and workspace Clippy. The completed-image regression also verifies that retained images release admission for the next Build and are cleaned up on daemon shutdown.

The subsequent main merge preserves multi-platform Railpack output and caller-owned cancellation. Latest checks: 31 shared Build unit tests, 364 client unit tests, 30 Build integration tests, 14 daemon Build tests, 2 remote CLI tests, and workspace Clippy all passed. The remote deploy regression covers combined AMD64/ARM64 image evidence.

Named image contexts may contain a different architecture from the output target; BuildKit validates their consumption. Rung 1 regression cross_platform_image_context_reaches_buildkit failed before removing the unconditional platform comparison and passed afterward; all 32 shared Build unit tests pass.

Closes #803.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T04:28:27.813873Z 6e32e1c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5af268096

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/ployz/src/deploy/pipeline.rs Outdated
Comment on lines +297 to +299
Some("x86_64" | "amd64") => service.built.platform == "linux/amd64",
Some("aarch64" | "arm64") => matches!(service.built.platform.as_str(), "linux/arm64" | "linux/arm64/v8"),
_ => false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle all supported destination architectures

When a destination daemon reports an architecture other than x86-64 or ARM64, this branch unconditionally rejects the deployment even if the completed image matches it. The build protocol already accepts platforms such as linux/386, linux/arm/v7, and linux/ppc64le, so deployments to corresponding x86, arm, or powerpc64 Machines are refused before transfer; map every supported runtime architecture to its OCI platform instead of treating the remainder as incompatible.

Useful? React with 👍 / 👎.

Comment on lines +199 to +203
let retained = format!(
"{}/{}:ployz-build-{}",
reference.registry(),
reference.repository(),
uuid::Uuid::new_v4()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clean up unique retention tags after image delivery

Every Output::Load build, including an ordinary ployz build, creates a fresh :ployz-build-<uuid> tag, but no completion or cleanup path removes it. Repeated builds therefore leave every historical image permanently tagged, preventing normal dangling-image pruning and steadily consuming Docker storage; retain these tags only for the bounded build/delivery operation and remove them afterward.

Useful? React with 👍 / 👎.

Codex added 2 commits September 9, 2026 03:38
# Conflicts:
#	crates/ployz-build/src/lib.rs
#	crates/ployz-build/src/remote.rs
#	crates/ployz-build/src/upload.rs
#	crates/ployz/src/compose/build.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e09f5676ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/ployz-build/src/lib.rs Outdated
for image in request.image_contexts.values() {
for target in request.targets {
let platform = target.platform.as_deref().unwrap_or(&native);
if !covers(&image.platform, platform) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Let BuildKit resolve image-context platforms

When a cross-platform consumer intentionally uses a dependency built for another architecture—for example, an ARM64 target with FROM --platform=linux/amd64 base—this unconditional comparison rejects the build during preparation. Named image contexts can legitimately differ from the output platform, including when copying architecture-independent artifacts, so BuildKit should validate how the context is consumed rather than requiring every context to match the target platform.

Useful? React with 👍 / 👎.

# Conflicts:
#	crates/ployz-build/src/lib.rs
#	crates/ployz-build/src/upload.rs
#	crates/ployz/src/compose/remote_build.rs
#	crates/ployz/src/handlers/build.rs
#	crates/ployz/tests/build_layer3/remote.rs
#	crates/ployzd/src/build.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 722930f2a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

let inputs = Self::new()?;
// ponytail: copy the already-filtered capture per remote target. Select
// per-target source trees if large multi-Service captures become costly.
for area in ["source", "private"] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict each upload to its target's captured inputs

When execute_on_machines assigns dependent builds to different Machines, this loop copies the complete shared source and private trees into every per-Service upload. Filtering the Compose document later does not remove unrelated Services' source trees, secret files, or SSH keys, so each selected Machine receives credentials and code belonging only to builds assigned elsewhere; construct each capture from only the inputs referenced by that target.

Useful? React with 👍 / 👎.

Comment on lines +53 to +56
.await?;
let descriptor: serde_json::Value = serde_json::from_str(&descriptor)?;
if descriptor.get("digest").and_then(serde_json::Value::as_str) != Some(digest) {
return Err(Error::PeerPull(format!(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clean up pulled images when digest verification fails

For digest-based delivery, if the pull and tag succeed but the newly added inspect, JSON decoding, or descriptor comparison fails, these early exits bypass the removal at line 61. The failed destination therefore retains both the unique 127.0.0.1:<port>/... reference and the digest-retention tag, allowing failed deliveries of successive builds to accumulate image content; run cleanup on every post-pull exit while preserving the verification error.

Useful? React with 👍 / 👎.

Codex added 2 commits September 9, 2026 04:19
# Conflicts:
#	crates/ployz-build/src/lib.rs
#	crates/ployz/src/compose/build.rs
#	crates/ployz/src/compose/remote_build.rs
#	crates/ployz/src/deploy/apply.rs
#	crates/ployz/src/deploy/pipeline.rs
#	crates/ployz/src/handlers/deploy.rs
#	crates/ployz/src/handlers/deploy_tests.rs
#	crates/ployz/src/image.rs
@nick-potts
nick-potts merged commit cb85fd8 into main Sep 9, 2026
6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e32e1c12d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +134 to +136
let tag = self
.tags
.first()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind completed digests to the Service repository

When a Compose service declares explicit build.tags, capture preserves those tags before appending service.image, so the first metadata tag can name an auxiliary repository. Using that first tag here causes bind_builds and image delivery to use auxiliary-repo@sha256:... rather than the repository declared by the Service; for local deploys, an auxiliary repository containing a registry port can additionally trigger RegistryPortReference even when service.image itself is supported. Construct the digest reference from BuiltService.image instead of arbitrary tag ordering.

Useful? React with 👍 / 👎.

@nick-potts
nick-potts deleted the t3code/implement-803 branch September 30, 2026 15:15
nick-potts added a commit that referenced this pull request Sep 30, 2026
* Deploy immutable images from selected build Machines

* Release temporary build tags and validate destination architectures

* Let BuildKit validate cross-platform named image contexts

---------

Co-authored-by: Codex <codex@codex-vm.tailcb9c5.ts.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploy images directly from the build Machine

1 participant