Skip to content

feat: launch into a Capacity Reservation / Capacity Block (#216) - #218

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/216-launch-into-reservation
Jun 17, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/216-launch-into-reservation

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #216. Step 2 of the Capacity Blocks for ML flow (find → purchase → launch).

Change

Wires the previously-dead reservation flags all the way through to RunInstances:

  • --reservation-id <id> → LaunchConfig.ReservationID → RunInstances CapacityReservationSpecification.CapacityReservationTarget.CapacityReservationId.
  • --capacity-block → LaunchConfig.CapacityBlock → InstanceMarketOptions{MarketType: capacity-block} (the Capacity Block consume).
  • truffle hand-off fixed: truffleInput.ReservationID (JSON reservation_id) is now copied into config — it was parsed but silently dropped (same class as lagotto#19).

Before this, all of the above were defined but never read; launching into a reservation was impossible.

Guards

Tests

TestBuildLaunchConfig_Reservation (flag→config, capacity-block flag, both guards, clean-when-unset) and TestBuildLaunchConfig_TruffleReservationCopy (the dropped-field regression). go vet + cmd/pkg/aws suites green; gofmt clean.

The RunInstances field-setting itself isn't substrate-unit-testable (it's inline in Launch), and live validation needs a real reservation. The config-level wiring + guards are fully covered; the SDK types (CapacityReservationSpecification, MarketTypeCapacityBlock) are confirmed present in the pinned ec2 v1.301.0.

Also

Pins [email protected] in .github/workflows/security.yml — v1.4.0 (what @latest now resolves to) panics analyzing generics (ForEachElement called on type containing *types.TypeParam), crashing the scan rather than reporting a vuln. (Same fix landed in truffle#68.)

Refs truffle#67 (discovery), spawn#217 (purchase), #208 (AZ co-location), lagotto#49 (schedule a launch at a Capacity Block's start time).

Wires the previously-dead reservation flags through to RunInstances:
- --reservation-id <id> → LaunchConfig.ReservationID → RunInstances
  CapacityReservationSpecification.CapacityReservationTarget.
- --capacity-block → LaunchConfig.CapacityBlock → InstanceMarketOptions
  MarketType=capacity-block (Capacity Block consume).
- truffleInput.ReservationID is now copied into config (was parsed but dropped
  — same silently-dropped-field class as lagotto#19).
- Guards: --capacity-block requires --reservation-id; --capacity-block and
  --spot are mutually exclusive (different market options).
- Reservation is AZ-pinned; caller matches --az.

Also pin [email protected] in the security workflow — v1.4.0 panics on
generics (ForEachElement / *types.TypeParam), crashing the scan.

Tests: buildLaunchConfig reservation wiring + guards + truffle-copy regression.

Closes #216
@scttfrdmn
scttfrdmn merged commit 9a02a7f into main Jun 17, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the feat/216-launch-into-reservation branch June 17, 2026 20:11
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.71429% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/client.go 0.00% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

Launch into a Capacity Reservation / Capacity Block: wire the dead --reservation flags through to RunInstances

1 participant