Repository navigation
Launch parity with Go spawn: arch, GPU AMI, hibernation, Spot stop, ClientToken (#129) - #135
Merged
Merged
Conversation
This was referenced Nov 11, 2026
…lientToken (#129) - Architecture from EC2 DescribeInstanceTypes (Go resolveArchitecture), falling back to a static table that agrees with Go's DetectArchitecture; trn/inf are x86_64, not arm64. - NVIDIA GPU families (Go's DetectGPUInstance set) get the DLAMI NVIDIA driver image via Go's SSM parameter; a failed lookup refuses the launch. - hibernateOnIdle / on-complete hibernate set HibernationOptions and an encrypted gp3 root on the AMI's root device sized RAM+10 GiB, refused up front on types EC2 says can't hibernate (Go preflight). - stop/hibernate refuse one-time Spot, non-running, and (hibernate) not hibernation-configured instances; the Dashboard hides those buttons. - RunInstances carries a ClientToken: LaunchInput.clientToken or a fresh one; one in-flight request per token; the Dashboard keeps one token per launch intent (spore-host#673). - Go parity vectors rendered from spawn v0.150.0 by gen-go-fixtures.sh. Fixes #129
scttfrdmn
force-pushed
the
fix/129-launch-parity
branch
from
November 11, 2026 05:03
2ea7b5e to
edca348
Compare
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 #129
Every choice below cites the Go source. They are pinned by Go parity vectors rendered from the published
spawn@v0.150.0:scripts/gen-go-fixtures.shnow also writessrc/aws/testdata/launch-parity.go.json. Regenerating the existing fixtures at 0.150.0 left them byte-identical.1. Architecture: trn/inf are x86_64
DescribeInstanceTypes, preferring arm64 when a type advertises both, as Go'sresolveArchitecturedoes (pkg/aws/ami.go).archForInstanceType(Go:DetectArchitecture).trn*/inf*arm64. It agrees with Go's static list on every family that list names (vector test). It also recognises Graviton families Go's list lacks (im4gn,is4gen,i4g,x8g,a1); Go gets those right only through EC2.2. GPU types get an NVIDIA-driver image
isNvidiaGpuInstanceis Go's exactDetectGPUInstancefamily set./aws/service/deeplearning/ami/{x86_64|arm64}/base-oss-nvidia-driver-gpu-amazon-linux-2023/latest/ami-id. That is the DLAMI "Base OSS Nvidia Driver GPU AMI (AL2023)", as in Go'sGetAL2023AMI.g5ggets the arm64 image.amiis used as given.p6-b200,p5en(and by the same exact-match rulep6e-gb200,gr6,g6f). Filed as DetectGPUInstance misses p6-b200, p6e-gb200, p5en, gr6 and g6f: auto-AMI gives them the CPU image (no NVIDIA driver) spawn#1579. spawn-ts matches Go on purpose and will follow when Go's set is fixed and the vectors are regenerated.3. Hibernation only where it can succeed
hibernateOnIdleoronComplete: "hibernate"is set (GoHibernationRequested).DescribeInstanceTypessaysHibernationSupported. It is also refused if that call fails, as Go's preflight does (cmd/launch_preflight.go:233).HibernationOptions: {Configured: true}plusBlockDeviceMappingswith an encrypted gp3 root:RootDeviceName, from DescribeImagesImageIds(GolaunchInfoFromAMI, #284);hibernationRootGiB);buildBlockDevices).ManagedInstance.hibernationConfiguredis read fromHibernationOptions.Configured.hibernateOnIdleis refused like the other stop-based Spot lifecycles. spawn-ts makes only one-time requests, where Go would make it persistent (NeedsStoppable).4. Stop/hibernate not offered or allowed where EC2 refuses
stopBlocker(inst, action)holds Go's rules (cmd/state.go):NotRunning;spotrequest.IsOneTime: tag ≠persistent) →OneTimeSpot, in Go'soneTimeSpotStopErrorwording;hibernationConfigured === false→NotHibernatable.client.stopandclient.hibernatethrow these asSpawnErrorbefore any call. The terminal'sstopandhibernaterefuse the same way, and the Dashboard doesn't render those buttons.5. ClientToken (spore-host#673)
RunInstances.ClientTokenisLaunchInput.clientTokenwhen given, else a freshspawn-ts-<uuid>(Go:"spawn-" + rand.Text(),zone_fallback.go:326). Invalid tokens are refused before any AWS call.SpawnClient.launchshares one in-flight request per token, so a double-click is one RunInstances call.newLaunchToken()mints a token.isAmbiguousLaunchError(err)says whether a retry should keep it: keep it after a network error or 5xx with no instance id; rotate it after a definite 4xx, or after an instance was created and then terminated.New IAM the portal role will need
These are also new SDK commands in the bundle, so the portal's closed
iam/command-actions.tsgate will flag them on the bump. That is the intended outcome.ec2:DescribeInstanceTypes, Resource*: every launch. A denial is tolerated for architecture but refuses hibernating launches.ssm:GetParameteronarn:aws:ssm:*::parameter/aws/service/deeplearning/ami/*: GPU launches only.Tests
src/aws/launch-parity.test.ts:HibernationRequested,NeedsStoppableandIsOneTime;g6andp5→ DLAMI x86 parameter,g5g→ arm64; a GPU SSM denial refuses with no RunInstances;HibernationOptionsread back;src/core/launch-intent.test.ts:NotHibernatable;NotRunningin Go's words; the terminalstoprefuses one-time Spot.dashboard.test.ts: a one-time Spot card has no stop/hibernate; a non-hibernatable card has no hibernate; a double submit gives one instance; the token is kept or rotated as above.Breaking for existing consumers
Noted in the CHANGELOG: hibernate isn't offered or allowed on non-hibernatable instances, and stop/hibernate refuse one-time Spot and non-running instances. EC2 rejected all of these anyway.
What's left on #129 (needs a live check, so not claimed here)
nvidia-smihas not been verified on a real GPU host.al2023-ami-kernel-defaultparameter. This is pre-existing and kept so CPU launches need no SSM grant.