Repository navigation
feat: ext.volumes attaches EBS data volumes from snapshots (#45) - #46
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.volumesprocess 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 asnap-xxx:/mount:ro|rwstring.readOnlydefaults to true (the common case for shared reference data); a single map (one volume) is accepted as well as a list; missingsnapshot/mountaborts with a clear message.buildLaunchCommandgained an optionalattachVolumesarg (default[], so existing call sites are unchanged) that emits one--attach-volume <spec>per volume.submit()resolvesext.volumesand threads it through.Tests
41 total, 0 failures. Added:
buildLaunchCommandemits repeated--attach-volume(and none by default);parseVolumeSpecsmap→spec mapping (ro default, explicit rw, single map, order, null/empty); reject on missing snapshot/mount.Docs: README gains an
ext.volumesexample + a per-processextoptions table.Validation
Unit-level here. The end-to-end paid validation (taxprofiler Kraken2 with a real
k2_pluspfsnapshot, 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.