Skip to content

Real-AWS bootstrap fix + launch validation (#2, #17) - #18

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/bootstrap-and-live-launch
Jul 21, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/bootstrap-and-live-launch

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Resolves the long-gated #2 (real-AWS launch validation) and fixes #17 (broken bootstrap) found in the process.

What the pre-launch audit found (before spending anything)

The EC2 path was only ever tested against substrate, which doesn't execute user-data — hiding four gaps that meant a real launch would strand a billing instance, never self-terminating:

  1. spored download URL 404'd (fictional GitHub-release path) and was hardcoded amd64.
  2. No IAM instance profile → spored couldn't DescribeTags/TerminateInstances.
  3. No AMI resolution.
  4. (arch) t4g.nano is arm64.

Fixes

  • userdata.ts — install spored the way the Go tool does: arch detect, region from IMDS, download spored-linux-<arch> from spawn-binaries-<region> S3 (us-east-1 fallback, prefixed+legacy paths), SHA256 verify, atomic install. Verified the S3 binary is anonymously downloadable.
  • ec2.ts — new iamInstanceProfile option threaded into RunInstances; resolveAmi via DescribeImages (latest AL2023 per arch) when spec.ami is empty; archForInstanceType.

Real launch (approved envelope)

Launched i-0ad2d762fe1d21f8e — t4g.nano, us-east-1, spored-instance-profile, 10-min TTL — reached running with a resolved arm64 AL2023 AMI (ami-00b18f89b5bdfb338), then explicitly terminated + leak-checked: instance terminated, no orphaned volumes. Spend ≈ $0.0001.

Honest caveat: I validated launch → running → the prerequisites for self-termination (correct binary/arch/IAM/AMI), and terminated at ~90s rather than idling a paid instance for the full 10 min to watch spored fire the TTL. Full unattended-TTL observation is noted as a follow-up on #2.

194 tests, typecheck + build green.

Pre-launch audit against real AWS found the launch path could never self-
terminate an instance — it would strand billing. Fixed all four gaps, then
validated a real launch (t4g.nano, us-east-1, 10-min TTL, explicit terminate +
leak-check; ~$0.0001).

- userdata.ts: spored install now mirrors the Go bootstrap — arch detection
  (amd64/arm64), region from IMDS, download from the regional S3 bucket
  (spawn-binaries-<region>, us-east-1 fallback, prefixed+legacy paths), SHA256
  verify, atomic install. The old GitHub-release URL 404'd and was amd64-only.
- ec2.ts: attach IamInstanceProfile (new option) so spored can DescribeTags +
  TerminateInstances; resolve latest AL2023 AMI via DescribeImages per arch when
  spec.ami is absent; export archForInstanceType.
- Tests updated: bootstrap S3/arch/checksum assertions, IAM-profile + AMI-resolve
  + arch-inference cases. 194 tests.
@scttfrdmn
scttfrdmn merged commit f4ce2a6 into main Jul 21, 2026
1 check passed
@scttfrdmn
scttfrdmn deleted the fix/bootstrap-and-live-launch branch July 21, 2026 18:21
scttfrdmn added a commit that referenced this pull request Jul 21, 2026
Promote [Unreleased] to a dated 0.3.0. Since 0.2.0: the truffle instance picker
(+ bumps to truffle-ts 0.3.0's real-AWS catalog), real-AWS launch validation
(#2), and the bootstrap + spored systemd-unit fixes (#17/#18/#19) that make
self-termination hold on real AWS. Pre-1.0 minor bump.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant