RFC: Stage module/project bin scripts as task inputs#6928
Draft
pinin4fjords wants to merge 1 commit intomasterfrom
Draft
RFC: Stage module/project bin scripts as task inputs#6928pinin4fjords wants to merge 1 commit intomasterfrom
pinin4fjords wants to merge 1 commit intomasterfrom
Conversation
Replace the bind-mount mechanism for module binaries and project bin/
scripts with input file staging. Bin scripts are staged into a hidden
.bin/ directory in each task's work directory and made available via PATH.
On local/HPC executors, scripts are symlinked (zero-cost). On cloud
executors, scripts are uploaded once to {workDir}/.nextflow/bin/ and
staged per-task via standard cloud download commands.
Project bin scripts are filtered to only those referenced in the task
script, avoiding unnecessary staging for large bin/ directories.
The nextflow.enable.moduleBinaries feature flag is deprecated with a
warning. Setting it to false is honored for one release cycle.
Signed-off-by: Jonathan Manning <jonathan.manning@seqera.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jonathan Manning <jonathan.manning@seqera.io>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Stage module bin scripts as task inputs
Problem
Module binaries (
resources/usr/bin/scripts within a module directory) currently requirenextflow.enable.moduleBinaries = trueand either a local/shared filesystem or Wave containers for cloud executors. On local/HPC executors, the mechanism works by bind-mounting host directories into containers, which is fragile with path remapping, rootless containers, or non-shared filesystems. On cloud executors, module binaries don't work at all without Wave.The workflow-level
bin/directory has the same bind-mount limitation for containerized tasks.Solution
Stage bin scripts into the task work directory as implicit input files, using the same proven staging infrastructure that handles regular task inputs. A hidden
.bin/directory is created in each task's work directory, and$PATHis updated in the wrapper script to include it.{workDir}/.nextflow/bin/in cloud storage, then staged per-task via standard cloud download commandsTaskHasher)This works identically across all executors and container engines, with no feature flag, no Wave dependency, and no bind mounts required for the scripts themselves.
How each environment works
addMountForInputsstageInMode = 'copy'What changed vs. the old module binaries behavior
nextflow.enable.moduleBinaries = truerequiredresources/usr/bin/resources/bin/,resources/usr/bin/,resources/usr/local/bin/Key changes
TaskProcessor:getModuleBinFiles()andgetProjectBinFiles()collect bin scripts from module bundles and the projectbin/directory, prefixed with.bin/. For cloud work dirs,uploadBinFiles()uploads files once to{workDir}/.nextflow/bin/usingFileHelper.copyPath()with a sharedConcurrentHashMapcache to avoid duplicate uploads across processorsTaskBean: Merges bin files into the task's input files map for staging. Project bin files are filtered to only those referenced in the task script (viaTaskProcessor.getReferencedProjectBinFiles()). Warns on filename collisions between module and project bins (project wins)BashWrapperBuilder: Generateschmod +xandPATHexport in the wrapper script; bin files are mounted into containers like any other input fileSimpleFileCopyStrategy: Uses the task'sstageInModefor all files (no forced copy mode for bin files)ResourcesBundle:getBinFiles()method returns executable files underbin/,usr/bin/,usr/local/bin/TaskHasher: Includes module bin files in cache hash for correct invalidationCmdRun:detectModuleBinaryFeatureemits deprecation warnings when the flag is explicitly setBackward compatibility
getBinDirs()onTaskProcessoris deprecated and returns empty; plugins referencing it (e.g. nf-k8s) continue to compileremoteBinDirupload for project-level scripts is unchangednextflow.enable.moduleBinaries = trueemits a deprecation warning (no longer needed)nextflow.enable.moduleBinaries = falseis honored for one release cycle with a deprecation warning, then will be ignoredFuture direction
As @bentsherman pointed out, with typed processes the
stageAsdirective could offer a more explicit alternative:The implicit approach here and explicit
stageAsare complementary - implicit handles the common case (backward compatible with existing modules), whilestageAscould serve users who want fine-grained control.Questions for reviewers
remoteBinDiron cloud executors long-term?