magicciv/infra/packer
Natalie 273a7c71f8
Some checks are pending
ci / regression gate (push) Waiting to run
feat(infra): auto-cull orphaned packer build droplets to prevent zombies
Packer destroys its build droplet on a clean finish, but a killed/slept/
network-dropped run leaves the s-8vcpu-16gb-amd builder alive (~$192/mo).
This happened once already (.project/handoffs/20260629_packer-cross-account-leak.md).

Two defense layers:
- scripts/cull-orphan-builders.sh reaps leftover builders by name prefix
  (mc-packer-* / legacy packer-*) with a size guard and an optional age guard;
  pins the MC token via --access-token.
- cloud-bringup.sh calls it in its EXIT trap, so a failed/Ctrl-C'd build reaps
  its own builder.
- infra/launchd/com.uvlava.mc.cull-builders.plist sweeps every 30m with
  --min-age-min 90 to catch SIGKILL/power-loss cases no trap can.

golden-image.pkr.hcl names the builder mc-packer-<ts> for deterministic matching.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 00:05:59 -04:00
..
golden-image.pkr.hcl feat(infra): auto-cull orphaned packer build droplets to prevent zombies 2026-06-30 00:05:59 -04:00
provision.sh feat(dist): build-artifact Space — publish/fetch/sync fetch-or-build + RL model sharing 2026-06-28 06:02:33 -04:00