Repository navigation
fix(taskproto): bind-mount placement storage into containers (#570) - #575
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 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
force-pushed
the
fix/570-container-efs-fsx-visibility
branch
from
September 5, 2026 01:21
21f765c to
7940bf0
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
Fixes spore.host/spawn#570 — three related sub-issues, (1) is the blocking bug.
Sub-issue 1 (blocking, fully implemented):
writeContainerRun'sdocker run -vlist (pkg/taskproto/wrapper.go) was built entirely from the input/output manifest via the oldcontainerMountDirs, and never consultedspec.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'staskStorageScript) 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
containerMountDirsinto two functions:manifestMountDirs— the narrow set (inputDestinationparents + outputSourceparents) that the stage-inmkdir -ploop uses. Unchanged behavior from task: directory outputs (Manifest source ending in /) cannot work on the container path #564.containerMountDirs— the new superset used fordocker run -v:manifestMountDirsplus everyPlacementmount point (Volumes[].MountPath, the EFS mount, the FSx mount).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 indocker 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
manifestMountDirsdoesn'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 ans3://...URI — mirroring the existingresources.s3_read_writecheck. Previously a spec like{"source": "/efs/refs/GRCh38.fa", "destination": "/tmp/GRCh38.fa"}passedValidate()/--dry-runand only failed at runtime (after a paid boot) because the wrapper unconditionally emitsaws s3 cpfor 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_pointTaskSpec fields withPlacement.EffectiveEFSMountPoint()/EffectiveFSxMountPoint()helpers (default/efs//fsx, matching today's hardcoded behavior). Bothcmd/task.go's boot-time storage script and the newcontainerMountDirsnow resolve the mount point through these same helpers, so the two can never independently hardcode diverging paths for the same spec.Test plan
make checkclean (fmt, vet, staticcheck warnings pre-existing/unrelated, short tests)make check-docsclean — no flags/help text touched, docs-gen unchangedlambda/*/go.modmodules build (go build ./...in each)lambda/autoscale-orchestrator/autoscale-orchestratorreverted before commitgo test ./pkg/taskproto/... ./cmd/...all green