[wanda] Add context_owner spec option and include in cache digest#481
Conversation
|
Reviews in this chain: |
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new ContextOwner field to the build specification, allowing users to override the UID and GID for files within the build context tar. The implementation correctly updates the spec structure, the build input core, and the forge logic to parse and apply these ownership settings. I have included a suggestion to ensure the ContextOwner field is processed through expandVar during specification expansion, which enables support for environment variable substitution and ensures proper cache invalidation.
| result.BuildHintArgs = stringsExpandVar(s.BuildHintArgs, lookup) | ||
| result.DisableCaching = s.DisableCaching | ||
| result.Artifacts = artifactsExpandVar(s.Artifacts, lookup) | ||
| result.ContextOwner = s.ContextOwner |
There was a problem hiding this comment.
The ContextOwner field should be expanded using expandVar to allow the use of environment variables (e.g., context_owner: $UID:$GID) in the specification. Currently, it is copied as a literal string, which prevents variable substitution and will cause parseContextOwner to fail if variables are used. Additionally, it ensures the cache is correctly invalidated when these environment variables change.
| result.ContextOwner = s.ContextOwner | |
| result.ContextOwner = expandVar(s.ContextOwner, lookup) |
c04891d to
c438d68
Compare
fac3b48 to
91254ad
Compare
c438d68 to
917c48a
Compare
91254ad to
08d056c
Compare
Add context_owner field to the wanda Spec, allowing .wanda.yaml files to specify a "uid:gid" override for all files in the build context tar. Wire it through resolveBuildInput to set the tarStream owner, and include it in buildInputCore so changing context_owner invalidates the cache. Topic: add-context-owner-spec Relative: add-context-owner-tar Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: andrew <andrew@anyscale.com>
917c48a to
0f7f787
Compare
Add context_owner field to the wanda Spec, allowing .wanda.yaml files to specify a "uid:gid" override for all files in the build context tar. Wire it through resolveBuildInput to set the tarStream owner, and include it in buildInputCore so changing context_owner invalidates the cache.
Topic: add-context-owner-spec
Relative: add-context-owner-tar
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Signed-off-by: andrew andrew@anyscale.com