Skip to content

Commit 8381711

Browse files
authored
Merge branch 'master' into feature/add-support-of-new-general-purpose-vm-families
2 parents 7dad16a + 903caea commit 8381711

79 files changed

Lines changed: 12289 additions & 187 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

adr/20251114-module-system.md

Lines changed: 897 additions & 0 deletions
Large diffs are not rendered by default.

adr/module-spec-schema.json

Lines changed: 467 additions & 0 deletions
Large diffs are not rendered by default.

docs/cli.md

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,137 @@ $ nextflow secrets set AWS_ACCESS_KEY_ID
262262
$ nextflow secrets delete AWS_ACCESS_KEY_ID
263263
```
264264

265-
See {ref}`cli-secrets` for more information.
265+
See {ref}`cli-secrets` for more information.
266+
267+
## Module management
268+
269+
:::{versionadded} 26.04.0
270+
:::
271+
272+
The `module` command enables working with reusable, registry-based modules. The Nextflow module system allows you to install, run, search, and publish standardized modules from registries, eliminating duplicate work and sharing improvements with the community.
273+
274+
Use these commands to discover modules in registries, install them into your project, run them directly without creating a workflow, and publish your own modules for others to use.
275+
276+
### Searching for modules
277+
278+
The `module search` command queries the module registry to discover available modules by keyword or name.
279+
280+
Use this to find modules for specific tasks, explore available tools, or discover community modules.
281+
282+
```console
283+
$ nextflow module search alignment
284+
$ nextflow module search "quality control" -limit 10
285+
$ nextflow module search bwa -output json
286+
```
287+
288+
Results include module names, versions, descriptions, and download statistics. Use `-limit` to control the number of results and `-output json` for JSON-formatted output.
289+
290+
See {ref}`cli-module-search` for more information.
291+
292+
### Installing modules
293+
294+
The `module install` command downloads modules from a registry and makes them available in your workflow. Modules are stored locally in the `modules/` directory. An additional `.module-info` file is created during to store installation information such as the module checksum at installation and the registry URL.
295+
296+
Use this to add reusable modules to your pipeline, manage module versions, or update modules to newer versions.
297+
298+
```console
299+
$ nextflow module install nf-core/fastqc
300+
$ nextflow module install nf-core/fastqc -version 1.0.0
301+
```
302+
303+
The installed module will be available in `modules/nf-core/fastqc`.
304+
305+
Use the `-force` flag to reinstall a module even if local modifications exist.
306+
307+
See {ref}`cli-module-install` for more information.
308+
309+
### Listing modules
310+
311+
The `module list` command displays all modules currently installed in your project, showing their versions and integrity status.
312+
313+
Use this to review installed modules, check module versions, or detect local modifications.
314+
315+
```console
316+
$ nextflow module list
317+
$ nextflow module list -output json
318+
```
319+
320+
The output shows each module's name, installed version, and whether it has been modified locally. Use `-o json` for JSON-formatted output.
321+
322+
See {ref}`cli-module-list` for more information.
323+
324+
### Viewing module information
325+
326+
The `module info` command displays detailed metadata and usage information for a specific module from the registry.
327+
328+
Use this to understand module requirements, view input/output specifications, see available tools, or generate usage templates before installing or running a module.
329+
330+
```console
331+
$ nextflow module info nf-core/fastqc
332+
$ nextflow module info nf-core/fastqc -version 1.0.0
333+
$ nextflow module info nf-core/fastqc -output json
334+
```
335+
336+
The output includes the module's version, description, authors, keywords, tools, input/output channels, and a generated usage template showing how to run the module. Use `-json` for machine-readable output suitable for programmatic access.
337+
338+
See {ref}`cli-module-info` for more information.
339+
340+
### Running modules directly
341+
342+
The `module run` command executes a module directly from the registry without requiring a wrapper workflow. This provides immediate access to module functionality for ad-hoc tasks or testing.
343+
344+
Use this to quickly run a module, test module functionality, or execute one-off data processing tasks.
345+
346+
```console
347+
$ nextflow module run nf-core/fastqc --input 'data/*.fastq.gz'
348+
$ nextflow module run nf-core/fastqc --input 'data/*.fastq.gz' -version 1.0.0
349+
```
350+
351+
The command accepts all standard Nextflow execution options (`-profile`, `-resume`, etc.):
352+
353+
```console
354+
$ nextflow module run nf-core/salmon \
355+
--reads reads.fq \
356+
--index salmon_index \
357+
-profile docker \
358+
-resume
359+
```
360+
361+
Process inputs can be specified like params on the command line. For example, `--reads reads.fq` corresponds to the `reads` input in the `nf-core/salmon` module. Run `nextflow module info nf-core/salmon` to see the available params for the module.
362+
363+
See {ref}`cli-module-run` for more information.
364+
365+
### Removing modules
366+
367+
The `module remove` command deletes modules from your project, removing local files and configuration entries.
368+
369+
Use this to clean up unused modules, free disk space, or remove deprecated modules from your pipeline.
370+
371+
```console
372+
$ nextflow module remove nf-core/fastqc
373+
$ nextflow module remove nf-core/fastqc -keep-files
374+
```
375+
376+
By default, both local files and configuration entries are removed. Use `-keep-files` to remove the configuration entry and `.module-info` while keeping local files.
377+
378+
See {ref}`cli-module-remove` for more information.
379+
380+
### Publishing modules
381+
382+
The `module publish` command uploads modules to a registry, making them available for others to install and use.
383+
384+
Use this to share your modules with the community, contribute to module libraries, or distribute modules within your organization.
385+
386+
```console
387+
$ nextflow module publish myorg/my-module
388+
$ nextflow module publish myorg/my-module -dry-run
389+
```
390+
391+
Publishing requires authentication via the `NXF_REGISTRY_TOKEN` environment variable or the `registry.apiKey` config option. The module must include `main.nf`, `meta.yml`, and `README.md` files.
392+
393+
Use `-dry-run` to validate your module structure without uploading.
394+
395+
See {ref}`cli-module-publish` for more information.
266396

267397
## Configuration and validation
268398

@@ -384,7 +514,7 @@ Use this to understand input/output relationships between tasks, trace data flow
384514
$ nextflow lineage
385515
```
386516

