Skip to content

Commit f0808c2

Browse files
committed
Add workflow.report config scopes
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent 887443e commit f0808c2

13 files changed

Lines changed: 307 additions & 44 deletions

docs/reference/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ The `run` command is used to execute a local pipeline script or remote pipeline
14401440
$ nextflow run main.nf -profile docker
14411441
```
14421442

1443-
- Execute a pipeline and generate the summary HTML report. For more information on the metrics, please refer the {ref}`tracing-page` section:
1443+
- Execute a pipeline and generate the summary HTML report. For more information on the metrics, please refer the {ref}`reports-page` section:
14441444

14451445
```console
14461446
$ nextflow run main.nf -with-report

docs/reference/config.md

Lines changed: 109 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ The following settings are available:
565565

566566
## `dag`
567567

568+
:::{deprecated} 26.04.0
569+
Use the `workflow.report.dag` scope instead.
570+
:::
571+
568572
The `dag` scope controls the generation of the {ref}`workflow-diagram`.
569573

570574
The following settings are available:
@@ -1375,6 +1379,10 @@ The following settings are available:
13751379

13761380
## `report`
13771381

1382+
:::{deprecated} 26.04.0
1383+
Use the `workflow.report.execution` scope instead.
1384+
:::
1385+
13781386
The `report` scope controls the generation of the {ref}`execution-report`.
13791387

13801388
The following settings are available:
@@ -1515,6 +1523,10 @@ The following settings are available:
15151523

15161524
## `timeline`
15171525

1526+
:::{deprecated} 26.04.0
1527+
Use the `workflow.report.timeline` scope instead.
1528+
:::
1529+
15181530
The `timeline` scope controls the generation of the {ref}`timeline-report`.
15191531

15201532
The following settings are available:
@@ -1557,6 +1569,10 @@ The following settings are available:
15571569

15581570
## `trace`
15591571

1572+
:::{deprecated} 26.04.0
1573+
Use the `workflow.report.trace` scope instead.
1574+
:::
1575+
15601576
The `trace` scope controls the generation of the {ref}`trace-report`.
15611577

15621578
The following settings are available:
@@ -1850,30 +1866,42 @@ The following settings are available:
18501866

18511867
## `workflow`
18521868

1853-
:::{versionadded} 24.10.0
1854-
:::
1855-
18561869
The `workflow` scope provides workflow execution options.
18571870

18581871
The following settings are available:
18591872

18601873
`workflow.failOnIgnore`
1861-
: :::{versionadded} 24.05.0-edge
1874+
: :::{versionadded} 24.10.0
18621875
:::
18631876
: When `true`, the pipeline will exit with a non-zero exit code if any failed tasks are ignored using the `ignore` {ref}`error strategy <process-error-strategy>` (default: `false`).
18641877

18651878
`workflow.onComplete`
1879+
: :::{deprecated} 25.10.0
1880+
Use a {ref}`trace observer <plugins-trace-observers>` in a plugin to add custom workflow handlers to a pipeline via configuration.
1881+
:::
18661882
: Specify a closure that will be invoked at the end of a workflow run (including failed runs). See {ref}`workflow-handlers` for more information.
18671883

18681884
`workflow.onError`
1885+
: :::{deprecated} 25.10.0
1886+
Use a {ref}`trace observer <plugins-trace-observers>` in a plugin to add custom workflow handlers to a pipeline via configuration.
1887+
:::
18691888
: Specify a closure that will be invoked if a workflow run is terminated. See {ref}`workflow-handlers` for more information.
18701889

1890+
### `workflow.output`
1891+
1892+
:::{versionadded} 24.10.0
1893+
:::
1894+
1895+
The `workflow.output` scope controls how workflow outputs are published.
1896+
1897+
The following settings are available:
1898+
18711899
`workflow.output.contentType`
18721900
: *Currently only supported for S3.*
18731901
: Specify the media type, also known as [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types), of published files (default: `false`). Can be a string (e.g. `'text/html'`), or `true` to infer the content type from the file extension.
18741902

