Skip to content

Commit 7838c1e

Browse files
authored
Merge branch 'master' into azure_batch_no_container_spec
2 parents 12965bf + ee25217 commit 7838c1e

Some content is hidden

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

59 files changed

+727
-333
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
- name: Test
9191
if: steps.changed-files.outputs.any_changed == 'true'
9292
run: |
93+
env | sort
9394
# configure test env
9495
if [[ "$GOOGLE_SECRET" ]]; then
9596
echo $GOOGLE_SECRET | base64 -d > $PWD/google_credentials.json
@@ -158,6 +159,11 @@ jobs:
158159
- name: Run tests
159160
run: |
160161
env | sort
162+
# configure test env
163+
if [[ "$GOOGLE_SECRET" ]]; then
164+
echo $GOOGLE_SECRET | base64 -d > $PWD/google_credentials.json
165+
export GOOGLE_APPLICATION_CREDENTIALS=$PWD/google_credentials.json
166+
fi
161167
cat $HOME/.nextflow/scm
162168
make clean assemble install
163169
bash test-ci.sh

docs/aws.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,53 +46,54 @@ Minimal permissions policies to be attached to the AWS account used by Nextflow
4646
- To use AWS Batch:
4747

4848
```json
49-
"batch:DescribeJobQueues"
5049
"batch:CancelJob"
51-
"batch:SubmitJob"
52-
"batch:ListJobs"
5350
"batch:DescribeComputeEnvironments"
54-
"batch:TerminateJob"
51+
"batch:DescribeJobDefinitions"
52+
"batch:DescribeJobQueues"
5553
"batch:DescribeJobs"
54+
"batch:ListJobs"
5655
"batch:RegisterJobDefinition"
57-
"batch:DescribeJobDefinitions"
56+
"batch:SubmitJob"
57+
"batch:TagResource"
58+
"batch:TerminateJob"
5859
```
5960

