You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Chris Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Copy file name to clipboardExpand all lines: docs/config.md
+23-18Lines changed: 23 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -254,13 +254,12 @@ With the above configuration:
254
254
255
255
## Config profiles
256
256
257
-
Configuration files can contain the definition of one or more *profiles*. A profile is a set of configuration attributes that can be selected during pipeline execution by using the `-profile` command line option.
257
+
Configuration files can define one or more *profiles*. A profile is a set of configuration settings that can be selected during pipeline execution using the `-profile` command line option.
258
258
259
-
Configuration profiles are defined by using the special scope `profiles`, which group the attributes that belong to the same profile using a common prefix. For example:
259
+
Configuration profiles are defined in the `profiles` scope. For example:
260
260
261
261
```groovy
262
262
profiles {
263
-
264
263
standard {
265
264
process.executor = 'local'
266
265
}
@@ -276,41 +275,47 @@ profiles {
276
275
process.container = 'cbcrg/imagex'
277
276
docker.enabled = true
278
277
}
279
-
280
278
}
281
279
```
282
280
283
-
This configuration defines three different profiles: `standard`, `cluster`, and `cloud`, that each set different process
284
-
configuration strategies depending on the target runtime platform. The `standard` profile is used by default when no profile is specified.
281
+
The above configuration defines three profiles: `standard`, `cluster`, and `cloud`. Each profile provides a different configuration for a given execution environment. The `standard` profile is used by default when no profile is specified.
285
282
286
-
:::{tip}
287
-
Multiple configuration profiles can be specified by separating the profile names with a comma, for example:
283
+
Configuration profiles can be specified at runtime as a comma-separated list:
288
284
289
285
```bash
290
286
nextflow run <your script> -profile standard,cloud
291
287
```
292
288
293
289
Config profiles are applied in the order in which they were defined in the config file, regardless of the order they are specified on the command line.
290
+
291
+
:::{versionadded} 25.02.0-edge
292
+
When using the {ref}`strict config syntax <updating-config-syntax>`, profiles are applied in the order in which they are specified on the command line.
294
293
:::
295
294
296
295
:::{danger}
297
-
When using the `profiles` feature in your config file, do NOT set attributes in the same scope both inside and outside a `profiles` context. For example:
296
+
When defining a profile in the config file, avoid using both the dot and block syntax for the same scope. For example:
298
297
299
298
```groovy
300
-
process.cpus = 1
301
-
302
299
profiles {
303
-
foo {
304
-
process.memory = '2 GB'
305
-
}
300
+
foo {
301
+
process.memory = '2 GB'
302
+
process {
303
+
cpus = 2
304
+
}
305
+
}
306
+
}
307
+
```
306
308
307
-
bar {
308
-
process.memory = '4 GB'
309
-
}
309
+
Due to a limitation of the legacy config parser, the first setting will be overwritten by the second:
310
+
311
+
```console
312
+
$ nextflow config -profile foo
313
+
process {
314
+
cpus = 2
310
315
}
311
316
```
312
317
313
-
In the above example, the `process.cpus` attribute is not correctly applied because the `process` scope is also used in the `foo` and `bar` profiles.
318
+
This limitation can be avoided by using the {ref}`strict config syntax <updating-config-syntax>`.
Copy file name to clipboardExpand all lines: docs/updating-syntax.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -487,8 +487,14 @@ The process `when` section is deprecated. Use conditional logic, such as an `if`
487
487
488
488
The process `shell` section is deprecated. Use the `script` block instead. The VS Code extension provides syntax highlighting and error checking to help distinguish between Nextflow variables and Bash variables.
489
489
490
+
(updating-config-syntax)=
491
+
490
492
### Configuration syntax
491
493
494
+
:::{versionadded} 25.02.0-edge
495
+
The strict config syntax can be enabled in Nextflow by setting `NXF_SYNTAX_PARSER=v2`.
496
+
:::
497
+
492
498
See {ref}`Configuration <config-syntax>` for a comprehensive description of the configuration language.
493
499
494
500
Currently, Nextflow parses config files as Groovy scripts, allowing the use of scripting constructs like variables, helper functions, try-catch blocks, and conditional logic for dynamic configuration:
0 commit comments