Repository navigation
fix(sweep): resume rebuilds every member from the launch's full recorded config (#1400) - #1405
Merged
Merged
Conversation
…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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
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 (
memberin~/.spawn/sweeps/<id>.json, schema 1)base: the serialisedaws.LaunchConfigevery member was built from (sweepBaseConfig), with withheld fields blanked andUserData/SpawnVersioncleared.no_timeout,iam(fix(sweep): resume re-creates a deleted spawn-instance-* profile from the recorded IAM config (#1385) #1395'sSweepIAMRole), andbootstrap: the CLI-side user-data inputs (--plugin,--configpath+SHA-256,--user-data-file/--user-data @pathpath+SHA-256, EFS mount options/profile,--fsx-skip-validate,--fsx-mount-point,--os).withheld:[{flag, hint}]for each token-bearing setting the sweep had.SweepState.iamRecord()/lifetimeRecord()), so their semantics stay the same: deleted roles are re-created, and bounds can never be weaker. Checkpoints written by fix(sweep): resume re-creates a deleted spawn-instance-* profile from the recorded IAM config (#1385) #1395/fix(sweep): resume keeps the sweep's --ttl/--idle-timeout/--cost-limit and lifetime flags (#1394) #1403 (iam_role/lifetime) and older ones are still read.Resume = launch
Members are built with the launch's own
sweepMemberConfig(newly extracted fromforegroundSweepMembers), 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 samerenderForegroundSweepUserData.resumeUserDatais 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.--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.--configgets the same path-and-hash treatment, since plugin config can hold auth keys.--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.--detachrefuses the four new flags.IAM
spawn resume/spawn sweep resumenow also callfsx:DescribeFileSystemsandelasticfilesystem:DescribeMountTargets, only for sweeps using--fsx-id/--efs-id. Both are read-only, andspawn launchalready needs them.docs/reference/cli-iam-actions.mdis regenerated.Gates (each watched failing against a revert that compiles)
TestResumedMemberIsTheLaunchedMember: for every carried flag discovered fromsweepLaunchFlags, the resumed config and user data must equal the launched ones. Revert "resume base = lifetime only": 65 subtests fail. Revert "bootstrap not installed": the 7 user-data flags fail.TestResume_KeepsPreStopAndTag: fails under the first revert.TestCheckpointHoldsNoSecretInPlaintext: sentinels scanned across all of~/.spawn, plus a mode check and secret-looking flag-name discovery. Fails if blanking is reverted, and fails at 0644.TestMemberRecordRoundTripsEveryLaunchConfigField: every field is round-tripped by reflection.TestResume_RefusesWhatItCannotReproduce: fails if the missing-withheld refusal is reverted.TestResume_OldCheckpointResumesWithTheNoticeandTestOldCheckpointNoticeNamesEveryLostFlag: both fail with the notice suppressed and--pre-stopleft uncategorised.TestDetachedResumeRelaunchesFromParamsCarryingEveryFlag: 49 subtests fail when the detached params are built without the base.TestRunResumeBuildsMembersFromTheRecord: fails when the launch doesn't record.lifetime:newSweepLifetimebecamenewSweepMemberRecord, and thedefaultSweepMemberregex now matchessweepMemberConfig/defaultSweepMemberWith.make check,make lint(0 issues),semgrep --config=auto --error .andcheck-docsare all clean. Not run against AWS.