18751903
`workflow.output.copyAttributes`
1876-
: :::{versionadded} 25.01.0-edge
1904+
: :::{versionadded} 25.04.0
18771905
:::
18781906
: *Currently only supported for local and shared filesystems.*
18791907
: Copy file attributes (such as the last modified timestamp) to the published file (default: `false`).
@@ -1940,3 +1968,79 @@ The following settings are available:
19401968
```groovy
19411969
workflow.output.tags = [FOO: 'hello', BAR: 'world']
19421970
```
1971+
1972+
### `workflow.report`
1973+
1974+
:::{versionadded} 26.04.0
1975+
:::
1976+
1977+
The `workflow.report` scope controls the standard {ref}`reports <reports-page>` provided by Nextflow.
1978+
1979+
The following settings are available:
1980+
1981+
**`workflow.report.dag`**
1982+
1983+
`workflow.report.dag.depth`
1984+
: *Supported by the HTML and Mermaid renderers.*
1985+
: Controls the maximum depth at which to render sub-workflows (default: no limit).
1986+
1987+
`workflow.report.dag.direction`
1988+
: *Supported by the Graphviz, DOT, HTML and Mermaid renderers.*
1989+
: Controls the direction of the DAG, can be `'LR'` (left-to-right) or `'TB'` (top-to-bottom) (default: `'TB'`).
1990+
1991+
`workflow.report.dag.enabled`
1992+
: Create the {ref}`workflow-diagram` on workflow completion (default: `false`).
1993+
1994+
`workflow.report.dag.file`
1995+
: DAG file path relative to the output directory (default: `'dag-<timestamp>.html'`).
1996+
: The output format is inferred from the file extension. See {ref}`config-dag` for the list of supported formats.
1997+
1998+
`workflow.report.dag.overwrite`
1999+
: When `true` overwrites any existing DAG file with the same name (default: `false`).
2000+
2001+
`workflow.report.dag.verbose`
2002+
: *Only supported by the HTML and Mermaid renderers.*
2003+
: When `false`, channel names are omitted, operators are collapsed, and empty workflow inputs are removed (default: `false`).
2004+
2005+
**`workflow.report.execution`**
2006+
2007+
`workflow.report.execution.enabled`
2008+
: Create the {ref}`execution-report` on workflow completion (default: `false`).
2009+
2010+
`workflow.report.execution.file`
2011+
: Report file path relative to the output directory (default: `'report-<timestamp>.html'`).
2012+
2013+
`workflow.report.execution.overwrite`
2014+
: Overwrite any existing report file with the same name (default: `false`).
2015+
2016+
**`workflow.report.timeline`**
2017+
2018+
`workflow.report.timeline.enabled`
2019+
: Create the {ref}`timeline-report` on workflow completion (default: `false`).
2020+
2021+
`workflow.report.timeline.file`
2022+
: Timeline file path relative to the output directory (default: `'timeline-<timestamp>.html'`).
2023+
2024+
`workflow.report.timeline.overwrite`
2025+
: Overwrite any existing timeline file with the same name (default: `false`).
2026+
2027+
**`workflow.report.trace`**
2028+
2029+
`workflow.report.trace.enabled`
2030+
: Create the {ref}`trace-report` on workflow completion (default: `false`).
2031+
2032+
`workflow.report.trace.fields`
2033+
: Comma-separated list of fields to include in the trace file.
2034+
: See {ref}`config-trace` for the list of available fields.
2035+
2036+
`workflow.report.trace.file`
2037+
: Trace file path relative to the output directory (default: `'trace-<timestamp>.txt'`).
2038+
2039+
`workflow.report.trace.overwrite`
2040+
: Overwrite any existing trace file with the same name (default: `false`).
2041+
2042+
`workflow.report.trace.raw`
2043+
: Report trace metrics as raw numbers where applicable, i.e. report duration values in milliseconds and memory values in bytes (default: `false`).
2044+
2045+
`workflow.report.trace.sep`
2046+
: Character used to separate values in each row (default: `\t`).

docs/reports.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(tracing-page)=
1+
(reports-page)=
22

33
# Reports
44

