Repository navigation
feat(spored): mount async-created FSx at runtime (#194 part 1) - #198
Merged
Merged
Conversation
The agent half of the ephemeral-FSx path. spored gains its first runtime mount capability: when an instance carries spawn:fsx-pending=<fs-id> (set by the launch side, part 2), spored polls DescribeFileSystems until the filesystem is AVAILABLE, mounts it (Lustre, Linux), and flips the tag to spawn:fsx-id so the reaper refcount (#192) counts the instance as a live user. - pkg/provider: Config.FSxPending / FSxMountPoint; ec2.go maps spawn:fsx-pending + spawn:fsx-mount-point in loadConfigFromEC2Tags. - pkg/agent: mountPendingFSx goroutine started from Monitor OFF the lifecycle critical path (same #65 discipline as spot monitoring — a ~10min poll must never gate TTL/idle/on-complete/pre-stop). Bounded 25m wait; best-effort, never terminates over a failed mount; idempotent (skips if already mounted). - sysMountLustre: real mount on Linux (install client, modprobe, mount -t lustre, fstab); no-op error on windows/other. Tests: mountPendingFSx no-ops promptly when nothing pending; shellQuoteArg escaping (linux). builds linux/darwin/windows; vet/fmt clean. Refs #194
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jun 16, 2026
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.
Part 1 of #194 — the agent half (the genuinely new capability). Part 2 (launch fires async
CreateFileSystem+ tagsspawn:fsx-pending) follows; lagotto#43 unblocks after both.What
spored gains its first runtime mount capability. Today FSx is mounted only by first-boot user-data, which can't wait for a still-
CREATINGfilesystem. So for the ephemeral path (FSx created async alongside the instance), spored:spawn:fsx-pending=<fs-id>+spawn:fsx-mount-pointfrom tags;DescribeFileSystemsuntil AVAILABLE (bounded 25 min);mount -t lustre, Linux) + fstab line, idempotently;spawn:fsx-idso the reaper refcount (ttl-reaper must reclaim orphaned FSx Lustre filesystems (cost backstop; prerequisite for any FSx auto-create) #192) counts this instance as a live user of the filesystem.Safety (the #65 discipline)
The poll can block for ~10 min, so
mountPendingFSxruns in its own goroutine off the lifecycle ticker — exactly like spot monitoring. It must never gate TTL/idle/on-complete/pre-stop. Best-effort throughout: a failed or slow mount logs + notifies (fsx_mount_failed) but never terminates the instance. Idempotent on a spored restart (skips if already mounted).Mechanics
pkg/provider:Config.FSxPending/FSxMountPoint;loadConfigFromEC2Tagsmaps the two tags (single authoritative mapping, used by bothGetConfigandRefreshConfig).pkg/agent/fsx_mount.go: orchestration;sysMountLustrereal on Linux (sys_linux.go), no-op error on windows/other.Monitorstartsgo a.mountPendingFSx(ctx)beside the spot goroutine.Tests
mountPendingFSxreturns promptly when nothing is pending (the common case — guards against an accidental AWS call/hang);shellQuoteArgescaping (Linux). Builds linux/darwin/windows;go vet/gofmtclean.Refs #194.