Repository navigation
feat: symlink local/volume path inputs + bind-mount ext.volumes into container (#51) - #52
Merged
Merged
Conversation
…container (#51) ext.volumes mounts a read-only reference DB on the task host, but two gaps kept it from feeding an nf-core staged `path` input (the db_path pattern): 1. A `path` input is referenced by its work-dir STAGE NAME, not the absolute mount path (e.g. metaphlan does `find -L metaphlan_db ...`). nf-spawn skipped local (non-s3://) inputs entirely, so no entry by that stage name existed → the tool found nothing. Now: when a declared path input's source is a local absolute path present on the task, symlink the stage name → that path (the spawn equivalent of Nextflow's stageInMode=symlink on a shared FS). Guarded by an existence test so it degrades safely when no matching volume is attached. 2. The task container only bind-mounted the work dir, so /opt/databases/x was invisible inside it. Now each ext.volumes mount is bind-mounted into the container (read-only when the volume is). Result: a volume-backed DB is read straight off the mount — zero copy, zero per-task download — for both direct-read tools and staged path inputs. Combined with attaching the same read-only snapshot on the head node (satisfies nf-core's head-side `exists` validation), an unmodified nf-core pipeline runs on a volume-backed DB with no fork. Helpers: localAbsolutePath (file://|/abs → path, else ''), volumeBindMounts (ext.volumes → docker -v flags). Docs/README rewritten accordingly.
This was referenced Jun 14, 2026
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 #51 (follow-up to #49). Makes
ext.volumesfeed an nf-core stagedpathinput (db_path) with zero copy and zero per-task download — the wasteful download-per-task route is now only a fallback.The two gaps (traced against taxprofiler 2.0.0 + Nextflow staging)
pathinput is referenced in the task script by its work-dir stage name, not the mount path — taxprofiler's metaphlan module doesfind -L "${metaphlan_db_latest}" .... nf-spawn skipped local (non-s3://) inputs, so nothing by that stage name existed in the task CWD.buildRunLinebind-mounted only the work dir, so/opt/databases/x(the hostext.volumesmount) was invisible inside the Docker task.Fix
buildInputStaging): when a declaredpathinput's source is a local absolute path, emitif [ -e <path> ]; then ln -sfn <path> ${LOCAL_DIR}/<stageName>; fi. The spawn equivalent ofstageInMode=symlinkon a shared FS;find -Lfollows it to the read-only volume. The existence guard means it degrades safely when no matching volume is attached (genuinely-local files still fall to the work-dir sync).ext.volumesmount →docker run -v /mount:/mount[:ro](:rowhen the volume is read-only), appended to the resolved run options.New helpers:
localAbsolutePath(file:////abs→ path, else'') andvolumeBindMounts(ext.volumes→-vflags).The head-node piece (documented, not code)
nf-core validates
db_pathexists on the head at init — nf-spawn can't reach that. The user attaches the same read-only snapshot on the head at the same path; validation passes, no pipeline fork. A read-only snapshot attaches to many instances freely (replicating read-only data is trivially consistent). README's Delivering reference data section rewritten to spell out the full pattern.Tests
51 total, 0 failures. Added: local
pathinput is symlinked (guarded, no copy);localAbsolutePath(file:/// bare-abs / relative→'' / null);volumeBindMounts(:rodefault,:rw, multiple, null). Built/tested JDK 17.Result
spawn snapshot createonce → attach read-only on head + every task viaext.volumes→ an unmodified nf-core pipeline reads the DB off the mount. No fork, no per-task download.