Repository navigation
fix: symlink ext.volumes DB by stage-name basename, not source URI (#55) - #56
Merged
Merged
Conversation
0.5.0 only symlinked a path input to an ext.volumes mount when the input's SOURCE URI was that local mount. But pipelines that stage db_path (taxprofiler copies it into the Nextflow S3 work area) present the source as an s3:// stage copy — never the mount — so nf-spawn fell back to `aws s3 cp` and downloaded the DB per task. The volume was bind-mounted but unused. A 16 GB DB copied fine; a 36 GB one truncated and the tool failed (find -L found no index → bowtie2 died). Now buildInputStaging matches a declared input's stage-name BASENAME against the attached ext.volumes mounts and, on a match, symlinks stage-name → mount and skips the copy regardless of the reported source URI. So a volume-backed DB is read zero-copy off the read-only volume even when the pipeline stages db_path. New helpers: volumeMountPaths (ext.volumes → mount path list), baseName. Threaded mountPaths through submit → buildStagingScript → buildInputStaging.
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 #55. The fix that makes
ext.volumesactually zero-copy for staged-db_pathpipelines — caught by the filer's excellent live diagnosis on taxprofiler.The bug (disproved both my earlier hypotheses)
0.5.0 (#51) symlinked a
pathinput to anext.volumesmount only when the input's source URI was that local mount. But pipelines like taxprofiler stagedb_path— they copy the DB into Nextflow's S3 work area first. So the source URI nf-spawn sees iss3://…/classify/stage-<uuid>/…/metaphlan, never/opt/databases/metaphlan. The #51 "is the source a local mount?" check was always false → nf-spawn fell back to the #37aws s3 cp --recursiveand downloaded the DB per task. The volume was bind-mounted into the container but completely unused.Kraken2 "worked" only because its 16.6 GB copy completed; MetaPhlAn's 36.1 GB (two ~8.6 GB
.bt2l) truncated →find -L metaphlanfound no index → empty--bowtie2db→ bowtie2 BrokenPipe. Neither was ever zero-copy.The fix
buildInputStagingnow matches a declared input's stage-name basename against the attachedext.volumesmount basenames (e.g. inputmetaphlan↔ mount/opt/databases/metaphlan). On a match it symlinks the stage name → the mount and skips the copy — regardless of the source URI Nextflow reports. The bind-mount (already added in #51) makes the symlink resolve inside the container. So the DB is read straight off the read-only volume, zero per-task download, even when the pipeline stagesdb_path.volumeMountPaths(ext.volumes → mount path list) +baseNamehelpers;mountPathsthreadedsubmit → buildStagingScript → buildInputStaging.exit 1) rather than silently producing a dangling link.Tests
54 total, 0 failures. Added: stage-name-matches-mount → symlink not copy (even with an
s3://source); non-matching inputs still copied alongside;volumeMountPaths+baseNameunits. README "Delivering reference data" updated to describe the basename match (and that the mount must be named to match the input/db_name).To validate (filer)
Re-run taxprofiler on 0.6.0 with the MetaPhlAn mount basename matching its
db_namestage name. Expect: noaws s3 cpof the DB, ametaphlansymlink →/opt/databases/metaphlanin the work dir, and MetaPhlAn completing zero-copy like Kraken2.