Repository navigation
fix(launch): refuse a launch over AWS's 50-tag limit before any AWS call (#1336) - #1358
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…all (#1336) buildTags returns a *TagLimitError naming the count, the limit, the --tag count and each spored setting that added a tag, counting the tags spawn writes after RunInstances (Spot price, ephemeral FSx). Pre-flights in runLaunch, launchParameterSweep and launcher.Provision refuse before the first AWS call. Snapshot tags copied onto volumes are limited to what fits; the sweep orchestrator refuses a member over 50 tags.
scttfrdmn
force-pushed
the
fix/1336-tag-limit
branch
from
October 27, 2026 04:05
5a5a9a2 to
89b82de
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 #1336
buildTagsnow refuses a tag set over AWS's 50-tag limit with a*aws.TagLimitErrorinstead of handing it to RunInstances, and every launcher path that creates something beforeClient.Launchruns a pre-flight first, so the refusal comes before any AWS call.What the error says
When
--tagvalues are present it names how many (the 80 custom --tag value(s)).The count includes tags spawn adds after RunInstances
spawn:spot-price-per-houron the instance (recordLaunchSpotPrice), and on a persistent requestspawn:original-instance-idon the request, which carries the same tag set (tagOriginalInstance; the reaper uses it to tell a replacement apart). One slot covers both.spawn:fsx-pending, mount point, import and export paths (UpdateInstanceTagsinlaunchWithProgressandlauncher.Provision). A failed write there deletes the FSx and terminates the instance.That is why the issue's 54 shows up as 55. The documented monitoring setup on a maximal launch is 49 + 1 = 50 and still fits. The
spawn:param:*budget uses the same limit, so a Spot sweep member keeps one fewer parameter tag when they are dropped to fit. Parameters are still dropped, never refused.Pre-flights, by path
spawn launch(single,--count, wizard, pipe,--dry-run,--estimate-only)preflightLaunchTagsinrunLaunch, before the Strata upload. Stand-ins for target OS + local user, the Strata URI, a durable/--fsx-id/--fsx-recallFSx's ID and mount name, and a job array's tagsapplyCLIIAMToSweep(IAM), key pair,SetupSporedIAMRole, or (detached) inseedDetachedBootstrap, after the IAM steppreflightSweepTagsright after the sweep ID is minted, before--estimate-only, IAM, keys and the uploadlauncher.Provision(task run, service, SDK callers)SetupSporedIAMRoleValidateTagCountafter the user-data check, before the AMI lookupmemberTagsrefuses a member with more than 50 tags (backstop; the CLI refuses first)Client.Launch(every caller: burst, app, image, pool, batch queue, taskcohort, mpicohort)buildTagsrefuses before RunInstancesNot changed, and why:
spawn schedule create(rows have no tag inputs; unknown row keys become droppablespawn:param:*; base config is empty),spawn task run(TaskSpec has no tag field; fixed ~20 tags; still covered by Provision), batch queue, burst, app, image, pool, service (fixed small tag sets, no--tagor spored settings reach them), pipeline orchestrator (fixed ~16 tags). Spot replacements (pkg/spotrequest/replacement.go) and the TTL reaper'sspotrequests.gowrite no tags. The reaper's EIP/net-resource discovery stamp adds one tag to resources that carry about 8. Launch's ENI specs carry no tags.Volumes
RunInstances puts the same tag set on every volume, so the instance check covers the volume TagSpecification.
propagateSnapshotTagsToVolumesthen addedspawn:from-snapshotplus the snapshot's custom tags with CreateTags, which fails the whole call past 50. It now adds only what fits beside the launch's tags (fitVolumeTags: provenance first, keys already present take no slot) and names the rest in a warning.Gates (each watched failing against a revert that compiles)
TestMaximalSporedSettingsLaunchIsRefused(pkg/aws). With thecheckTagLimitcall replaced byerror(nil):built 54 tags with err=<nil>; want a *TagLimitError.TestFunctionalTagsAreNeverDroppedexpects refusal: with 80--tags it now wants a*TagLimitErrornaming the 80; with the same revert:built 126 tags with err=<nil>. Its sweep-parameter half still asserts every functional tag survives.TestMonitoringSettingsFitOnAMaximalLaunchnow also runsValidateTagCount. Revert<=to<incheckTagLimit: refused at 50. Revert the Spot reserve to two slots: refused at 51.TestLaunchOverTheTagLimitMakesNoAWSCall(cmd):runLaunchagainst an httptest AWS endpoint that records every request; only the auditGetCallerIdentityis allowed. With the pre-flight call disabled it went on to SSMGetParameter(AMI detection) and failed there.TestSweepOverTheTagLimitMakesNoAWSCall(cmd):launchParameterSweep, zero requests. With the pre-flight disabled it went on to load the compute AWS config for the detached path.TestProvisionRefusesTooManyTagsBeforeAnyAWSCall(pkg/launcher): counting transport, zero requests. With the call disabled: SSMGetParameter.TestValidateTagCountCountsWhatLaunchResolves(pre-flight counts the price/account-name Launch resolves later),TestTagLimitLeavesRoomForAnEphemeralFSx,TestPreflightLaunchTagsCountsWhatTheLaunchAddsLater(strata,--count, durable FSx counted exactly; each placeholder reverted fails it),TestFitVolumeTagsStaysWithinTheLimit,TestMemberOverTheTagLimitIsRefused(Lambda). All watched failing against compiling reverts.Follow-ups filed
spawn:compute-seconds,spawn:last-heartbeat, ...) have no room on an instance launched at exactly 50.compute-secondsfailing means a stop/start resets the cost clock. Needs an owner decision on how many slots to reserve.--tagand--teamare silently dropped on sweep and batch-queue launches (they are merged only after those dispatches).No AWS calls were made. No new IAM permission is needed.