Skip to content

feat(fsx): async create for ephemeral FSx on launch + spored DRA (#194 part 2) - #199

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/194-launch-async-fsx
Jun 16, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/194-launch-async-fsx

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #194 — the launch-side half (part 1, spored mount, merged in #198). Together these make --fsx-create --fsx-lifecycle ephemeral fully non-blocking, which is what lagotto#43 needs.

What

spawn launch --fsx-create --fsx-lifecycle ephemeral no longer blocks ~10 min on FSx provisioning:

  1. pkg/aws refactor: CreateFSxLustreFilesystem split into startFSxCreate (paths/bucket/subnet + CreateFileSystem) + waitAndAssociateFSx (blocking wait + DRA). New CreateFSxLustreFilesystemAsync returns the fs-id immediately — no wait, no DRA. associateFSxS3 extracted (continuous NEW/CHANGED/DELETED export).
  2. cmd/launch: ephemeral → async create (co-located in the instance's subnet for AZ-mountability) + sets config.FSxPending and the import/export paths; durable → blocking create as before. Lustre SG ports ensured up front for both.
  3. buildTags: writes spawn:fsx-pending + mount-point + import/export when pending (deliberately not spawn:fsx-id — spored flips that after it mounts, so the reaper refcount only counts a mounted instance).
  4. spored: mountPendingFSx (from part 1) now sets up the S3 export DRA after AVAILABLE and before mounting — the decision from FSx ephemeral path: async-create + spored wait-and-mount (instance-owned, lagotto-safe) #194 (spored owns the DRA so launch never blocks). Best-effort: mounts anyway if the DRA call fails.

Why DRA-on-spored

The export association can only be created once the FS is AVAILABLE; doing it launch-side would re-introduce the blocking wait. So spored does it — continuous export means results mirror to S3 as the job writes them (the #184 durability lesson), not a single end-of-job flush.

Tests

TestBuildTags_FSxPending (writes fsx-pending + paths, not fsx-id); existing lifecycle-contract, reaper, agent suites green. Builds linux/darwin/windows; go vet/gofmt clean.

Caveats

  • Live validation pending: the create→AVAILABLE→DRA→mount path can't be exercised against substrate (substrate#331). Wants a real --fsx-create --fsx-lifecycle ephemeral run (paid, leak-checked) before the feature is announced.
  • IAM (deploy-side): spored's instance role needs fsx:CreateDataRepositoryAssociation + fsx:DescribeFileSystems.

Unblocks lagotto#43 (just forwarding the fsx: block now).

…part 2)

Completes the ephemeral-FSx path. --fsx-create --fsx-lifecycle ephemeral no
longer blocks the launch on the ~10-min FSx provisioning:

- pkg/aws: refactor CreateFSxLustreFilesystem into shared startFSxCreate (input
  + CreateFileSystem) + waitAndAssociateFSx (blocking wait + DRA). New
  CreateFSxLustreFilesystemAsync returns the fs-id immediately (no wait, no DRA).
  associateFSxS3 extracted (continuous NEW/CHANGED/DELETED export).
- cmd/launch: ephemeral → async create (co-located in the instance's subnet),
  set config.FSxPending + import/export paths; durable → blocking as before.
  Lustre SG ports ensured up front for both paths.
- buildTags: writes spawn:fsx-pending + mount-point + import/export when pending
  (not spawn:fsx-id; spored flips that after mounting).
- spored: mountPendingFSx now sets up the S3 export DRA (createFSxS3Association,
  raw fsx SDK) after AVAILABLE and before mounting; best-effort (mounts anyway on
  DRA failure). Reads import/export paths from tags via provider.Config.

Tests: buildTags writes fsx-pending (and not fsx-id) for the async path; existing
lifecycle-contract + reaper + agent tests green. builds linux/darwin/windows;
vet/fmt clean. Docs updated (ephemeral is now async/non-blocking).

IAM (deploy-side): spored instance role needs fsx:CreateDataRepositoryAssociation
and fsx:DescribeFileSystems.

Closes #194
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 6.62252% with 141 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/fsx.go 0.00% 66 Missing ⚠️
cmd/launch.go 0.00% 41 Missing ⚠️
pkg/agent/fsx_mount.go 0.00% 27 Missing ⚠️
pkg/provider/ec2.go 0.00% 4 Missing ⚠️
pkg/aws/client.go 76.92% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit ebbd38f into main Jun 16, 2026
6 of 7 checks passed
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.

FSx ephemeral path: async-create + spored wait-and-mount (instance-owned, lagotto-safe)

1 participant