Repository navigation
devcloud: a package layer of its own and a 6 s image export (board #116) - #340
Merged
Merged
Conversation
…ages.sh alone (board #116) setup.sh runs image/packages.sh first, so a VM builder and adopt still run one recipe; the Dockerfile runs packages.sh as its own RUN, before the build inputs, and the rest of setup.sh after them with DEVCLOUD_PACKAGES=installed. A change elsewhere in devcloud/ now reuses the package layer from a cache. devcloud 0.8.1. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…parts (board #116) Profiled on a CI runner, the image check's 96 s was the export: the rootfs streamed out through docker run's attach took 82 s, the bun scan 9.5 s and dpkg 4.4 s. A tar inside a container of the image onto a bind mount copies the same files (listing equal) in 6 s, so the scan is not sharded (4 shards would save about 5 s). With the image part down to about 30 s, the one-shot cases join it and projects joins host. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Board #116: cache-friendly devcloud image layers and a faster image check. Full account:
docs/doperpowers/plans/2026-10-22-devcloud-image-layers-report.md.What changed
setup.shinto a newdevcloud/image/packages.sh, which takes no input.setup.shruns it after its input checks, so a VM bake and adopt still run one recipe. The Dockerfile runspackages.shas its ownRUN: it mounts that one file and comes before the buildARGs, so the layer is keyed onpackages.shalone. The rest ofsetup.shruns after it (DEVCLOUD_PACKAGES=installed). devcloud is now 0.8.1, since the recipe changed.docker run's attach took 82 s, against 9.6 s for the bun scan and 4.4 s for dpkg.check_image.exportnow runs the same tar inside a container of the image, onto a bind mount at a random path, then chowns the copy back to the caller. That takes 6 s, and the file listing is the same as the old export's. I did not shard the scan: 4 shards would save about 5 s, at the cost of a second way for a fail-closed check to read less than the image holds.PARTSis nowimage= image + one-shot,host= host + projects,systemd= systemd.Validation Evidence
Before and after (CI runs on 4-vCPU runners; "before" is #336's PR run 39704697659, "after" is run 39718389395 on ed5e6fd):
image_is_cleanalone: 96 s → 16 s)The unsharded run (a throwaway
devcloud-allgate, same run) went from 8m38s to 7m33s, with integration 289 s → 215 s.Profile (run 39716683368, instrumented scanner on a throwaway commit): export 82.3 s; scan 9.6 s (pattern detection 4.3 s, known-value search 3.0 s, reads 0.9 s, walk 0.4 s); dpkg 4.4 s. Export methods compared in run 39717304822:
docker run tar | tar -x(the old one)docker exportThe PR's own run (39719781323 on 2ed14dc, all green): devcloud-unit 1m19s; devcloud-image 4m01s (build 146 s, integration 70 s,
image_is_clean16 s); devcloud-host 4m05s (build 138 s, integration 87 s); devcloud-systemd 3m12s (build 115 s, integration 67 s). The set's wall time was 4m05s, against 4m50s for #336's PR run. Build variance between runners (115–146 s) now sets the slowest gate, and the build is what the layer cache addresses.Every case runs exactly once. The unsharded run printed 44 case lines and the three parts 46. Without "the stand-ins start", which each part runs once, both lists hold the same 43 cases, sorted equal, with no duplicate and no failure.
Same findings on a dirty image. The planted-image case (a known value in a text file, in a binary and in
docker history; a credential file; a token) passes in the image gate, as do the fail-closed cases (a crashed scanner, a scanner that reads nothing, an unreadable directory, a missing image, a broken dpkg database). On the real image, the check finds the same 460 detections inside package-owned trees and none outside them.The layer cache (run 39719236090: three builds in sequence on one runner, BuildKit's local cache):
devcloud/bootpackages.shLive proof on GCE.
devcloud vm image build --account gcebakeddc-img-dee63a031ef3-…in 7m17s, and its builder was deleted.devcloud vm up --project SSFSKIM/doperpowers@devcloud-image-layerswas created from that image, ready in 3m39s, anddevcloud statusshowed all 12 stepsok, projects included. The same day, the VM was takendownand the image deleted; no other devcloud image existed on the account. No adopt was run: the container integration covers setup.sh on a plain host.Review.
doperpowers:reviewer-mediumreviewed 53b6587..ed5e6fd and found nothing material.Residue
packages.shinstalls "latest" from release URLs and apt repositories. Keyed on the file alone, a cross-run cache would keep testing its first build's package set while VMs bake fresh ones. When ci-kit's cache lands, the key should carry an age bound (a weekly component, say).check_imageunder colima. The export bind-mounts a temporary directory. Docker Desktop shares macOS's temp directories, but colima by default shares only $HOME. There the check fails closed with a hint. If someone runs the check under colima, the work directory should move under $HOME.Sminos-Session: devcloud setup#639ca648 (macbook on macbook)