Repository navigation
Description
Summary
recursiveFlag advertises directory staging — a Manifest whose Source ends in
/ gets aws s3 cp --recursive (pkg/taskproto/wrapper.go:288). For an
output on the container path, that form cannot work unless an input happens to
share the same directory. The tool fails to write before it produces anything.
This is the user-visible consequence of the gap already documented in the NOTE
above containerMountDirs — filing it separately because that note frames it as a
latent edge case, and it is actually "a documented output form that does not
function."
Mechanism (file:line)
Given outputs: [{source: "/tmp/out/", destination: "s3://.../out/"}]:
path.Dir("/tmp/out/")is"/tmp/out"— verified against Go'spathpackage,
not assumed:Sopath.Dir("/tmp/out/") = "/tmp/out"containerMountDirsadds/tmp/outto the mount list
(wrapper.go:264-280).- The stage-in loop's
mkdir -piteratesspec.Inputsonly
(wrapper.go:87). Nothing creates/tmp/outon the host. docker run -v /tmp/out:/tmp/outtherefore auto-creates it — and dockerd does
that as root, mode 0755.- The container is not root. On v0.102.0 it runs as the image's own user
(wrapper.go:233); after 4a8386f it runs as the invoking uid:gid. Either
way it cannot write into a root-owned 0755 directory. - The tool gets
EACCESon its first write. And because stage-out's result is
computed and discarded (Task path discards failure information: a lost output is reported as completed/exit 0, and a stage-in failure can produce no record at all #561), a task that produced nothing can still be
recordedstate: completed, exit_code: 0.
Measured, not inferred
This is the same failure mode the uid probe in #555 measured directly: with
destinations under /tmp/pw/out/, the probe reported Permission denied for a
root-owned output parent while /tmp itself succeeded. The probe also showed why
--user "$(id -u):$(id -g)" alone does not close this: it fixes input parents
(mode 0755, owned 1000:1000) and leaves output parents root-owned.
Why it matters more than it looks
Directory outputs are the natural shape for a large class of real work — any
aligner or profiler index (salmon index, STAR --runMode genomeGenerate,
bwa index, kallisto index) is a directory, not a file. Hitting this means
either discovering the mechanism above or concluding that spawn cannot ship an
index.
Also: examples/task-spec.json uses a nested layout, so the example every new user
copies first is on the failing side of this.
Suggested fix
Include output Source parents in the stage-in mkdir -p loop, alongside input
Destination parents — one loop over the same set containerMountDirs already
computes. That makes the dirs exist, owned by the invoking user, before
docker run can create them as root.
Mitigation in use
tar the directory into a single flat file under /tmp (mode 1777, the one
reliably writable mount), ship that, and untar in the consuming task. Working
examples: recipes/salmon/01-index.task.json and
recipes/star/01-index.task.json in scientific-codes-cookbook.
Activity
Five recipes: salmon, hmmer, blast, iqtree, star
fix(taskproto): create output-only mount dirs and fix staged-input ow…
fix(taskproto): create output-only mount dirs and fix staged-input ow…
fix(taskproto): bind-mount placement storage into containers, validat…
fix(taskproto): bind-mount placement storage into containers, validat…
fix(taskproto): create bind-mount dirs with privilege, so top-level p…
chore(release): v0.117.0