You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Forward ext.az to spawn launch --az (pin task placement to an AZ) #62
A Nextflow task that needs a volume from an FSR-warmed snapshot has no way to land in the AZ where Fast Snapshot Restore is enabled. FSR is per-AZ; a volume created from the snapshot in a different AZ is NOT fast-restored and lazy-loads every first-touch block from S3 at ~6-8 MB/s. For a 16 GB Kraken2 DB that's ~40 min of pure DB-load before the tool classifies a single read; a 40 GB MetaPhlAn index is worse.
SpawnTaskHandler reads ext.instanceType/region/ttl/spot/ami/volumeSize/volumes but notext.az. And spawn launch leaves SubnetId unset when none is passed (EC2 picks placement), with no subnet/az default in ~/.spawn/config.yaml. So there is no in-band way to pin a task to the FSR AZ.
Observed: across two real runs, tasks landed in us-east-1a once and us-east-1c the next — pure EC2 placement luck. FSR enabled in 1a was wasted on the 1c run.
Proposal
Forward a new ext.az directive to spawn launch --az <zone> (spawn already has the flag). Pass it only when set, so the default preserves spawn's own placement.
process {
withName: 'KRAKEN2_KRAKEN2' {
ext.az ='us-east-1a'// pin to the AZ where the DB snapshot's FSR is enabled
ext.volumes = [[ snapshot: 'snap-...', mount: '/opt/databases/kraken2', readOnly: true ]]
}
}
Implementation
Done locally in 0.6.1: read ext.az in submit(), add an optional az param to buildLaunchCommand that appends --az <zone> when non-empty. Test added (passes --az only when set; back-compat default otherwise). 55 specs green. Happy to open a PR.
To be clear: this is a feature request, not a fork to merge — I'm not modifying nf-spawn. The implementation sketch above is just to show it's a small change; please implement it however fits the codebase. The consuming project (aws-microbiome-demo) stays on released nf-spawn 0.6.0 and has a no-op seam ready to enable ext.az once a release ships.
ext.az is implemented as you sketched: read in submit(), appended to spawn launch as --az <zone> only when set (unset preserves spawn's own placement). aws-microbiome-demo can now bump to 0.7.0 and flip the ext.az seam — set it to the AZ where the snapshot's FSR is enabled:
Activity
scttfrdmn commentedon Jun 15, 2026
To be clear: this is a feature request, not a fork to merge — I'm not modifying nf-spawn. The implementation sketch above is just to show it's a small change; please implement it however fits the codebase. The consuming project (aws-microbiome-demo) stays on released nf-spawn 0.6.0 and has a no-op seam ready to enable
ext.azonce a release ships.feat: forward ext.az to spawn launch --az to pin task placement (#62) (…
chore(release): v0.7.0 (#64)
scttfrdmn commentedon Jun 15, 2026
Shipped in nf-spawn v0.7.0 — https://github.com/spore-host/nf-spawn/releases/tag/v0.7.0 (plugin asset
nf-spawn-0.7.0.zip).ext.azis implemented as you sketched: read insubmit(), appended tospawn launchas--az <zone>only when set (unset preserves spawn's own placement). aws-microbiome-demo can now bump to 0.7.0 and flip theext.azseam — set it to the AZ where the snapshot's FSR is enabled:process { withName: 'KRAKEN2_KRAKEN2' { ext.az = 'us-east-1a' ext.volumes = [[ snapshot: 'snap-...', mount: '/opt/databases/kraken2', readOnly: true ]] } }README directive table documents it. Thanks for the clear write-up + the no-op seam — made this a clean drop-in.