Module System Implementation#6768
Conversation
|
Some updates: 1.- I have added the print of process outputs when finishing the process execution. 2.- I have investigated the remote module inclusion and a possible implemetation: However, when using syntax parser V2, the problem is that visitors and resolvers used for parsing are at So, what I have done is the following:
|
|
@jorgee let's move the remote module inclusion piece out of this PR. you can put it in a separate PR if you want, either way Paolo will experiment with it separately And for the module version config, in the interest of keeping the POC simple so that we can iterate quicker, let's keep the module versions in the JSON file. Paolo can also experiment with this separately if he wants |
23fc2f2 to
7dd3e52
Compare
|
Updated the branch as @bentsherman suggested
|
|
I was giving a try to this, but cannot compile it |
|
To test this branch you need to do the following:
|
Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
1785870 to
2432e90
Compare
Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
f4095a7 to
b091d73
Compare
This comment was marked as outdated.
This comment was marked as outdated.
…te to v1 registry and other required fixes Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
|
Update:
To test, you must run with registry branch |
Signed-off-by: Paolo Di Tommaso <[email protected]>
Signed-off-by: jorgee <[email protected]>
5aa950b to
c3b02a8
Compare
Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
… publish (-registry -> config.url -> default) Signed-off-by: jorgee <[email protected]>
|
Updated docs and other fixes. To test in dev, add the following lines in |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
Signed-off-by: jorgee <[email protected]>
Signed-off-by: jorgee <[email protected]>
Module System Code ReviewCRITICAL (Must Fix)1. Logic Bug —
|
|
Apologies the spam, but it looks valid points ☝️ |
Signed-off-by: jorgee <[email protected]>
|
Update:
TODO/to be decided:
|
Signed-off-by: jorgee <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: jorgee <[email protected]>
|
I have removed
|
christopher-hakkaart
left a comment
There was a problem hiding this comment.
Minor suggestions
Co-authored-by: Chris Hakkaart <[email protected]> Signed-off-by: Jorge Ejarque <[email protected]>
Signed-off-by: jorgee <[email protected]>
|
Merging into the main PR since we've resolved all of the requirements, let's continue to test and refine there |
* Add Nextflow Development Constitution 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]> * Module adr v1 Signed-off-by: Paolo Di Tommaso <[email protected]> * Module adr v2 Signed-off-by: Paolo Di Tommaso <[email protected]> * ADR: Nextflow remote modules system v2.1 Signed-off-by: Paolo Di Tommaso <[email protected]> * Add detailed CLI command descriptions to module system ADR [ci skip] - 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]> * Simplify module spec: unify dependencies under requires - 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 structured tool arguments to module spec schema - 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]> * Update adr/20251114-module-system.md [ci skip] Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Update adr/20251114-module-system.md [ci skip] Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Update adr/20251114-module-system.md [ci skip] Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Update adr/20251114-module-system.md [ci skip] Expand deprecation notice to cover all ext.* custom directives Signed-off-by: Paolo Di Tommaso <[email protected]> * Fix inconsistencies in module system ADR [ci skip] - 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]> * Fix registry API path in comparison table [ci skip] Remove @ prefix from scope in API path to match API definition Signed-off-by: Paolo Di Tommaso <[email protected]> * Fix checksum format: sha256- -> sha256: [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> * Update module API to match registry implementation [ci skip] - Update API endpoints to match seqeralabs/nextflow-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]> * Update adr [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> * Simplify module storage and verification model [ci skip] - 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]> * Update adr/20251114-module-system.md [ci skip] Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Clarify module resolution rules for version changes vs local modifications [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]> * ADR v2.3: Fix resolution rules consistency and add version entry [ci 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]> * Fix Version 2.1 date typo: 2025 -> 2024 [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> * Add module system client specification [ci skip] 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 transitive dependency resolution from module system [ci skip] - 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]> * Update adr/20251114-module-system.md [ci skip] Co-authored-by: Jorge Ejarque <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Update adr/20251114-module-system.md [ci skip] Co-authored-by: Phil Ewels <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Update modules plan [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> * Remove tools config [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> * Simplify module system requires definition [ci skip] - Remove plugins, modules, subworkflows from requires block - Spec now focused on process modules only - Dependencies managed via nextflow.config Signed-off-by: Paolo Di Tommaso <[email protected]> * Replace tool arguments with module parameters in ADR [ci skip] - Module parameters defined in meta.yaml params section with name, type, description, and example attributes - Removed tools args property and specification - Updated schema and examples throughout Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Update specs + adr [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> * Resolve some conflicts with nextflow-io/schemas#10 Signed-off-by: Ben Sherman <[email protected]> * Update adr/20251114-module-system.md [ci skip] Co-authored-by: Ben Sherman <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * Extract module parameters to separate spec [ci skip] Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * docs: clarify path name for staged task inputs (#6869) Co-authored-by: Ben Sherman <[email protected]> * Add devcontainer (#6792) Co-authored-by: Phil Ewels <[email protected]> Co-authored-by: Ben Sherman <[email protected]> * Fix vertical alignment in timeline report (#6794) * Ensure main script is first in the WorkflowRun lineage record (#6845) * Add whitespace rules to .editorconfig (#5606) * docs: Update your first script to use outputs (#6500) * Update AWS CLI install docs to bypass conda install TOS prompt (#6685) * Clarify onError and onComplete handler descriptions (#6709) [ci fast] * Use explicit memory units for LSF executor (#5217) Signed-off-by: Ben Sherman <[email protected]> * Treat LSF job status UNKWN as HOLD (#5756) * Allow boolean params to implicitly default to false (#6764) * Sched core implementation alpha1 (#6242) Signed-off-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: Lorenzo Fontana <[email protected]> * Revert version 26.01.1-edge Signed-off-by: Paolo Di Tommaso <[email protected]> * Bump copyright 2026 Signed-off-by: Paolo Di Tommaso <[email protected]> * Handle Azure Batch ActiveJobAndScheduleQuotaReached with retry (#6874) * Handle Azure Batch ActiveJobAndScheduleQuotaReached with retry (#5575) Add retry logic when Azure Batch returns HTTP 409 with ActiveJobAndScheduleQuotaReached error code during job creation, instead of failing immediately. Configurable via azure.batch.maxJobQuotaRetries (default 3) and azure.batch.jobQuotaRetryDelay (default 2 min). Generated by Claude Code Signed-off-by: adamrtalbot <[email protected]> * Refactor job quota retry to use Failsafe RetryPolicy Signed-off-by: Paolo Di Tommaso <[email protected]> Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> --------- Signed-off-by: adamrtalbot <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> * [ci fast] Add agent output mode (NXF_AGENT_MODE) Add AI agent-friendly output mode activated via NXF_AGENT_MODE=1. When enabled, Nextflow replaces the interactive ANSI progress display with minimal, structured tagged lines optimized for AI agent context windows: [PIPELINE] name version | profile=X [WORKDIR] /path/to/work [PROCESS hash] name (tag) [WARN] deduplicated warning [ERROR] name with exit/cmd/stderr/workdir [SUCCESS|FAILED] completed=N failed=N cached=N Key changes: - LogObserver interface as common abstraction for AnsiLogObserver and AgentLogObserver - Session holds a single logObserver field instead of two concrete fields - DefaultObserverFactory creates both observer types using the same pattern - AgentLogObserver filters hash-prefixed log lines to avoid duplicating [PROCESS] output - Workflow output (view operator) passes through to stdout in agent mode - Renamed env var from NXF_AGENT to NXF_AGENT_MODE - Added NXF_AGENT_MODE to environment variables documentation * Bump [email protected] Signed-off-by: Paolo Di Tommaso <[email protected]> * Bump [email protected] Signed-off-by: Paolo Di Tommaso <[email protected]> * Bump [email protected] Signed-off-by: Paolo Di Tommaso <[email protected]> * Bump [email protected] Signed-off-by: Paolo Di Tommaso <[email protected]> * Bump [email protected] Signed-off-by: Paolo Di Tommaso <[email protected]> * Bump [email protected] nextflowVersion Signed-off-by: Paolo Di Tommaso <[email protected]> * Bump [email protected] nextflowVersion and README Signed-off-by: Paolo Di Tommaso <[email protected]> * Fix AgentLogObserver println clash with Groovy GDK method Signed-off-by: Paolo Di Tommaso <[email protected]> * Add Summary section to plugin README files Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Paolo Di Tommaso <[email protected]> * [release] [ci fast] Nextflow version 26.02.0-edge Signed-off-by: Paolo Di Tommaso <[email protected]> * Fix docs [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> * Add logStreamId to Tower task record (#6877) Propagate the log stream identifier from TraceRecord to the Tower task record so that Seqera Platform can link tasks to their cloud log streams. Signed-off-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> * Don't include container in task trace when containers are not enabled (#6824) * Propagate errors from workflow outputs (#6876) * Fix type detection of CLI params in v2 config parser (#6765) * Add NVMe disk allocation and diskMountPath support (#6879) [ci fast] * Add NVMe disk allocation and diskMountPath support for Seqera executor For task/node allocation the default is /tmp; for nvme allocation the default is the server-configured NVMe mount path (typically /scratch). Signed-off-by: Paolo Di Tommaso <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> * Version 2.7: rename `.checksum` to `.module-info`, remove `@` prefix from module scopes, remove version pinning from `nextflow.config` Signed-off-by: Ben Sherman <[email protected]> * Module System Implementation (#6768) Signed-off-by: jorgee <[email protected]> * minor edits Signed-off-by: Ben Sherman <[email protected]> * Cleanup module run output Signed-off-by: Ben Sherman <[email protected]> * Fix meta.yaml -> meta.yml, module manifest -> module spec Signed-off-by: Ben Sherman <[email protected]> * Fix failing test Signed-off-by: Ben Sherman <[email protected]> * fix tests Signed-off-by: jorgee <[email protected]> * modify module list to skip subdirectories of directories that already contains the .module-info. This folders can't be a module Signed-off-by: jorgee <[email protected]> * Update docs Signed-off-by: Ben Sherman <[email protected]> * Apply suggestion from @pditommaso [ci skip] Signed-off-by: Paolo Di Tommaso <[email protected]> --------- Signed-off-by: Paolo Di Tommaso <[email protected]> Signed-off-by: Ben Sherman <[email protected]> Signed-off-by: adamrtalbot <[email protected]> Signed-off-by: jorgee <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Jorge Ejarque <[email protected]> Co-authored-by: Phil Ewels <[email protected]> Co-authored-by: Ben Sherman <[email protected]> Co-authored-by: Abi <[email protected]> Co-authored-by: Peter Kneale <[email protected]> Co-authored-by: Chris Hakkaart <[email protected]> Co-authored-by: Rintze Zelle <[email protected]> Co-authored-by: Colin J. Brislawn <[email protected]> Co-authored-by: Lorenzo Fontana <[email protected]> Co-authored-by: Adam Talbot <[email protected]> Co-authored-by: Edmund Miller <[email protected]> Co-authored-by: jorgee <[email protected]>
This pull request introduces a new
modulecommand-line interface for managing Nextflow modules, including installing, listing, and publishing modules. It adds a newmodulecommand with several subcommands, updates the CLI infrastructure to support unknown options for this command, and brings in new dependencies required for module packaging and extraction.Major new features and CLI enhancements:
CmdModuleclass implementing thenextflow modulecommand, with subcommands for install, list, publish, run, remove, and search. This includes full CLI argument parsing, usage/help handling, and subcommand delegation.ModuleRunextends CmdRun installing the module and calling CmdRun with the downloaded module.Launcher and CLI infrastructure updates:
CmdModulecommand in the mainLauncherclass so it is available as a top-level command.Launcherto allow unknown options for themodulecommand and to pass these unknown options to the command implementation. [1] [2]CmdBaseclass to support storing and retrieving unknown CLI options, enabling more flexible argument handling for subcommands.Dependency management:
org.apache.commons:commons-compressas a dependency for handling tar.gz extraction, which is necessary for module packaging and publishing.Building and Testing
Current CI is failing becuase it requires a local development registry instance with modules API implemented. You will need it to update build.gradle to updated npr-api package with the new module API classes. Either with
includeBuildor a Maven local repository. You will also need to deploy the registry locally and configure theregistryfield innextflow.configto test the new CLI commansOpen Issue and TODOs:
nextflow_spec.jsonfor simplicity.