Repository navigation
fix: honor docker.runOptions and make work dir writable (#39) - #40
Merged
Merged
Conversation
Containerized tasks dropped the engine-scope `docker.runOptions` and the per-process `containerOptions` directive, so a container that needed e.g. `--user root` ran as the image's default user. Combined with a root-owned bind-mounted work dir, a non-root image user couldn't write its outputs and failed with "Permission denied". resolveDockerRunOptions() now gathers both `docker.runOptions` (from the task's ContainerConfig) and `containerOptions`, and buildRunLine splices them verbatim before the image. The staging script also `chmod 0777`s the work dir before the container runs, so a non-root user can write outputs regardless.
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.
Closes #39.
Problem
The filer validated #37/#38 (input staging) works — but hit a new blocker:
containerized tasks ignored
docker.runOptions(and the per-processcontainerOptionsdirective), so the container ran as the image's default(non-root) user. Combined with a root-owned bind-mounted work dir, the
container user couldn't write its outputs and the task failed with
Permission denied.Fix (both halves the filer recommended)
resolveDockerRunOptions(task)gathersdocker.runOptions(from the task'sContainerConfig) andcontainerOptions, andbuildRunLinesplices them verbatim before theimage — so
--user root(and anything else) is applied.chmod 0777s${LOCAL_DIR}before the container runs, so a non-root image user can writeinto the bind-mounted dir regardless of run options.
Both are null-safe/best-effort: if run options can't be resolved, the task runs
with none (today's behavior) rather than aborting.
Tests
3 new Spock tests (33 total, 0 failures):
buildRunLinesplices run options before the imagebuildRunLineomits the separator when no options givenchmod 0777and the resolved options reach the run lineBuilt + tested on JDK 17 / Nextflow 26.04.x.