Repository navigation
Reserve a tag slot for every tag spored writes after launch (#1355) - #1427
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…1355) One list, pkg/aws postLaunchInstanceTags, of every tag written on an instance after RunInstances (spored, spawn's launch code, and the commands that edit a running instance). The launch's reserve is the entries written without a command that apply to the launch, less the keys it writes itself; buildTags and ValidateTagCount refuse a launch that leaves fewer slots, naming how many spored needs. Replaces #1336's postLaunchTags. A discovery gate (tag_reserve_test.go) finds every tag-writing call and fails on a key that is not on the list.
…revert fails on the refusal (#1355)
scttfrdmn
force-pushed
the
feat/1355-spored-tag-reserve
branch
from
October 29, 2026 19:46
7a33d44 to
79a3aeb
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 #1355
Sets the tag reserve that #1359 item 4 asked for. It is computed from one list of every tag written on an instance after RunInstances, and the #1336 check enforces it.
What changed
pkg/aws/post_launch_tags.go,postLaunchInstanceTags: one list of every tag key written on an instance after launch. It covers spored (heartbeat, compute-seconds, version, session count, the 3 footprint tags, flush/DNS/ready/FSx status), spawn's launch code (Spot price, the ephemeral FSx's mount tags) and the commands that edit a running instance (spawn extend, stop/start,spored config set,spawn dns register,upgrade-spored,spawn plugin install). Each entry names its writer and when it applies (Spot, DNS, a web app or DCV, a task, a pending FSx). Exported asaws.PostLaunchTagKeys().postLaunchTags.buildTagsandValidateTagCount(and so every pre-flight) refuse a launch whose launch-time count plus the reserve is over 50.TagLimitErrorgainsSpored, and the message saysN slot(s) spored needs for the tags it writes once running (...).spawn:reaper-first-seenstamp goes on security groups, placement groups and EIPs.costmodel.FootprintTagswas added so pkg/aws can name the footprint keys without breakingTestNoCostRateTagReadOutsideTheModel.Numbers
TestMaximalLaunchTagCountpins both.--metrics --metrics-bind --idle-cpu-threshold) on the buildTags can exceed AWS's 50-tag limit and fail RunInstances outright — a fully configured launch is 51 tags with zero sweep params #477 maximal shape, with the version/OS/price-source a real launch adds: as a sweep member it is 38 + 10 = 48, which fits. As a sweep member and a job-array member it is 43 + 10 = 53, refused. The old test passed only because it left out spawn:version/os/price-source.--tagvalues than before.Gates (each watched failing against a compiling revert)
TestEveryPostLaunchTagIsListed(root). EveryCreateTags/UpdateInstanceTags/putTagscall is found. Its function must be classified. Every key written or spelled in spored's code and in each instance writer must be on the list, and no list key can be stale. Reuses Launch-fixed spored settings move to a per-launch config object; freeze the latest spored (#1359, #1419) #1420's tag-contract scanner, which now also records keys it can't place as reads or writes (mentionsIn).spawn:heartbeat-seqtowriteHeartbeatTag. Result: FAIL, "spawn:heartbeat-seq is written on an instance after launch ... but is not on postLaunchInstanceTags".UpdateInstanceTagscaller in cmd. Result: FAIL, "is not classified".TestALaunchLeavesSporedItsSlots(pkg/aws) andTestLaunchLeavingSporedNoRoomMakesNoAWSCall(cmd, throughrunLaunchagainst a recording fake). Revert to buildTags does not refuse a launch over AWS's 50-tag limit; maximal launch + all #1308 spored settings = 54 tags #1336 semantics (the reserve skips spored's entries). Result: pkg/aws fails "ValidateTagCount() = ". The cmd test fails because the launch goes on to SSM GetParameter.TestMaximalLaunchTagCount,TestMonitoringSettingsFitOnAMaximalLaunch. Revert: reserve command-only tags too. Result: both FAIL (17 reserved, 54 tags). Dropping the "minus keys the launch writes" rule also failsTestTheReserveSkipsKeysTheLaunchWrites.Checks
make checkandmake lint(0 issues, 10 modules) from /private/tmp,semgrep scan --config=auto --error .clean, andmake api-snapshotregenerated (additions only:PostLaunchTagKeys,TagLimitError.Spored). No AWS calls.