Repository navigation
fix(taskproto): run task containers as the invoking uid:gid (#555) - #557
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
spawn task run's container path staged inputs/outputs as the instance user (uid 1000 on AL2023, default umask -> 0755) but launched docker run with no --user, so the container ran as whatever USER the image declares. That's the default posture for the entire bioconda/ conda-forge container ecosystem (every image built on mambaorg/micromamba defaults to uid 57439/mambauser), so any such task writing back into its staged directories got EACCES, surfacing as an opaque stage-out failure. docker run now passes --user "$(id -u):$(id -g)" so the container always runs as the uid:gid that owns the bind-mounted staging dirs, regardless of the image's declared USER. Checked examples/ for any task-spec example relying on an image's own non-default USER (e.g. writing into $HOME or a conda prefix at runtime) and found none, so this is applied unconditionally with no opt-out, matching the issue's own preferred fix. Also documents (without fixing, to avoid scope creep) a related latent gap: output-only directories not shared with any input are never mkdir'd on the host before docker run, so Docker's own auto-create of a missing bind-mount source (owned by root) would still not be writable even with --user set.
scttfrdmn
force-pushed
the
fix/555-container-uid-mismatch
branch
from
September 2, 2026 23:03
9987435 to
4a8386f
Compare
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
spawn task run's container path staged inputs/outputs as the instance user (uid 1000 on AL2023, default umask -> 0755) but launcheddocker runwith no--user, so the container ran as whateverUSERthe image declares. That's the default for the entire bioconda/conda-forge container ecosystem (every image built onmambaorg/micromambadefaults to uid 57439/mambauser) — any such task writing back into its staged directories gotEACCES, surfacing only as an opaque stage-out failure.docker runnow passes--user "$(id -u):$(id -g)"so the container always runs as the uid:gid that owns the bind-mounted staging dirs, regardless of the image's declaredUSER. This is Option A from the issue, applied unconditionally with no opt-out flag — greppedexamples/for any task-spec relying on an image's own non-defaultUSER(e.g. writing into$HOMEor a conda prefix at runtime) and found none.mkdir -p'd on the host beforedocker runruns — see the comment abovecontainerMountDirsinpkg/taskproto/wrapper.go.Fixes #555
Test plan
TestGenerateWrapper_ContainerRunsAsInvokingUserasserts the generated wrapper text contains--user "$(id -u):$(id -g)"in thedocker runline. Confirmed it fails against the pre-fix code (FAIL, missing string) and passes after the fix.TestGenerateWrapper_ContainerRunLineExecutesWithRealUIDextracts the actual generateddocker runline and execs it for real underbashwith stand-insudo/dockerPATH scripts, asserting the substituted--uservalue matches the real process's uid:gid (pattern borrowed frompkg/launcher/bootstrap_test.go'sTestBuildLinuxBootstrap_ParamValueSurvivesRealShellParsing). Also confirmed fail-without/pass-with.TestGenerateWrapper_PrivateECRContainerWithGPU) whose exact-string assertion needed the new--usersegment.make checkclean.make check-docsclean (no flag/help text touched, no diff).lambda/*modules build cleanly (github-oauthis Python, no go.mod).## [Unreleased] / ### Fixedentry added, explicit that this affects the whole bioconda/conda-forge ecosystem, not one image.