tools: add support for Twoliter.override in docker-run - #539
Open
jpculp wants to merge 1 commit into
Open
Conversation
Signed-off-by: Patrick J.P. Culp <[email protected]>
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.
Description of changes:
make full-configignoredTwoliter.overridewhilemake(the normal build path) honored it. This PR makestools/docker-run.shresolve the Bottlerocket SDK image through Twoliter when an override is present, sofull-confignow runs inside the same (possibly overridden) SDK container as a regular build.Why the two paths behaved differently:
The kernel kit has two ways of launching work in the SDK container:
make/make builddelegates to the Twoliter binary (twoliter build kit ...). Twoliter itself readsTwoliter.toml, layersTwoliter.overrideon top, and resolves the final SDK image. Overrides are therefore honored automatically.make full-configdoes not go through Twoliter. It runstools/docker-run.sh, which picked the SDK image itself by greppingTwoliter.lock:The key insight is that
Twoliter.overrideis intentionally never written intoTwoliter.lock. The lock file always records the canonical SDK source (e.g.public.ecr.aws/bottlerocket/bottlerocket-sdk:v0.79.0) plus its digest, so it remains a reproducible, shareable record. The override is a local,.gitignored redirect that Twoliter applies at runtime. Becausedocker-run.shonly read the lock'ssourceline, it could never see the override — sofull-configalways tried to pull the canonical image and failed when that image wasn't the one the developer intended to use:Testing done:
Verified
find_sdk:Twoliter.overridepresent → resolves to the overridden image (e.g.<account>.dkr.ecr.<region>.amazonaws.com/<name>:v0.79.0).Twoliter.override→ falls back to the canonicalpublic.ecr.aws/bottlerocket/bottlerocket-sdk:v0.79.0fromTwoliter.lock.bash -n tools/docker-run.shpasses (syntax check).stderrand is not captured into theSDKvalue.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.