Repository navigation
Launch config object (spawn:config) + spored 0.150.0, with the #1355 tag reserve - #112
Merged
Merged
Conversation
…50.0 (#110) DEPENDS ON spawn v0.150.0 (spore-host/spawn#1420, unmerged). The body sha and fixtures were rendered from PR #1420's head (2a47def) with SPAWN_SRC=... scripts/gen-go-fixtures.sh 0.150.0; re-run without SPAWN_SRC against the v0.150.0 tag before merging.
scttfrdmn
force-pushed
the
feat/110-launch-config-object
branch
from
October 29, 2026 18:41
c2f0cdc to
568d7ef
Compare
… sha 925521a3 Rendered with scripts/gen-go-fixtures.sh 0.150.0 from the module proxy (no SPAWN_SRC). The body moved since #1420's head 2a47def by spawn #1422 (heredoc comments moved out of the data). launchconfig-setting-keys and gojson vectors did not move. The generator now also writes post-launch-tags.go.json (spawn #1355's postLaunchInstanceTags). created-by comment updated for spawn #1423.
…Go spawn#1355) checkTagLimit counted only the RunInstances set. spored writes its heartbeat, spored-version, logged-in-count, cost footprint (one tag since #1428) and, with DNS, dns-status/dns-error after launch, and a write past 50 fails whole. Port Go's postLaunchInstanceTags/tagReserve (v0.150.0), pinned by a generated fixture; reserve spored's entries only (spawn-ts writes none of Go spawn's own post-launch tags). The sweep parameter budget leaves the reserve free and now counts the launch config object as one tag, as Go's buildTags does. The flag map is Go's (--metrics); --idle-cpu is in the object and adds no tag. Docs moved to the 0.150.0 pin.
scttfrdmn
marked this pull request as ready for review
October 30, 2026 03:43
Merged
scttfrdmn
added a commit
that referenced
this pull request
Oct 30, 2026
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 #110
Fixes #113
Refs #108
spawn v0.150.0 is released (ed74003). This PR is now rendered from the published module, not from spawn#1420's pre-release head.
What
On a real launch, spawn-ts now writes the launch config object that spored v0.150.0 reads, in place of the tags spored v0.150.0 ignores, and moves the pin to 0.150.0. The pin and the object only work together, so they change in one commit.
launchconfig.Settingsleave the tags:spot-webhook-url,webhook-correlation,webhook-timeout,notify-url,notify-platform,notify-command,active-processes,active-portsandidle-cpu.pre-stopstays a tag, because the reaper reads it.launchconfig.Encode's bytes exactly:{"schema":1,"settings":{...}}, keys sorted, no HTML escaping, no trailing newline, empty values dropped. The instance is taggedspawn:config=<sha256>. A launch with none of the settings has no object and no tag. Tests compare spawn-ts's bytes and sha with Go's for each fixture, and compare the settings list withlaunchconfig.SettingKeys().pkg/launchconfigis unchanged between #1420's head2a47defand tag v0.150.0./etc/spawn/launch-config.json(0600) before the body starts spored. This is Go's own seed block (perLaunchPreBody, rendered byte-identically). spored'slaunchconfig.Loadreads that cache first and uses it only if it hashes to the instance's ownspawn:config.Pinned body: the published v0.150.0
scripts/gen-go-fixtures.sh 0.150.0, run withoutSPAWN_SRCso the source comes from the module proxy, printsBOOTSTRAP_BODY_SHA256 = 925521a3c0b1707f749eb55cceaef059a526d56a9dbce198e8c389d7f976fc30. Checked independently:The body moved from the pre-release
b73c9811…6b1cbecause of spawn#1422, which moved heredoc comments out of the data. In the stub fixtures only theSPAWN_BS_SHA256=line changed (decodedByteschanges by 1–4 bytes because the gzip output differs).launchconfig-setting-keys.go.jsonandgojson-vectors.go.jsondid not move.Tag reserve (Go spawn#1355, #1428)
The 50-tag check counted only the RunInstances set. spored writes tags of its own once running:
spawn:last-heartbeat,spawn:spored-version,spawn:logged-in-countandspawn:cost-footprint, plusspawn:dns-statusandspawn:dns-errorwhen the launch has DNS. A tag write past 50 fails whole. So a spawn-ts launch that filled all 50 left spored unable to record its heartbeat or the cost footprint. Since #1428 the footprint is one tag in spored 0.150.0, which is the spored this PR pins.postLaunchInstanceTagsandtagReserve(pkg/aws/post_launch_tags.go, v0.150.0) intocore/tags.ts. The generator now writessrc/core/testdata/post-launch-tags.go.json, which holds the key, writer, command flag and anappliesprobe (always / dns / spot / other) for each Go entry. A test requires the spawn-ts table to match it in order. Go's "other" entries (task, web app/DCV, FSx) areneverhere, because spawn-ts launches none of those.spawn-written entries come from Go's own launch code (the Spot price, ephemeral FSx tags) and its commands. spawn-ts writes none of them after RunInstances.checkTagLimitcounts the reserve, and the refusal names it the way Go'sTagLimitError.Errordoes. A launch with DNS keeps 6 slots.launchTagLimit. It now counts the launch config object as one tag, as Go'sbuildTagsdoes, instead of counting its nine pre-split settings. The old count dropped up to 8 parameters more than it needed to.--metrics).--idle-cpuis in the object, adds no tag, and is no longer offered as droppable.spawn:created-by(#113)The comment in
core/tags.tsused to say no reader compares the value for equality. That is no longer true: since spawn#1423,tagsReadingSporedinspawn upgrade-sporedtrustsspawn:versiononly whencreated-by == "spawn", and for spawn-ts instances it falls back tospawn:spored-version. The comment now says the value is part of the contract and must stay stable. Existing tests already pin it tospawn-ts.Why the seed and not the staging bucket
PutObjectintospawn-staging-<account>-<region>needs a CORS configuration the bucket does not have.EnsureStagingBucketcreates it without one, and spawn-ts would have to change a Go-managed bucket's configuration to add it.storeLaunchConfigObjectfirst runsEnsureStagingBucket: create, BPA, SSE, ownership, tagging and lifecycle. That is about ten more IAM actions on the caller.s3:GetObjectonlaunch-config/config-*.json. Go grants it on the roles it creates, but spawn-ts launches with a caller-supplied profile.Visible change
list()/get()of a real instance no longer report those nine settings, because they are not tags. The instance returned bylaunch()still carries them.Gates (each FAIL against a revert that type-checks)
spawn:configcheckTagLimitignores the reserve--idle-cpunot droppableChecks
typecheck,test(802),build,build:lib,check:exports,check:imports: pass. semgrep: clean.