-
Notifications
You must be signed in to change notification settings - Fork 763
ADR: Nextflow Module System #6650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Introduce comprehensive development constitution documenting core principles and practices for Nextflow development including modular architecture, test-driven quality assurance, dataflow programming model, licensing compliance, DCO requirements, semantic versioning, and Groovy code standards. The constitution codifies existing best practices from CLAUDE.md and CONTRIBUTING.md to provide clear governance and quality standards for the project. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
Signed-off-by: Paolo Di Tommaso <[email protected]>
- Add comprehensive documentation for all module CLI commands - Add `nextflow module run` command for standalone module execution - Remove `module update` command to simplify the design - Use single-dash prefix for Nextflow options, double-dash for module inputs - Remove @ prefix from scope in CLI commands (keep only in DSL syntax) Signed-off-by: Paolo Di Tommaso <[email protected]>
- Remove separate `dependencies` and `components` fields - Expand `requires` to include: - `nextflow`: version constraint (unchanged) - `plugins`: array with name@constraint syntax - `modules`: array of module dependencies - `workflows`: array of workflow dependencies - Unified version constraint syntax: `[scope/]name[@constraint]` - Mark `components` as deprecated (use requires.modules) - Update all examples in ADR and schema Signed-off-by: Paolo Di Tommaso <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]>
- Add `args` property to tools section for type-safe argument configuration - Define toolArgSpec with flag, type, description, default, enum, required - Support implicit variable `tools.<toolname>.args.<argname>` returning formatted flag+value (e.g., "-K 100000000") - Support `tools.<toolname>.args` to return all args concatenated - Document deprecation of ext.args/ext.args2/ext.args3 pattern - Update ADR with Tool Arguments Configuration section and appendix [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]>
c956ca7 to
01c777a
Compare
|
The module spec schema will be defined in the |
| ### 1. Remote Module Inclusion | ||
|
|
||
| **DSL Syntax**: | ||
| ```groovy | ||
| // Import from registry (scoped module name, detected by @scope prefix) | ||
| include { BWA_ALIGN } from '@nf-core/bwa-align' | ||
|
|
||
| // Existing file-based includes remain supported | ||
| include { MY_PROCESS } from './modules/my-process.nf' | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be out-of-scope for the first iteration. Let's focus on the modules command and module spec generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I have understood correctly, at parse time @nf-core/bwa-align will be translated to modules/@scope/name@version/main.nf.
If it is not supported in first iteration, users must write the include statements providing the module path taking into account the version and keep the coherence of these include statements with the versions of nextflow.config.
I think it is also required for defining modules importing other modules. If this is not supported, modules must be written using include with paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, likely module versioning would also be out of scope. The primary motivation initially was to allow remote module execution:
nextflow module run @nf-core/bwa-alignThis can be done without remote module inclusion. We can probably still implement module versioning just for installing and executing modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to delay module versioning, there's already an initial implementation for the registry backend
adr/20251114-module-system.md
Outdated
|
|
||
| **Resolution Timing**: Modules resolved at workflow parse time (after plugin resolution at startup). | ||
|
|
||
| **Local Storage**: Downloaded modules stored in `modules/@scope/name@version/` directory in project root (not global cache). Each module must contain a `main.nf` file as the required entry point. It is intended that module source code will be committed to the pipeline git repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There could be cases where the version in cached modules does not match the nextflow.config (e.g users upgrade the module in config but do not commit the module's files)
What should it do in these cases? warn the user and download the new version or fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely it should be added a command to detect/solve these kind of inconsistency but I would avoid warning too verbosely
adr/20251114-module-system.md
Outdated
| 2. Downloads the module archive from the registry | ||
| 3. Extracts to `modules/@scope/name@version/` directory | ||
| 4. Recursively installs transitive dependencies declared in `meta.yaml` | ||
| 5. Updates `nextflow.config` if installing a new module not already configured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it also include the installed transitive dependencies in nexflow.config, or just the module requested to install.
adr/20251114-module-system.md
Outdated
| c. If not found locally: query registry for latest version | ||
| d. Warn if module not pinned in config (especially transitive dependencies) | ||
| 3. Download missing modules to `modules/@scope/name@version/` | ||
| 4. Read module's `meta.yaml` → resolve transitive dependencies recursively |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules meta includes required Nextflow version and plugins. At this point, I think it should validate the required nextflow version and the required plugins (loading them if missing)
Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]>
Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]>
Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]>
Expand deprecation notice to cover all ext.* custom directives Signed-off-by: Paolo Di Tommaso <[email protected]>
- Use consistent module path format with version: modules/@scope/name@version/ - Fix directory structure example: samtools-view -> samtools/view - Standardize on 'license' spelling (American English) - Fix author -> authors (plural array format) Signed-off-by: Paolo Di Tommaso <[email protected]>
Remove @ prefix from scope in API path to match API definition Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
- Update API endpoints to match seqeralabs/plugin-registry#266 - Use /api/modules base path (no v1 prefix) - Use single {name} parameter with namespace (e.g., "nf-core/fastqc") - Add separate /releases endpoint - Simplify publish to single POST endpoint Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
- Remove checksums from nextflow.config (registry is source of truth) - Use single version per module locally (no version in directory path) - Add .checksum file in module directory for integrity verification - Simplify freeze command to only pin transitive dependency versions - Checksum mismatch reports warning instead of automatic re-download - Remove resolved open question about checksum verification Signed-off-by: Paolo Di Tommaso <[email protected]>
Summary of Recent ChangesMajor Simplification: Module Storage and Verification ModelThe module system has been significantly simplified by making the registry the source of truth for checksums: Config Syntax Simplified - Removed checksums from config, version-only format: modules {
'@nf-core/salmon' = '1.1.0'
'@nf-core/bwa-align' = '1.2.0'
}Local Storage Structure - Single version per module (no version in path), with Verification Flow:
Other Updates
|
Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]>
…tions [ci skip] - Added Resolution Rules table clearly specifying behavior for each scenario: - Version change (local unmodified): automatically replace with declared version - Local modification (checksum mismatch): warn and protect local changes - Use -force flag to override locally modified modules - Updated install command behavior to reflect checksum verification - Updated Technical Details with expanded resolution flow Signed-off-by: Paolo Di Tommaso <[email protected]>
…skip] - Fixed Resolution Rules table: locally modified modules will NOT be replaced unless -force is used (was incorrectly saying "will be replaced") - Added Version 2.3 changelog entry documenting: - Resolution Rules table with clear behavior matrix - Local modification protection with -force flag - Simplified storage model (single version per module) - .checksum file for fast integrity verification Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Specification for Nextflow module system client implementation based on ADR 20251114-module-system.md. Covers: P1 (Core): - Install and use registry modules via @scope/name syntax - Run modules directly from CLI without wrapper workflow - Structured tool arguments replacing ext.args pattern P2 (Important): - Module version management and freeze command - Module integrity protection with checksum validation P3 (Nice to have): - Remove module command - Search and discover modules - Publish module to registry Registry backend is out of scope (assumed implemented). Signed-off-by: Paolo Di Tommaso <[email protected]>
- Remove `freeze` command from CLI - Remove transitive dependency install behavior - Remove orphaned transitive dependency removal from `remove` command - Update rationale and consequences sections - Simplify dependency resolution flow - Update ADR to version 2.4 Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]>
Version 2.4 ChangesUpdated the ADR to remove transitive dependency resolution from the initial implementation scope. This simplifies the module system by requiring explicit dependency declarations. Summary of Changes
RationaleTransitive dependency resolution adds significant complexity and will not be implemented in this initial stage. Each module's dependencies must be explicitly declared in This change also affects the spec at
|
Summary
Architecture Decision Record (ADR) for the Nextflow Module System, documenting:
@scope/namesyntaxmeta.yaml) with JSON Schema validationext.argspatternKey Files
adr/20251114-module-system.md- Main ADR document with full specificationadr/module-spec-schema.json- JSON Schema formeta.yamlvalidationUpdates
Version 2.2 (2025-01-06)
argsproperty totoolssection for type-safe argument configurationtools.<toolname>.args.<argname>returns formatted flag+value;tools.<toolname>.argsreturns all args concatenatedext.args,ext.args2,ext.args3pattern deprecated in favor of structured tool argumentsVersion 2.1 (2025-12-11)
components,dependencies, andrequiresinto singlerequiresfieldrequires.modulesandrequires.workflowsfor declaring module dependencies[scope/]name[@constraint]format across plugins, modules, and workflowscomponentsfield deprecated (userequires.modulesinstead)Test plan
🤖 Generated with Claude Code