Skip to content

feat: forward ext.az to spawn launch --az (pin task placement to an AZ) (#62) - #63

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/62-ext-az
Jun 15, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/62-ext-az

Conversation

@scttfrdmn

Copy link
Copy Markdown
Collaborator

Implements #62.

Why

Fast Snapshot Restore is per-AZ. A volume created from an FSR-warmed snapshot is only fast-restored in the AZ where FSR is enabled; in any other AZ it lazy-loads first-touch blocks from S3 at ~6–8 MB/s (≈40 min to load a 16 GB Kraken2 DB, worse for a 40 GB MetaPhlAn index). SpawnTaskHandler read no AZ directive and spawn launch left placement to EC2, so a task landed in whatever AZ EC2 picked — observed bouncing between us-east-1a and 1c across runs, wasting FSR.

Change

  • Read ext.az in submit() (default empty).
  • Thread it into buildLaunchCommand, which appends --az <zone> only when set — back-compat: unset preserves spawn's own placement, exactly like the existing --ami / --volume-size handling. spawn launch already has --az (cmd/launch.go:216).
process {
  withName: 'KRAKEN2_KRAKEN2' {
    ext.az = 'us-east-1a'   // AZ where the DB snapshot's FSR is enabled
    ext.volumes = [[ snapshot: 'snap-...', mount: '/opt/databases/kraken2', readOnly: true ]]
  }
}

Tests / docs

  • New spec: passes --az only when ext.az is set, to pin FSR placement (#62) — asserts --az <zone> when set and absent otherwise. 55 specs green (./gradlew test).
  • README directive table gains an ext.az row; CHANGELOG Added under Unreleased.

build.gradle version left at 0.6.0 (bumped at release per the tag-matches-version workflow); this rides the next release like the other Unreleased entries.

Fixes #62.

Fast Snapshot Restore is per-AZ: a volume created from an FSR-warmed snapshot is
only fast-restored in the AZ where FSR is enabled — elsewhere it lazy-loads
blocks from S3 (~6-8 MB/s), e.g. ~40 min to load a 16 GB Kraken2 DB before the
tool classifies a read. SpawnTaskHandler read no AZ directive and spawn left
placement to EC2, so there was no in-band way to land a task in the FSR AZ.

Read ext.az in submit() and thread it into buildLaunchCommand, which appends
--az <zone> only when set (back-compat: unset preserves spawn's own placement,
matching the --ami/--volume-size pattern). spawn already has the --az flag.

Test: passes --az only when set; no --az otherwise. 55 specs green. README
directive table + CHANGELOG updated.

Fixes #62
@scttfrdmn
scttfrdmn merged commit 39d3801 into main Jun 15, 2026
4 checks passed
@scttfrdmn
scttfrdmn deleted the feat/62-ext-az branch June 15, 2026 23:35
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.

Forward ext.az to spawn launch --az (pin task placement to an AZ)

1 participant