Skip to content

feat(fsx): explicit fail-closed lifecycle contract for --fsx-create (#193) - #197

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/193-fsx-lifecycle-contract
Jun 16, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/193-fsx-lifecycle-contract

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #193. The user-facing contract layer of the FSx chain (gated by #192, which merged; drives #194 → lagotto#43).

The rule

An auto-created FSx is expensive (~$150–200/mo) and holds the only copy of results, so its lifetime is stated explicitly, never inferred or defaulted — fail-closed:

Wiring

Docs

New canonical docs/durable-storage-fsx.md — leads with the lifetime decision table before any flags, the per-lifetime cost (incl. the durable AZ-pinning tradeoff vs. lagotto's capacity breadth), and the reaper's safety promise. lagotto's spawn-config docs will link here (single source of truth). The standalone spawn fsx create --name surface is explicitly marked as landing in #195.

Tests

TestBuildLaunchConfig_FSxLifecycleContract — 7 cases (missing lifecycle, durable w/o ttl, durable ok + threaded, ephemeral+ttl rejected, ephemeral ok, invalid lifecycle, lifecycle-without-create). cmd + pkg/aws green; go vet/gofmt clean.

Unblocks #194 (ephemeral async-create path).

…193)

An auto-created FSx is expensive and holds the only copy of results, so its
lifetime must be stated, never inferred:
- --fsx-create now REQUIRES --fsx-lifecycle ephemeral|durable; missing → error.
- durable REQUIRES --fsx-ttl (no death-clock-less filesystem); ephemeral rejects
  a TTL (it's reaped with the instance via refcount, #192).
- --fsx-lifecycle/--fsx-ttl without --fsx-create → error.

Threads FSxLifecycle/FSxTTL through LaunchConfig (so the headless path #194
carries it) and FSxConfig; CreateFSxLustreFilesystem stamps spawn:fsx-lifecycle
and, for durable, spawn:ttl-deadline (now+ttl) so the reaper has a deadline.

New canonical doc docs/durable-storage-fsx.md leads with the lifetime decision
table + per-lifetime cost (incl. the durable AZ-pinning tradeoff); the standalone
`spawn fsx create --name` surface is marked as landing in #195.

Tests: TestBuildLaunchConfig_FSxLifecycleContract (7 cases: missing lifecycle,
durable w/o ttl, durable ok + threaded, ephemeral+ttl rejected, ephemeral ok,
invalid lifecycle, lifecycle-without-create). cmd + pkg/aws green; vet/fmt clean.

Closes #193
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.88889% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/fsx.go 0.00% 12 Missing ⚠️
cmd/launch.go 66.66% 10 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit b3268f9 into main Jun 16, 2026
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 auto-create: explicit lifecycle contract (ephemeral|durable), fail-closed, + canonical docs

1 participant