Wire SANDCASTLE_CONTAINER_UID/GID env vars through to SandboxRunner#108
Merged
Conversation
sandbox-runner.ts already validates a built image's UID/GID against RunnerOptions.containerUid/containerGid (default 1000), but main.ts never set them from env — only SANDCASTLE_IMAGE was wired. Any custom base image with a non-1000 non-root user (e.g. the dotnet SDK base's uid 1654) hit a hard UID-mismatch failure with no way to override it short of editing main.ts directly. Discovered via the live dotnet-recipe validation run (issue #4): all 3 retries failed with the same WorktreeError before this fix.
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.
Summary
sandbox-runner.tsalready validates a built inner image's UID/GID againstRunnerOptions.containerUid/containerGid(defaulting to 1000), butmain.tsnever populated those fields from the environment — onlySANDCASTLE_IMAGEwas wired through.appuser at 1654, used byDockerfile.dotnet) hit a hardWorktreeError: UID mismatchwith no way to override it short of editingmain.tsitself.SANDCASTLE_CONTAINER_UID/SANDCASTLE_CONTAINER_GIDenv vars, mirroring the existingSANDCASTLE_IMAGEpattern, and documents them in the module docstring.examples/dotnet-project/orchestrator.envto set both to 1654 so that recipe actually works end-to-end.Found while running issue #4 (live end-to-end
/afkvalidation) in.scratch/dotnet-afk-support/— all 3 retries failed identically before this fix.Test plan
npm run typecheckcleannpm test— 229/229 passing/afkvalidation againstlsfera/dotnet-afk-proofwith the new env vars set, confirm the UID-mismatch error is gone