Skip to content

fix(sweep): resume rebuilds every member from the launch's full recorded config (#1400) - #1405

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1400-resume-full-config
Oct 28, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1400-resume-full-config

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1400

A resume rebuilt each pending member from the param file plus the IAM (#1385) and lifetime (#1394) records, so --pre-stop, --tag/--team, network, storage, purchase, webhooks, spored settings and the bootstrap inputs were all dropped.

Record format (member in ~/.spawn/sweeps/<id>.json, schema 1)

Resume = launch

Members are built with the launch's own sweepMemberConfig (newly extracted from foregroundSweepMembers), with the same defaults folding (seedSweepDefaults, foldVolumeSize, spend controls). The recorded bootstrap is installed, then the resume runs the same storage lookups, the same target-OS resolution and the same renderForegroundSweepUserData. resumeUserData is removed.

Secrets (not written to disk)

  • --spot-webhook-url, --completion-webhook-url: an incoming-webhook URL is itself the credential, and spawn can't re-derive it. The resume must be given it again under the same flag name, and the refusal names the URL's scheme://host only.
  • --webhook-correlation: an opaque blob that callers use to authenticate callbacks, so it gets the same treatment.
  • Inline --user-data: scripts commonly export tokens, so it must be re-passed. The file forms are recorded by path and hash, and a resume refuses if the file is missing or has changed. --config gets the same path-and-hash treatment, since plugin config can hold auth keys.
  • Everything else in the base is stored. --pre-stop, --command, tags and the rest are already delivered as EC2 tags readable through DescribeTags. Checkpoints are now written 0600, and an existing file is chmodded.

Old checkpoints

They keep the #1403 behaviour, and the resume prints a notice listing, by category, every carried flag it can't restore. The list is built from sweepLaunchFlags.

Detached

The orchestrator relaunches from the params uploaded at launch (downloadParams(ctx, state.S3ParamsKey, …)), and those already carry every carried flag, so the detached path needs nothing new. --detach refuses the four new flags.

IAM

spawn resume / spawn sweep resume now also call fsx:DescribeFileSystems and elasticfilesystem:DescribeMountTargets, only for sweeps using --fsx-id/--efs-id. Both are read-only, and spawn launch already needs them. docs/reference/cli-iam-actions.md is regenerated.

Gates (each watched failing against a revert that compiles)

make check, make lint (0 issues), semgrep --config=auto --error . and check-docs are all clean. Not run against AWS.

…ded config (#1400)

A resume rebuilt each pending member from the param file plus the IAM
(#1385) and lifetime (#1394) records, dropping every other launch flag:
--pre-stop, --tag/--team, network, storage, purchase, webhooks, spored
settings and the bootstrap inputs.

New checkpoints record the whole member base config (SweepMemberRecord,
schema 1) with the bootstrap inputs and the IAM record; the lifetime
record is a view of it. A resume builds each member with the launch's own
builder (sweepMemberConfig), defaults folding, storage lookups, target-OS
resolution and user-data renderer. Token-bearing settings (webhook URLs,
webhook correlation, inline --user-data) are withheld and must be passed
again to resume; --config and --user-data-file are recorded by path and
SHA-256. Checkpoints are written 0600. Old checkpoints resume as before,
with a notice listing what cannot be restored.
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.61674% with 44 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/resume.go 47.05% 18 Missing ⚠️
cmd/sweep_member_record.go 88.35% 17 Missing ⚠️
cmd/launch_sweep.go 80.76% 5 Missing ⚠️
cmd/sweep_lifetime_record.go 82.35% 3 Missing ⚠️
cmd/sweep.go 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 452caec into main Oct 28, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1400-resume-full-config branch October 28, 2026 23:04
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.

sweep resume still drops every CLI flag other than IAM and lifetime (--pre-stop, --tag/--team, network, storage)

1 participant