Skip to content

fix(taskproto): bind-mount placement storage into containers (#570) - #575

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/570-container-efs-fsx-visibility
Sep 5, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/570-container-efs-fsx-visibility

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

Fixes spore.host/spawn#570 — three related sub-issues, (1) is the blocking bug.

Sub-issue 1 (blocking, fully implemented): writeContainerRun's docker run -v list (pkg/taskproto/wrapper.go) was built entirely from the input/output manifest via the old containerMountDirs, and never consulted spec.Placement. So a containerized task — every task in the aarch.bio/aarch.science one-tool-per-image model — never saw an EFS/FSx/volume that the boot-time storage script (cmd/task.go's taskStorageScript) had genuinely mounted onto the host. The host-argv path (spec.Container == "") saw it for free; only the container path was broken.

Fix: split the old containerMountDirs into two functions:

This resolves the "one function, two purposes" tension #564 established on purpose: placement mount points now appear in the docker-mount set but are explicitly excluded from the mkdir set. mkdir'ing a placement mount point before the boot-time mount lands risks creating a plain local directory that then gets silently shadowed once the real mount arrives — a new hazard, not the harmless no-op #564 was relying on for manifest-only directories. This split, and why, is documented in comments at both functions and the mkdir loop, plus two new tests:

  • TestGenerateWrapper_PlacementMountsIncludeInDockerRun — placement mounts appear in docker run -v.
  • TestGenerateWrapper_PlacementMountsNotInMkdirLoop — the same paths do not appear in the mkdir preamble.

Both are confirmed fail-without/pass-with (reverting the fix makes the test file fail to compile, since manifestMountDirs doesn't exist pre-fix).

Sub-issue 2 (cheap fix implemented; stretch goal deferred): TaskSpec.Validate() (pkg/taskproto/taskspec.go) now rejects a manifest entry whose S3-side value isn't actually an s3://... URI — mirroring the existing resources.s3_read_write check. Previously a spec like {"source": "/efs/refs/GRCh38.fa", "destination": "/tmp/GRCh38.fa"} passed Validate()/--dry-run and only failed at runtime (after a paid boot) because the wrapper unconditionally emits aws s3 cp for every manifest entry. The stretch goal — teaching the wrapper to dispatch on scheme so a manifest could reference a placement-mounted local path directly — is not implemented; scoped out per the issue's own stated preference, to avoid bypassing stage-in's ownership/mkdir handling (#564/#565) with a parallel code path. Confirmed fail-without/pass-with.

Sub-issue 3 (small fix implemented): added optional placement.efs_mount_point / placement.fsx_mount_point TaskSpec fields with Placement.EffectiveEFSMountPoint()/EffectiveFSxMountPoint() helpers (default /efs//fsx, matching today's hardcoded behavior). Both cmd/task.go's boot-time storage script and the new containerMountDirs now resolve the mount point through these same helpers, so the two can never independently hardcode diverging paths for the same spec.

Test plan

  • make check clean (fmt, vet, staticcheck warnings pre-existing/unrelated, short tests)
  • make check-docs clean — no flags/help text touched, docs-gen unchanged
  • All nested lambda/*/go.mod modules build (go build ./... in each)
  • Stray tracked binary lambda/autoscale-orchestrator/autoscale-orchestrator reverted before commit
  • New tests fail without the fix (confirmed via revert) and pass with it, for both sub-issue 1 and sub-issue 2
  • go test ./pkg/taskproto/... ./cmd/... all green

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.11111% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/task.go 0.00% 2 Missing ⚠️
pkg/taskproto/wrapper.go 90.90% 1 Missing and 1 partial ⚠️
pkg/taskproto/taskspec.go 91.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

…e manifest S3 sides (#570)

Sub-issue 1 (the blocking bug): writeContainerRun's `docker run -v` list was
built entirely from manifest input/output dirs and never consulted
spec.Placement, so a containerized task (every task, in the
aarch.bio/aarch.science one-tool-per-image model) could not see an
EFS/FSx/volume the boot-time storage script had genuinely mounted on the
host. Split the old containerMountDirs into manifestMountDirs (the narrow
"what stage-in must mkdir" set, unchanged from #564) and a new
containerMountDirs (the superset docker run -v now uses, adding placement
mount points) — placement paths must mount into the container but must NOT
be mkdir'd by stage-in, since that could race the boot-time mount.

Sub-issue 2 (cheap fix only): Validate() now rejects a manifest entry whose
S3 side isn't an s3:// URI, turning a paid-boot runtime `aws s3 cp` failure
into an immediate validate error. The stretch goal (teach the wrapper to
dispatch on scheme and copy a placement-local path directly) is deferred.

Sub-issue 3: added optional placement.efs_mount_point / fsx_mount_point
TaskSpec fields with Effective*MountPoint helpers (default "/efs"/"/fsx"),
used by both cmd/task.go's boot-time storage script and the new
containerMountDirs, so the two can't independently hardcode diverging paths.
@scttfrdmn
scttfrdmn force-pushed the fix/570-container-efs-fsx-visibility branch from 21f765c to 7940bf0 Compare September 5, 2026 01:21
@scttfrdmn
scttfrdmn merged commit 6c4d903 into main Sep 5, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/570-container-efs-fsx-visibility branch September 5, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant