Repository navigation
feat(array): add 'spawn array retry --failed' + local launch record (Closes #389) - #402
Merged
Merged
Conversation
…loses #389) A job array has no server-side record — members are discovered by tags. But a surviving member's tags don't carry the full launch config (spawn:command only rides ≤256 chars; AMI/subnet/SG/user-data are never tagged), so a faithful relaunch needs the original config from somewhere. Add pkg/arrayrec: a lightweight local launch record written at launch time to ~/.config/spore/arrays/<array-id>.json (+ a name pointer to the latest id). SDK-free and local-only — no infra dependency, matching the array group's ethos. Tradeoff: retry works only from the machine that launched the array. 'spawn array retry <name> --failed' loads the record, computes the indexes with no running/pending member (missing --min-viable gaps + terminated/stopped), and relaunches only those under the ORIGINAL job-array id so they regroup. Prompts before launching billable instances (--yes to skip); relaunched members inherit the original TTL. Refactor launchCohort into reconcileArrayMembers over an explicit index set, and thread the job-array knobs through a memberParams struct instead of package globals, so retry rebuilds members from the record without mutating launch state. Closes #389
scttfrdmn
force-pushed
the
feat/389-array-retry
branch
from
July 19, 2026 18:52
f700644 to
04dc17a
Compare
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.
Summary
Second of two stacked PRs finishing the
spawn arraycommand group (#389). Stacked on #401 (array logs) — review/merge that first; this PR's diff is against that branch.Adds
spawn array retry <name> --failed, plus the local launch-record persistence it needs.Why a launch record
A job array has no server-side record — members are discovered by grouping EC2 on the
spawn:job-array-*tags. But a surviving member's tags don't carry the full launch config:spawn:commandonly rides when ≤256 chars, and AMI/subnet/security-group/user-data are never tagged. A faithful relaunch needs the original config.Decision: persist a lightweight local record at launch (
~/.config/spore/arrays/<array-id>.json+ a name→latest-id pointer). SDK-free, local-only — no infra-account dependency, matching the array group's "no server-side record" ethos. Documented tradeoff:retryworks only from the machine that launched the array.retry --failed--min-viablegaps plus terminated/stopped members.spawn array statussees them).--yesto skip); relaunched members inherit the original TTL from the record.Refactor
launchCohortsplit into a thin wrapper (buildsmemberParams, writes the record) +reconcileArrayMembersover an explicit index set — the launch path passes0..count-1, retry passes the failed subset.memberParamsstruct instead of package globals, so retry rebuilds members from the record without mutating launch state.Testing
pkg/arrayrec: save/load round-trip, name-pointer-latest, missing-record error, 0600 perms, path-traversal safety (t.TempDir(), no AWS).cmd:TestRetryIndexes(missing/terminated/stopped/duplicate-index cases), updatedTestBuildCohort/TestBuildJobArrayMemberConfigfor the new signatures.TestFlagConventions/TestTier0_CommandCoverageGatepass;docs-gen/array.mdregenerated (drift gate clean).retryrun requires an explicit TTL + approval and is out of scope here (retry reuses the record's original TTL by design).Closes #389