Skip to content

feat(aws): add Region and LaunchTime to LaunchResult (#351) - #352

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/launchresult-region-launchtime
Jul 15, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/launchresult-region-launchtime

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Addresses the LaunchResult portion of #351 (filed from calque, consuming spawn as a library).

What

aws.LaunchResult gains two fields:

  • Region string — the region the instance launched into (from the resolved LaunchConfig.Region; RunInstances doesn't echo it back).
  • LaunchTime time.Time — server-authoritative launch timestamp from instance.LaunchTime; zero if the API omits it.

Why

LaunchResult was InstanceID/Name/PublicIP/PrivateIP/AvailabilityZone/State/KeyName — no region, no timestamp. A library consumer measuring launch→terminate cost windows (calque's "rectangle-seconds") had to timestamp with its own wall-clock and carry the region separately. Both are cheap to surface authoritatively.

Changes

  • pkg/aws/client.go: struct + newLaunchResult (reads instance.LaunchTime, takes region threaded from the call site).
  • cmd/launch_jobarray.go: the cohort re-derive path populates both from InstanceInfo.
  • Tests: launchresult_test.go asserts the zero-LaunchTime/region case and the populated case.

Purely additive — no existing field changed. make check green.

Not in this PR

The other #351 ask — a headless pkg-level container-run primitive (DCV-free docker run of an ECR image ref) — is larger and tracked as a separate issue (linked on #351). This PR is just the LaunchResult fields.

LaunchResult exposed InstanceID/Name/PublicIP/PrivateIP/AZ/State/KeyName but
neither the region the instance landed in nor a launch timestamp. A library
consumer measuring launch->terminate cost windows (calque) had to timestamp with
its own wall-clock and thread the region separately.

Add Region (from the resolved LaunchConfig.Region — RunInstances doesn't echo it
back) and LaunchTime (server-authoritative, from instance.LaunchTime; zero if the
API omits it). Both populated in newLaunchResult and in the cohort job-array
re-derive path. Purely additive.

Closes #351 (LaunchResult portion; container primitive tracked separately).
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch_jobarray.go 0.00% 2 Missing ⚠️
pkg/aws/client.go 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 5c9cf2e into main Jul 15, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/launchresult-region-launchtime branch July 15, 2026 09:07
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