Skip to content

feat: ext.volumes attaches EBS data volumes from snapshots (#45) - #46

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/45-ext-volumes
Jun 13, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/45-ext-volumes

Conversation

@scttfrdmn

Copy link
Copy Markdown
Collaborator

Closes #45. The consumer side of the two-layer feature; depends on spawn#144 (--attach-volume, shipped in spawn v0.46.0).

What

New ext.volumes process directive — a list of maps that attach pre-populated EBS data volumes from snapshots to the task instance, each mounted at a path (read-only by default):

process {
    withName: 'KRAKEN2_KRAKEN2' {
        ext.instanceType = 'r7g.2xlarge'
        ext.volumes = [[ snapshot: 'snap-0abc', mount: '/opt/databases/kraken2', readOnly: true ]]
        // ext.ami omitted → stock AL2023
    }
}

So a large reference DB lives in a re-snapshottable EBS volume on a stock AMI instead of being baked into a custom AMI — root volumes stay small, and a DB update is a re-snapshot, not an AMI rebuild.

How

  • parseVolumeSpecs(ext.volumes) turns each [snapshot:, mount:, readOnly:] map into a snap-xxx:/mount:ro|rw string. readOnly defaults to true (the common case for shared reference data); a single map (one volume) is accepted as well as a list; missing snapshot/mount aborts with a clear message.
  • buildLaunchCommand gained an optional attachVolumes arg (default [], so existing call sites are unchanged) that emits one --attach-volume <spec> per volume.
  • submit() resolves ext.volumes and threads it through.

Tests

41 total, 0 failures. Added: buildLaunchCommand emits repeated --attach-volume (and none by default); parseVolumeSpecs map→spec mapping (ro default, explicit rw, single map, order, null/empty); reject on missing snapshot/mount.

Docs: README gains an ext.volumes example + a per-process ext options table.

Validation

Unit-level here. The end-to-end paid validation (taxprofiler Kraken2 with a real k2_pluspf snapshot, on a stock arm64 AMI, leak-checked) pairs with spawn#144's live test — will run that with the filer once both are released. Requires spawn ≥ 0.46.0.

Adds the `ext.volumes` process directive: a list of
[snapshot:, mount:, readOnly:] maps that attach pre-populated EBS data volumes
to the task instance, each mounted at a path (read-only by default). Each entry
maps to a `spawn launch --attach-volume snap-xxx:/mount[:ro|:rw]` arg.

This lets large reference data (e.g. a Kraken2 DB) live in a re-snapshottable
EBS volume on a stock AMI instead of being baked into a custom AMI.

parseVolumeSpecs validates each entry (needs snapshot + mount), defaults
readOnly to true, and accepts a single map for the one-volume case.
buildLaunchCommand gained an optional attachVolumes arg (default [] keeps the
existing call sites working) that emits one --attach-volume per spec.

Requires spawn >= 0.46.0 (spawn#144).
@scttfrdmn
scttfrdmn merged commit 18ec0b9 into main Jun 13, 2026
1 check passed
@scttfrdmn
scttfrdmn deleted the feat/45-ext-volumes branch June 13, 2026 22:46
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.

Feature: attach a pre-populated EBS data volume per process (e.g. ext.volumes / snapshot mount) so large reference data isn't baked into the AMI

1 participant