@@ -121,6 +121,24 @@ report {
121121

122122
See {ref}`config-report` for the list of available config options.
123123

124+
:::{versionadded} 26.04.0
125+
:::
126+
127+
Use the `workflow.report.execution` scope instead:
128+
129+
```groovy
130+
workflow {
131+
report {
132+
execution {
133+
enabled = true
134+
file = 'report.html'
135+
}
136+
}
137+
}
138+
```
139+
140+
It will automatically create the execution report in the pipeline output directory instead of the launch directory.
141+
124142
### Summary
125143

126144
The **Summary** section reports the execution status, the launch command, overall execution time, and other workflow metadata:
@@ -185,6 +203,24 @@ timeline {
185203

186204
See {ref}`config-timeline` for the list of available config options.
187205

206+
:::{versionadded} 26.04.0
207+
:::
208+
209+
Use the `workflow.report.timeline` scope instead:
210+
211+
```groovy
212+
workflow {
213+
report {
214+
timeline {
215+
enabled = true
216+
file = 'timeline.html'
217+
}
218+
}
219+
}
220+
```
221+
222+
It will automatically create the timeline report in the pipeline output directory instead of the launch directory.
223+
188224
(trace-report)=
189225

190226
## Trace file
@@ -231,6 +267,24 @@ trace {
231267

232268
See {ref}`config-trace` for the list of available config options.
233269

270+
:::{versionadded} 26.04.0
271+
:::
272+
273+
Use the `workflow.report.trace` scope instead:
274+
275+
```groovy
276+
workflow {
277+
report {
278+
trace {
279+
enabled = true
280+
file = 'trace.txt'
281+
}
282+
}
283+
}
284+
```
285+
286+
It will automatically create the trace report in the pipeline output directory instead of the launch directory.
287+
234288
(workflow-diagram)=
235289

236290
## Workflow diagram
@@ -259,3 +313,21 @@ nextflow run rnaseq-nf -preview -with-dag
259313
```
260314

261315
See {ref}`config-dag` for the list of available config options.
316+
317+
:::{versionadded} 26.04.0
318+
:::
319+
320+
Use the `workflow.report.dag` scope instead:
321+
322+
```groovy
323+
workflow {
324+
report {
325+
dag {
326+
enabled = true
327+
file = 'dag.html'
328+
}
329+
}
330+
}
331+
```
332+
333+
It will automatically create the DAG report in the pipeline output directory instead of the launch directory.

modules/nextflow/src/main/groovy/nextflow/config/WorkflowConfig.groovy

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import nextflow.config.spec.ConfigOption
2020
import nextflow.config.spec.ConfigScope
2121
import nextflow.config.spec.ScopeName
2222
import nextflow.script.dsl.Description
23+
import nextflow.trace.config.DagConfig
24+
import nextflow.trace.config.ReportConfig
25+
import nextflow.trace.config.TimelineConfig
26+
import nextflow.trace.config.TraceConfig
2327

2428
@ScopeName("workflow")
2529
@Description("""
@@ -47,12 +51,19 @@ class WorkflowConfig implements ConfigScope {
4751
final Closure onError
4852

4953
@Description("""
50-
The `workflow.output` scope provides options for publishing workflow outputs.
54+
The `workflow.output` scope controls how workflow outputs are published.
5155
5256
[Read more](https://nextflow.io/docs/latest/reference/config.html#workflow)
5357
""")
5458
final WorkflowOutputConfig output
5559

60+
@Description("""
61+
The `workflow.report` scope controls the standard reports provided by Nextflow.
62+
63+
[Read more](https://nextflow.io/docs/latest/reference/config.html#workflow)
64+
""")
65+
final WorkflowReportConfig report
66+
5667
/* required by extension point -- do not remove */
5768
WorkflowConfig() {}
5869

@@ -61,6 +72,7 @@ class WorkflowConfig implements ConfigScope {
6172
onComplete = opts.onComplete as Closure
6273
onError = opts.onError as Closure
6374
output = new WorkflowOutputConfig(opts.output as Map ?: Collections.emptyMap())
75+
report = new WorkflowReportConfig(opts.report as Map ?: Collections.emptyMap())
6476
}
6577

6678
}
@@ -124,9 +136,6 @@ class WorkflowOutputConfig implements ConfigScope {
124136
""")
125137
final Map tags
126138

127-
/* required by extension point -- do not remove */
128-
WorkflowOutputConfig() {}
129-
130139
WorkflowOutputConfig(Map opts) {
131140
contentType = opts.contentType
132141
copyAttributes = opts.copyAttributes as boolean
@@ -139,3 +148,23 @@ class WorkflowOutputConfig implements ConfigScope {
139148
}
140149

141150
}
151+
152+
@CompileStatic
153+
class WorkflowReportConfig implements ConfigScope {
154+
155+
final DagConfig dag
156+
157+
final ReportConfig execution
158+
159+
final TimelineConfig timeline
160+
161+
final TraceConfig trace
162+
163+
WorkflowReportConfig(Map opts) {
164+
dag = new DagConfig(opts.dag as Map ?: Collections.emptyMap())
165+
execution = new ReportConfig(opts.execution as Map ?: Collections.emptyMap())
166+
timeline = new TimelineConfig(opts.timeline as Map ?: Collections.emptyMap())
167+
trace = new TraceConfig(opts.trace as Map ?: Collections.emptyMap())
168+
}
169+
170+
}

0 commit comments

Comments
 (0)