Repository navigation
improve(docker): shorten release image preparation - #135877
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 12:43 AM ET / 04:43 UTC. ClawSweeper reviewWhat this changesThe PR speeds Docker release preparation by reusing the production dependency layer, exporting OCI images with fast gzip, and removing remote GitHub Actions build-cache transfers. Merge readinessKeep open for maintainer review. No concrete defect is visible in the introduced Docker stage or workflow wiring, but the exact-head two-architecture OCI preparation and sealing results are still incomplete and the artifact-size/performance tradeoff needs acceptance. Priority: P3 Review scores
Verification
How this fits togetherDocker release preparation builds default and browser OCI images for both native architectures, validates and seals them, then supplies the sealed artifacts to the separate publication workflow. The changed runtime-assets stage supplies the final image's compiled application files and production dependencies. flowchart LR
A[Release source and metadata] --> B[Docker release preparation]
B --> C[Production dependency image]
B --> D[Compiled build output]
C --> E[Runtime image assembly]
D --> E
E --> F[OCI smoke and attestation checks]
F --> G[Sealed publication artifacts]
Decision needed
Why: The code preserves the existing authority boundary and targeted assembly contract, but the release-path performance versus artifact-size tradeoff is operational policy rather than a purely mechanical correctness choice. Before merge
Agent review detailsSecurityNone. PR surfaceTests +3, Docs +7, Config -3, Other +1. Total +8 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single production-dependency base plus dependency-free build overlay, and land it only after exact-head native smoke/seal evidence confirms the compressed OCI artifacts preserve the existing release contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes release-image preparation performance rather than reporting a user-facing defect; the relevant verification is the hosted two-architecture OCI preparation path. Is this the best way to solve the issue? Yes, conditionally: inheriting production dependencies and overlaying dependency-free build output removes the redundant tree copy while preserving the existing final-image source boundary; exact-head smoke and sealing evidence remains required. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 54a9f3481d87. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review The final head Final-head CI passed all 204 selected jobs. The assembly and gzip preparations passed both native default/browser image checks and sealing; gzip reduced the whole preparation from 14m51s to 12m48s, with 12–14% larger combined artifacts. The final preparation is finishing with the source frozen at |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* perf(docker): inherit production dependencies during runtime assembly * perf(ci): use fast gzip for Docker release export * perf(ci): avoid unproductive release image cache transfers
What Problem This Solves
Docker release preparation spends time copying an already-installed production dependency tree, compressing image layers, and transferring a remote build cache with little useful reuse. The fresh baseline took 14m13s. This follows #135832, which reduced the previously much larger full-stage cache export.
Why This Change Was Made
Runtime assembly now inherits production dependencies and overlays build output after removing development dependencies. The stamped release manifest arrives with the output, eliminating the separate version-restoration copy. Both fresh frozen installs remain; compiled workspaces, generated plugin assets, nested runtime dependencies, native lifecycle output and the SDK bridge remain covered.
Both OCI exporters use gzip level 1 for newly compressed layers. This retains the existing Skopeo transport and digest-preserving promotion. Existing compressed blobs are reusable without forced recompression. The measured tradeoff is 12–14% larger combined default/browser artifacts.
The workflow removes both remote GHA cache imports/exports and retains the shared builder's internal cache. In the source-matched warm run, only four default-image setup vertices were cached; both dependency installs and compilation reran. Those setup steps had finished well before runtime assembly in the cold run. All 57 browser cache hits matched work already handled by the preceding default build. Remote exports added serial tail work without demonstrated elapsed-time savings. Docker documents internal caching separately from remote export/import.
User Impact
Source-built images avoid recopying production dependencies. Release preparation also reduces compression work and removes remote cache transfers. Fresh runners rebuild runtime setup, including mutable Debian and npm updates, as existing cold builds already do. The workflow still uses one builder for both variants and retains all OCI, version, dependency, non-root, browser, attestation, sealing and publication checks.
Evidence
d157f910a295d157f910a2953b60e6bff7453b60e6bff7453b60e6bff745389196db509f3b60e6bff745aa861f0c0248The final preparation saved 3m44s (26.3%) against the 14m13s baseline, and 2m19s (18.1%) against the gzip run with remote caching. All four exports have no remote cache arguments or cache-export phase; both browser solves retained 56 local cache hits. These are observed runs, not a guaranteed duration.
The replacement copy fell from 32.9s to 6.9s on amd64 and 30.4s to 5.3s on arm64. Assembly alone did not improve whole-run time: longer cache uploads outweighed that saving. Gzip reduced default layer export from 85.1s to 33.1s on amd64 and 57.6s to 26.0s on arm64. Combined default/browser OCI artifacts grew from 2.62 to 2.98 GB on amd64 (+13.5%) and 2.64 to 2.96 GB on arm64 (+12.5%); these include duplicated shared blobs and are not individual image sizes.
The assembly/gzip/cache comparisons freeze application source at
3b60e6bfand change workflow tooling. The first comparison changes the Dockerfile on the baseline source. All use versionv2026.8.1,diagnostics-otel,codex, native 4-CPU GitHub runners, and the same Buildx/BuildKit versions; normal build timestamps vary. Completed default solves had zero cached vertices, and the browser variants reused the same-job builder. The final run imports no remote cache. Full workflow time includes setup, uploads and cleanup; component timings are not sums of overlapping BuildKit work. No package, registry image or release is published by these runs.45 focused Docker/plugin tests and 139 release artifact/workflow tests passed. The executable assembly fixture covers both plugin-directory names, production native files and metadata, nested dependencies, the workspace link, generated SDK assets, and a correction version differing from the production manifest. CI caught
TS18048in its optional regex capture; the guard is fixed, all 34 Dockerfile tests pass again, and the exact failed core-test stripe passes.Workflow validators, formatting and diff checks pass, and Codex autoreview is scoped-clean at the default P0 threshold. CI on the gzip head passed 204 jobs; final-head CI also passed all 204 selected jobs. The final native preparation passed both architectures, both variants, OCI checks and sealing. This completes the latest ClawSweeper timing/image evidence request; a refresh for the remote-cache change was requested before landing.
The successful gzip run recorded recovered BuildKit cache-write messages. Both it and the final run recorded a non-fatal amd64 builder-volume cleanup timeout after image validation/upload; those 20 seconds remain included in the timings, and both architecture jobs plus sealing passed. Default smoke exercises workspace bootstrap without provider credentials; it does not prove an authenticated provider turn. The Matrix native-addon check is outside this selected-plugin matrix.
Production build/workflow delta: +15/-17 lines; tests: +29/-26; docs: +15/-8. No new runtime/configuration surface.
The latest ClawSweeper review has no code findings. Its timing and sealing requests are satisfied by the completed run above. The application source stayed frozen for comparison: it contains the byte-identical changed Dockerfile, while tooling is the final PR head. An additional native run for the intervening docs/test changes is unnecessary; final-head CI passed. The reviewer environment's upstream/main access gap was covered by direct Docker/BuildKit contract inspection and a current-main comparison of all five changed paths. The documented artifact-size tradeoff is accepted for the requested preparation speedup.
Follow-up
Standalone partial Docker reruns need separate recovery proof:
resolverecords an artifact name for its attempt, while sealing validates current-attempt metadata. This pre-existing source-identified coupling is unchanged here; all measurements use fresh workflow dispatches.The repeated amd64 Buildx volume-cleanup timeout is a separate upstream cleanup follow-up; the measured preparation result includes it.