6061
- To view [EC2](https://aws.amazon.com/ec2/) instances:
6162

6263
```json
63-
"ecs:DescribeTasks"
64+
"ec2:DescribeInstanceAttribute"
6465
"ec2:DescribeInstances"
66+
"ec2:DescribeInstanceStatus"
6567
"ec2:DescribeInstanceTypes"
66-
"ec2:DescribeInstanceAttribute"
6768
"ecs:DescribeContainerInstances"
68-
"ec2:DescribeInstanceStatus"
69+
"ecs:DescribeTasks"
6970
```
7071

7172
- To pull container images from [ECR](https://aws.amazon.com/ecr/) repositories:
7273

7374
```json
74-
"ecr:GetAuthorizationToken"
7575
"ecr:BatchCheckLayerAvailability"
76-
"ecr:GetDownloadUrlForLayer"
77-
"ecr:GetRepositoryPolicy"
78-
"ecr:DescribeRepositories"
79-
"ecr:ListImages"
80-
"ecr:DescribeImages"
8176
"ecr:BatchGetImage"
77+
"ecr:DescribeImages"
78+
"ecr:DescribeImageScanFindings"
79+
"ecr:DescribeRepositories"
80+
"ecr:GetAuthorizationToken"
81+
"ecr:GetDownloadUrlForLayer"
8282
"ecr:GetLifecyclePolicy"
8383
"ecr:GetLifecyclePolicyPreview"
84+
"ecr:GetRepositoryPolicy"
85+
"ecr:ListImages"
8486
"ecr:ListTagsForResource"
85-
"ecr:DescribeImageScanFindings"
8687
```
8788

8889
:::{note}
8990
If you are running Fargate or Fargate Spot, you may need the following policies in addition to the listed above:
9091
```json
92+
"ec2:DescribeSubnets"
9193
"ecs:CreateCluster"
9294
"ecs:DeleteCluster"
9395
"ecs:DescribeClusters"
9496
"ecs:ListClusters"
95-
"ec2:DescribeSubnets"
9697
```
9798
:::
9899

docs/cache-and-resume.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ process gather {
148148
input:
149149
tuple val(id), file(foo)
150150
tuple val(id), file(bar)
151+
152+
script:
151153
"""
152154
merge_command $foo $bar
153155
"""
@@ -168,6 +170,8 @@ workflow {
168170
process gather {
169171
input:
170172
tuple val(id), file(foo), file(bar)
173+
174+
script:
171175
"""
172176
merge_command $foo $bar
173177
"""

docs/channel.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ process foo {
4545
output:
4646
path 'x.txt'
4747
48+
script:
4849
"""
4950
echo $x > x.txt
5051
"""

docs/cli.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,36 @@ $ nextflow run <pipeline> --files "*.fasta"
243243
```
244244
:::
245245

246+
Parameters specified on the command line can be also specified in a params file using the `-params-file` option.
247+
248+
```bash
249+
nextflow run main.nf -params-file pipeline_params.yml
250+
```
251+
252+
The `-params-file` option loads parameters for your Nextflow pipeline from a JSON or YAML file. Parameters defined in the file are equivalent to specifying them directly on the command line. For example, instead of specifying parameters on the command line:
253+
254+
```bash
255+
nextflow run main.nf --alpha 1 --beta foo
256+
```
257+
258+
Parameters can be represented in YAML format:
259+
260+
```yaml
261+
alpha: 1
262+
beta: 'foo'
263+
```
264+
265+
Or in JSON format:
266+
267+
```json
268+
{
269+
"alpha": 1,
270+
"beta": "foo"
271+
}
272+
```
273+
274+
The parameters specified in a params file are merged with the resolved configuration. The values provided via a params file overwrite those of the same name in the Nextflow configuration file, but not those specified on the command line.
275+
246276
## Managing projects
247277

248278
Nextflow seamlessly integrates with popular Git providers, including [BitBucket](http://bitbucket.org/), [GitHub](http://github.com), and [GitLab](http://gitlab.com) for managing Nextflow pipelines as version-controlled Git repositories.

docs/conda.md

Lines changed: 69 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Nextflow has built-in support for Conda that allows the configuration of workflow dependencies using Conda recipes and environment files.
88

9-
This allows Nextflow applications to use popular tool collections such as [Bioconda](https://bioconda.github.io) whilst taking advantage of the configuration flexibility provided by Nextflow.
9+
This allows Nextflow applications to use popular tool collections such as [Bioconda](https://bioconda.github.io) and the [Python Package index](https://pypi.org/), whilst taking advantage of the configuration flexibility provided by Nextflow.
1010

1111
## Prerequisites
1212

@@ -22,7 +22,7 @@ Dependencies are specified by using the {ref}`process-conda` directive, providin
2222
Conda environments are stored on the file system. By default, Nextflow instructs Conda to save the required environments in the pipeline work directory. The same environment may be created/saved multiple times across multiple executions when using different work directories.
2323
:::
2424

25-
You can specify the directory where the Conda environments are stored using the `conda.cacheDir` configuration property. When using a computing cluster, make sure to use a shared file system path accessible from all compute nodes. See the {ref}`configuration page <config-conda>` for details about Conda configuration.
25+
You can specify the directory where the Conda environments are stored using the `conda.cacheDir` configuration property. When using a computing cluster, make sure to use a shared file system path accessible from all compute nodes. See the {ref}`configuration page <config-conda>` for details about Conda configuration.
2626

2727
:::{warning}
2828
The Conda environment feature is not supported by executors that use remote object storage as a work directory. For example, AWS Batch.
@@ -49,9 +49,10 @@ Conda package names can specified using the `conda` directive. Multiple package
4949
process foo {
5050
conda 'bwa samtools multiqc'
5151
52-
'''
52+
script:
53+
"""
5354
your_command --here
54-
'''
55+
"""
5556
}
5657
```
5758

@@ -61,6 +62,7 @@ The usual Conda package syntax and naming conventions can be used. The version o
6162

6263
The name of the channel where a package is located can be specified prefixing the package with the channel name as shown here `bioconda::bwa=0.7.15`.
6364

65+
(conda-env-files)=
6466
### Use Conda environment files
6567

6668
Conda environments can also be defined using one or more Conda environment files. This is a file that lists the required packages and channels structured using the YAML format. For example:
@@ -76,20 +78,6 @@ dependencies:
7678
- bwa=0.7.15
7779
```
7880
79-
This other example shows how to leverage a Conda environment file to install Python packages from the [PyPI repository](https://pypi.org/)), through the `pip` package manager (which must also be explicitly listed as a required package):
80-
81-
```yaml
82-
name: my-env-2
83-
channels:
84-
- defaults
85-
dependencies:
86-
- pip
87-
- pip:
88-
- numpy
89-
- pandas
90-
- matplotlib
91-
```
92-
9381
Read the Conda documentation for more details about how to create [environment files](https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-file-manually).
9482
9583
The path of an environment file can be specified using the `conda` directive:
@@ -98,17 +86,37 @@ The path of an environment file can be specified using the `conda` directive:
9886
process foo {
9987
conda '/some/path/my-env.yaml'
10088
101-
'''
89+
script:
90+
"""
10291
your_command --here
103-
'''
92+
"""
10493
}
10594
```
10695

10796
:::{warning}
10897
The environment file name **must** have a `.yml` or `.yaml` extension or else it won't be properly recognised.
10998
:::
11099

111-
Alternatively, it is possible to provide the dependencies using a plain text file, just listing each package name as a separate line. For example:
100+
(conda-pypi)=
101+
### Python Packages from PyPI
102+
103+
Conda environment files can also be used to install Python packages from the [PyPI repository](https://pypi.org/), through the `pip` package manager (which must also be explicitly listed as a required package):
104+
105+
```yaml
106+
name: my-env-2
107+
channels:
108+
- defaults
109+
dependencies:
110+
- pip
111+
- pip:
112+
- numpy
113+
- pandas
114+
- matplotlib
115+
```
116+
117+
### Conda text files
118+
119+
It is possible to provide dependencies by listing each package name as a separate line in a plain text file. For example:
112120

113121
```
114122
bioconda::star=2.5.4a
@@ -120,6 +128,43 @@ bioconda::multiqc=1.4
120128
Like before, the extension matters. Make sure the dependencies file has a `.txt` extension.
121129
:::
122130

131+
### Conda lock files
132+
133+
The final way to provide packages to Conda is with [Conda lock files](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#identical-conda-envs).
134+
135+
These are generated from existing Conda environments using the following command:
136+
137+
```bash
138+
conda list --explicit > spec-file.txt
139+
```
140+
141+
or if using Mamba / Micromamba:
142+
143+
```bash
144+
micromamba env export --explicit > spec-file.txt
145+
```
146+
147+
Conda lock files can also be downloaded from [Wave](https://seqera.io/wave/) build pages.
148+
149+
These files include every package and their dependencies. As such, no Conda environment resolution step is needed. This is faster and more reproducible.
150+
151+
The files contain package URLs and an optional md5hash for each download to confirm identity:
152+
153+
```
154+
# micromamba env export --explicit
155+
# This file may be used to create an environment using:
156+
# $ conda create --name <env> --file <this file>
157+
# platform: linux-64
158+
@EXPLICIT
159+
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81
160+
https://conda.anaconda.org/conda-forge/linux-64/libgomp-13.2.0-h77fa898_7.conda#abf3fec87c2563697defa759dec3d639
161+
https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d
162+
https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-13.2.0-h77fa898_7.conda#72ec1b1b04c4d15d4204ece1ecea5978
163+
# .. and so on
164+
```
165+
166+
To use with Nextflow, simply set the `conda` directive to the lock file path.
167+
123168
### Use existing Conda environments
124169

125170
If you already have a local Conda environment, you can use it in your workflow specifying the installation directory of such environment by using the `conda` directive:
@@ -128,9 +173,10 @@ If you already have a local Conda environment, you can use it in your workflow s
128173
process foo {
129174
conda '/path/to/an/existing/env/directory'
130175
131-
'''
176+
script:
177+
"""
132178
your_command --here
133-
'''
179+
"""
134180
}
135181
```
136182

docs/config.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ The following constants are globally available in a Nextflow configuration file:
113113
`projectDir`
114114
: The directory where the main script is located.
115115

116+
## Functions
117+
118+
The following functions are globally available in a Nextflow configuration file:
119+
120+
`env( name )`
121+
: :::{versionadded} 24.11.0-edge
122+
:::
123+
: Get the value of the environment variable with the specified name in the Nextflow launch environment.
124+
116125
(config-params)=
117126

118127
## Parameters
@@ -129,6 +138,8 @@ params {
129138
}
130139
```
131140

141+
See {ref}`cli-params` for information about how to modify these on the command line.
142+
132143
(config-process)=
133144

134145
## Process configuration

0 commit comments

Comments
 (0)