Repository navigation
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Oct 15, 2026
spawn burst launched its members with no IAM instance profile, five hand-written tags, no TTL and unencoded user-data. RunInstances rejected the user-data, so every burst failed. Had it not, the members would have had no credentials for spored, no spawn:managed tag (so the TTL reaper, spawn list and the spored role's terminate grant could not reach them), no deadline, and the same job-array index on every member. Burst now resolves the instance profile the way spawn launch does with no --iam-* flags (SetupSporedIAMRole, or --instance-profile to skip it). It launches each member through pkg/aws Client.Launch, so buildTags writes the same tags a spawn launch job-array member gets, with a per-member index and a TTL (--ttl, default 8h; must parse as a Go duration so the deadline is computed). spawn:burst=true is added as a burst-only custom tag, never by buildTags (#904). --job-array-name defaults to the ID so the printed spawn array status hint finds the members. Both spored policies now grant PutItem/UpdateItem/DeleteItem/Query on spawn-hybrid-registry in the caller's own account, which is what the in-instance registry client calls. Without that, no job-array member could register. Fixes #917.
…ent.Launch, and TestBurstMembersAreTaggedBurst covers the same assertion (#905)
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.
Problem
spawn burstbuilt its ownRunInstancesInput(cmd/burst.go). Compared with thespawn launchpath, it was missing:UserData, and RunInstances rejects that ("Invalid BASE64 encoding of user data", launcher.Provision passes un-base64'd user-data → RunInstances InvalidParameterValue; every headless launch fails #127). So everyspawn burstfailed at launch.spawn:managed=true(spawn burst instances carry no spawn:managed or TTL tag, so the reaper, spawn list and spawn array status never see them #917). The TTL reaper's scan,spawn listandspawn array statusonly see instances with this tag. The spored role'sTerminateInstances/CreateTagsgrants also require it. Credentials alone would not have let a member terminate itself.spawn:job-array-index(spawn burst instances carry no spawn:managed or TTL tag, so the reaper, spawn list and spawn array status never see them #917). One RunInstances call for N members gave them all the same tags, so every member registered at index 0.spawn array statusmatches on name, and the hint burst printed used the ID. Without--job-array-namethe name was empty, so the hint found nothing.The spored role also had no access to
spawn-hybrid-registry, so no job-array member could register (burst orspawn launch --array).Fix
spawn launchdoes with no--iam-*flags, throughSetupSporedIAMRole, which creates or reusesspored-instance-profile.--instance-profile <name>uses an existing profile with no IAM calls, likespawn launch --instance-profile(launch attaches an instance profile with no access to the workload's bucket, and the failure surfaces minutes later as a 403 on a paid instance #550). Burst does not get the--iam-role/--iam-policyfamily. The guard is where the member configs are built, so burst refuses to launch with no profile.pkg/awsClient.Launchonce per member, the same callspawn launchuses.buildTagswritesspawn:managed,spawn:launch-time,spawn:ttl,spawn:ttl-deadline,spawn:on-complete=terminateandspawn:job-array-{id,name,size,index}. Members also get the launch path's network interface, block-device and volume-tag handling.spawn:burst=trueis passed as a burst-only custom tag (LaunchConfig.Tags).buildTagsnever writes it, sospawn launchmembers still never carry it (Register only hybrid job-array members with the hybrid registry (#904) #920'sTestBuildTags_JobArrayMemberIsNotTaggedBurst).--ttl, default8h, plus--idle-timeout. The TTL must parse withtime.ParseDuration, becausebuildTagscomputes the deadline that way. Burst rejects a TTL that is empty, unparseable (1d) or not positive before it creates anything. Otherwise a member would getspawn:ttlwith no deadline.launcher.EncodeLinuxUserData.--job-array-namedefaults to the job-array ID. If a launch fails part-way, burst lists the members already running and thespawn array cancelcommand for them.Why the registry grant, and why this narrow
Every spored on an instance tagged
spawn:job-array-idcallsregistry.Register, and burst exists so cloud members can join a registry-coordinated array. Neither spored policy granted anything on the table. Both now carry one statement:dynamodb:PutItem,UpdateItem,DeleteItemandQuery. These are exactly the callspkg/registry.PeerRegistrymakes (Register, Heartbeat, Deregister, DiscoverPeers). No Scan, no batch calls, no table management.EnsureTableruns on the workstation with the user's own credentials.arn:aws:dynamodb:*:${aws:PrincipalAccount}:table/spawn-hybrid-registry. That is one table, in the instance's own account, with no index wildcard. The policy variable lets the staticsporedDCVRolePolicy, used bySetupSporedIAMRole, carry the same statement as the dynamic baseline.SetupSporedIAMRolere-puts the inline policy on every launch, and the baseline is re-ensured on custom roles, so existing roles get the grant on their next launch. This is not the infra account's control plane, so nothing underlambda/ordeployment/changes.The other half of the registry problem, that the client had no region on EC2, is #899 / PR #902. This PR does not touch
pkg/registry.Tests
Each test was watched failing against a revert that compiles:
IamInstanceProfile: ""TestBurstLaunchAttachesTheInstanceProfileif false && …TestBurstLaunchRefusesWithoutAnInstanceProfileTTL: ""TestBurstMembersHaveATTLvalidateBurstParamsreturns nil before the TTL checksTestBurstRejectsTTLsWithNoDeadlineJobArrayIndex: 0TestBurstMembersAreDistinctJobArrayMembersspawn:burst-xTestBurstMembersAreTaggedBurstTestBurstUserDataIsBase64TestBurstPartialFailureReturnsTheLaunchedIDsdefaultBurstTTL = ""TestBothSporedPolicyPathsGrantTheHybridRegistry/dynamic…TestBothSporedPolicyPathsGrantTheHybridRegistry/static…dynamodb:Scanadded to the grantTestHybridRegistryGrantIsNarrowbuildTagsjob-array index → 0TestBuildTags_BurstMemberIsReaperVisibleAndBoundedThe registry tests discover the action set from
pkg/registry/dynamodb.go(r.client.<Op>(calls) and read the table name from itsTableNameconstant, so the grant cannot drift from the client. If discovery finds nothing, the tests fail. A compile-time assertion pins*aws.Clientas burst's launcher.make checkpasses exceptTestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker, which needs Docker. All 9 nested modules pass. The public surface is unchanged: everything new inpkg/awsis unexported.docs-gen/burst.mdis regenerated. No AWS resources were created and no instances were launched.Conflicts with #920
#920 adds
cmd/burst_tags_test.go, which callslaunchBurstInstanceswith an*ec2.Clientagainst Substrate. After this PR,launchBurstInstancestakes aburstLauncher(*aws.Client) and needs an instance profile and TTL, so that test will not compile once both PRs are merged.TestBurstMembersAreTaggedBursthere covers the same assertion, so whichever PR merges second should drop or adapt that file. The CHANGELOG[Unreleased]entries may also need a trivial merge.Filed separately
spawn-*AMI auto-detect checks none of that. With this PR the reaper still bounds those instances through the TTL deadline.Fixes #905
Fixes #917