387-
See {ref}`data-lineage-page` to get started and {ref}`cli-lineage` for more information.
517+
See {ref}`data-lineage-page` to get started and {ref}`cli-lineage` for more information.
388518

389519
## Seqera Platform
390520

docs/module.md

Lines changed: 157 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,164 @@ This feature requires the use of a local or shared file system for the pipeline
279279

280280
## Sharing modules
281281

282-
Modules are designed to be easy to share and re-use across different pipelines, which helps eliminate duplicate work and spread improvements throughout the community. While Nextflow does not provide an explicit mechanism for sharing modules, there are several ways to do it:
282+
Modules are designed to be easy to share and re-use across different pipelines, which helps eliminate duplicate work and spread improvements throughout the community. There are several ways to share modules:
283283

284+
- Use the Nextflow module registry (recommended, see below)
284285
- Simply copy the module files into your pipeline repository
285286
- Use [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to fetch modules from other Git repositories without maintaining a separate copy
286287
- Use the [nf-core](https://nf-co.re/tools#modules) CLI to install and update modules with a standard approach used by the nf-core community
288+
289+
(module-registry)=
290+
291+
## Registry-based modules
292+
293+
:::{versionadded} 26.04.0
294+
:::
295+
296+
Nextflow provides a module registry that enables you to install, publish, and manage modules from centralized registries. This system provides version management, integrity checking, and seamless integration with the Nextflow language.
297+
298+
### Installing modules from a registry
299+
300+
Use the `module install` command to download modules from a registry:
301+
302+
```console
303+
$ nextflow module install nf-core/fastqc
304+
$ nextflow module install nf-core/fastqc -version 1.0.0
305+
```
306+
307+
Installed modules are stored in the `modules/` directory and can be included by name instead of a relative path:
308+
309+
```nextflow
310+
include { FASTQC } from 'nf-core/fastqc'
311+
312+
workflow {
313+
reads = Channel.fromFilePairs('data/*_{1,2}.fastq.gz')
314+
FASTQC(reads)
315+
}
316+
```
317+
318+
### Running modules directly
319+
320+
For ad-hoc tasks or testing, you can run a module directly without creating a workflow:
321+
322+
```console
323+
$ nextflow module run nf-core/fastqc --input 'data/*.fastq.gz'
324+
```
325+
326+
This command accepts all standard `nextflow run` options (`-profile`, `-resume`, etc.) and automatically downloads the module if not already installed.
327+
328+
### Discovering modules
329+
330+
Search for available modules using the `module search` command:
331+
332+
```console
333+
$ nextflow module search alignment
334+
$ nextflow module search "quality control" -limit 10
335+
```
336+
337+
List installed modules in your project:
338+
339+
```console
340+
$ nextflow module list
341+
```
342+
343+
### Module checksum verification
344+
345+
Nextflow automatically verifies module integrity using checksums. If you modify a module locally, Nextflow will detect the change and prevent accidental overwrites:
346+
347+
```console
348+
$ nextflow module install nf-core/fastqc -version 1.1.0
349+
Warning: Module nf-core/fastqc has local modifications. Use -force to override.
350+
```
351+
352+
Use the `-force` flag to override local modifications when needed.
353+
354+
### Removing modules
355+
356+
Use the `module remove` command to uninstall a module:
357+
358+
```console
359+
$ nextflow module remove nf-core/fastqc
360+
```
361+
362+
By default, both the module files and the `.module-info` file are removed. Use the flags below to control this behaviour:
363+
364+
- `-keep-files`: Remove the `.module-info` file created at install but keep the rest of files
365+
- `-force`: Force removal even if the module has no `.module-info` file (i.e. not installed from a registry) or has local modifications
366+
367+
### Viewing module information
368+
369+
Use the `module info` command to display metadata and a usage template for a module:
370+
371+
```console
372+
$ nextflow module info nf-core/fastqc
373+
$ nextflow module info nf-core/fastqc -version 1.0.0
374+
```
375+
376+
The output includes the module description, authors, keywords, tools, inputs, outputs, and a ready-to-use command-line template. Use `-o json` to get machine-readable output.
377+
378+
### Publishing modules
379+
380+
To share your own modules, use the `module publish` command:
381+
382+
```console
383+
$ nextflow module publish myorg/my-module
384+
```
385+
386+
The argument can be either a `scope/name` reference (for an already-installed module) or a local directory path containing the module files.
387+
388+
Your module directory must include:
389+
390+
- `main.nf`: The module entry point
391+
- `meta.yml`: Module spec (name, description, version, etc.)
392+
- `README.md`: Module documentation
393+
394+
Authentication is required for publishing and can be provided via the `NXF_REGISTRY_TOKEN` environment variable or in your configuration:
395+
396+
```groovy
397+
registry {
398+
apiKey = 'YOUR_REGISTRY_TOKEN'
399+
}
400+
```
401+
402+
Use `-dry-run` to validate your module structure without uploading:
403+
404+
```console
405+
$ nextflow module publish myorg/my-module -dry-run
406+
```
407+
408+
### Registry configuration
409+
410+
By default, Nextflow uses the public registry at `https://registry.nextflow.io`. You can configure alternative or additional registries:
411+
412+
```groovy
413+
registry {
414+
url = [
415+
'https://private.registry.myorg.com',
416+
'https://registry.nextflow.io'
417+
]
418+
apiKey = '${MYORG_TOKEN}'
419+
}
420+
```
421+
422+
Registries are queried in the order specified until a module is found. The `apiKey` is used only for the primary (first) registry.
423+
424+
### Module directory structure
425+
426+
Registry modules follow a standard directory structure:
427+
428+
```
429+
modules/
430+
└── scope/
431+
└── module-name/
432+
├── .module-info # Integrity checksum (generated automatically)
433+
├── README.md # Documentation (required for publishing)
434+
├── main.nf # Module script (required)
435+
├── meta.yml # Module spec (required for publishing)
436+
├── resources/ # Optional: module binaries and resources
437+
└── templates/ # Optional: process templates
438+
```
439+
440+
The `modules/` directory should be committed to your Git repository to ensure reproducibility.
441+
442+
See the {ref}`cli-page` documentation for more information about module commands.

0 commit comments

Comments
 (0)