Resolve sandbox base digests without registry reads and force amd64 base builds - #30
Merged
Merged
Conversation
…ase builds Two verified incidents on Fly and AWS deployments: qm sandbox publish --from <tag> resolved the base digest with docker buildx imagetools inspect against the Fly registry, which fails with the app-scoped deploy token the docs mandate (only org tokens can read the registry). Publish now resolves mutable base tags with docker pull + RepoDigests, the same pull path the layer build itself uses, so a push-capable token suffices and publish never reads the registry API. pinnedByDigest remains only for fly rollback --to <tag>, where no build exists to piggyback on; its failure message now prints the workaround of passing a digest-form ref, which skips the lookup entirely. Building the sandbox base on an arm64 Mac defaulted to arm64, which deploy rejects, and qemu-emulated amd64 builds are slow and crash in apt. scripts/local-sandbox-build.sh now targets linux/amd64 explicitly and, when FLY_SANDBOX_APP_NAME is set and flyctl is installed, builds on Fly's remote amd64 builder and pulls the result instead of emulating locally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes two verified incidents hit on real deployments (one Fly, one AWS).
1.
sandbox publish --from <tag>fails with the mandated app-scoped Fly tokenqm sandbox publishpinned a mutable--frombase by runningdocker buildx imagetools inspectagainst the registry. Fly's registry rejects reads from app-scoped deploy tokens (only org tokens can read it), so publish failed exactly on the token the docs tell operators to use — while the build's owndocker pull/pushwith that token works fine.docker pull --platform linux/amd64+ the recordedRepoDigestsentry (newpinnedByPull), the same pull path the layer build already depends on. The pulled digest is the tag's top-level manifest/index digest — identical to whatimagetools inspectreturned — so recordedsandbox.baseImagepins are unchanged in form and remain pullable by machines. Publish no longer touches the registry read API at all.pinnedByDigest(inspect) remains only forfly rollback --to <tag>, where there is no build to piggyback on; its failure message now prints the exact workaround — pass the digest form<repository>@sha256:…, which skips the lookup entirely.2. arm64 hosts build a base image the deploy rejects
Building the sandbox base on an Apple Silicon Mac defaulted to
linux/arm64(rejected at deploy time, since sandbox machines are amd64-only), and retrying with--platform linux/amd64under qemu is slow and crashes in apt.scripts/local-sandbox-build.shnow targetslinux/amd64explicitly for both stages, and whenFLY_SANDBOX_APP_NAMEis set andflyctlis installed it builds on Fly's remote amd64 builder (flyctl deploy --build-only --push --remote-only --dockerfile fly/Dockerfile) and pulls the result instead of emulating locally. No new flags — better defaults only. (npm run deploy:fly-imagealready used the remote builder.)fly/README.mddocuments the amd64 requirement and the remote-builder behavior.Tests
--froma Fly-registry tag pins by pull, never invokesimagetools inspect, flattens the layer Dockerfile onto the pinned ref, and records the pin.pinnedByDigestworkaround-message assertion; test docker fake now modelspullandimage inspect.cli/test/sandbox-publish.test.ts,sandbox-build,fly-sandbox,fly-up,package, rootsandbox-base-image/local-sandboxtests all green;tsc --noEmitand eslint/oxlint clean.An independent fresh-context review pass was run on the diff; its two findings (docker auth before the registry pull in the script, and a workaround message that also covers the custom-Dockerfile path) are addressed.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.