Repository navigation
Backlog
Labels
area: awsEC2 provider, credentials, userdatacost-safetyBilling / leak / cost-control concernsenhancementNew feature or request
Milestone
Description
Found while investigating spore-host/spawn#1672. Part of the leave-no-trace epic, spore-host/spore-host#752.
The gap
Go spawn marks itself ACTIVE in the account's shared lifecycle lease before every create. The lease is the DynamoDB table spore-host-lifecycle, one per region plus us-east-1 for global, written through pkg/lifecyclemark.Mark and libs lifecycle.MarkActive (spawn#1654). The mark matters in two ways:
- The idle teardown (the TTL reaper's account-idle sweep) only judges a scope that some creator has marked.
- A teardown that holds the lease blocks a mark, which fences the create.
spawn-ts has no lease code and no DynamoDB client. Its AWS dependencies are client-ec2, client-service-quotas, client-ssm and client-sts. So no launch through spawn-ts marks anything:
scripts/live-smoke.mjs, asGitHubActions-spawn-ts-live-smokein dev 435415984226;- the portal's real-AWS e2e setup launch (spore-host
web/portal/e2e-aws, asspore-portal-e2e-teardown); - the BYOA demo;
- the portal's launch actions when they return after 1.0 (spore-host#686).
That has two effects:
- Leave-no-trace never fires for an account where only spawn-ts launches. The regions stay "lease unavailable", which fails safe.
- The launch isn't fenced in a region another creator did mark. The teardown's activity re-check sees spawn-ts's
spawn:managedinstances, but nothing stops a teardown that already holds the lease. Once spawn arms reap (Flip spawn idle teardown (A4/A5) to reap spawn#1657), that teardown can delete spawn's shared security groups and key pairs while a spawn-ts launch is using them.
spawn#1672 proposed granting the lease to the roles spawn-ts runs as. That changes nothing until spawn-ts writes the lease.
To do
- Port
MarkActive's protocol, as libs/lifecycle defines it:- one
TransactWriteItems: aConditionCheckthat the closing sentineltable#closingis absent, plus anUpdateofspawn#<scope>that sets ACTIVE and epoch+1, on condition that no live lease exists; - create the table, tagged, on the first mark;
- wait while a teardown holds the lease;
- never fail the launch.
- one
- Treat the protocol as a wire contract with libs/lifecycle (the item shape changed in libs v0.56.0), held by a contract test against libs's fixtures.
- Whichever role then runs the launch needs
dynamodb:ConditionCheckItem,UpdateItem,PutItem,DeleteItem,DescribeTable,CreateTableandTagResourceonarn:aws:dynamodb:*:<account>:table/spore-host-lifecycle:- the live-smoke launch role;
- the e2e setup role;
- for #686,
spore-portal-launch, which is read-only today by design (spore-host#645).
- Never mark in spore.host's infra account 966362334030, which has no lease.
Metadata
Metadata
Assignees
Labels
area: awsEC2 provider, credentials, userdatacost-safetyBilling / leak / cost-control concernsenhancementNew feature or request
Activity