Skip to content

Commit b9becd4

Browse files
authored
Merge pull request #75 from seqeralabs/failed_job
Added parameter to exclude failed tasks from benchmarking report.
2 parents fcf5126 + 995c1ae commit b9becd4

File tree

7 files changed

+76
-9
lines changed

7 files changed

+76
-9
lines changed

modules/local/benchmark_report/main.nf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ process BENCHMARK_REPORT {
66
path run_dumps
77
val groups
88
path benchmark_aws_cur_report
9+
val remove_failed_tasks
910

1011
output:
1112
path "benchmark_report.html" , emit: benchmark_html
@@ -14,6 +15,8 @@ process BENCHMARK_REPORT {
1415
script:
1516
def aws_cost_param = benchmark_aws_cur_report ? "--profile cost -P aws_cost:\$TASK_DIR/${benchmark_aws_cur_report}" : ""
1617
def benchmark_samplesheet = "benchmark_samplesheet.csv"
18+
def failed_tasks = remove_failed_tasks ? "-P remove_failed_tasks:True" : ""
19+
1720
"""
1821
# Set up R environment from renv
1922
export R_LIBS_USER=/project/renv/library/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu
@@ -33,6 +36,7 @@ process BENCHMARK_REPORT {
3336
quarto render main_benchmark_report.qmd \\
3437
-P log_csv:"\$TASK_DIR/"${benchmark_samplesheet} \\
3538
$aws_cost_param \\
39+
$failed_tasks \\
3640
--output-dir .\\
3741
--output benchmark_report.html
3842
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
nextflow_process {
2+
name "Test Process BENCHMARK_REPORT"
3+
script "../main.nf"
4+
process "BENCHMARK_REPORT"
5+
6+
setup {
7+
run("SEQERA_RUNS_DUMP") {
8+
script "../../seqera_runs_dump/main.nf"
9+
process {
10+
"""
11+
input[0] = ['id': 'fjV0o6yPbbamB', 'workspace': 'community/showcase', 'group': 'group1']
12+
input[1] = "https://api.tower.nf"
13+
input[2] = ""
14+
input[3] = ""
15+
"""
16+
}
17+
}
18+
}
19+
20+
test("Should run with removing failed tasks") {
21+
when {
22+
params {
23+
outdir = "tests/results"
24+
}
25+
process {
26+
"""
27+
input[0] = SEQERA_RUNS_DUMP.out.run_dump.collect{it[1]}
28+
input[1] = SEQERA_RUNS_DUMP.out.run_dump.collect{it[0].group}
29+
input[2] = []
30+
input[3] = true
31+
"""
32+
}
33+
}
34+
35+
then {
36+
assert process.success
37+
assert path(process.out.benchmark_html.get(0)).exists()
38+
assert path(process.out.versions.get(0)).exists()
39+
}
40+
}
41+
}

modules/local/seqera_runs_dump/tests/main.nf.test.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Should run without failures": {
33
"content": [
44
[
5-
"service-info.json:md5,75a5b8cded8f0ce9aab2125c0ee89f63",
5+
"service-info.json:md5,5738071394871f50948ae77090d4af50",
66
"workflow-load.json:md5,4f02d5a24ab89aa648cd4346785c8f2c",
77
"workflow-metadata.json:md5,b37b4faeddf283a2c44cbe4000e4ab6e",
88
"workflow-metrics.json:md5,13a5b5d7447fad4a8baa053d1abf85e5",
@@ -13,8 +13,8 @@
1313
],
1414
"meta": {
1515
"nf-test": "0.9.2",
16-
"nextflow": "23.10.1"
16+
"nextflow": "25.01.0"
1717
},
18-
"timestamp": "2024-11-11T11:53:03.835699"
18+
"timestamp": "2025-02-21T15:07:19.112104"
1919
}
20-
}
20+
}

nextflow.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ params {
2828
skip_multiqc = false
2929

3030
// Benchmark report options
31-
generate_benchmark_report = false
31+
generate_benchmark_report = false
3232
benchmark_aws_cur_report = null
33+
remove_failed_tasks = true
3334

3435
// Boilerplate options
3536
outdir = 'results'

nextflow_schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080
"description": "AWS CUR report from data exports.",
8181
"pattern": "^\\S+\\.parquet",
8282
"format": "file-path"
83+
},
84+
"remove_failed_tasks": {
85+
"type": "boolean",
86+
"fa_icon": "fas fa-times-circle",
87+
"description": "Remove failed tasks from the benchmark report."
8388
}
8489
},
8590
"required": ["seqera_api_endpoint"]

subworkflows/local/utils_nf_aggregate/tests/main.nf.test.snap

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,46 @@
33
"content": [
44
[
55
{
6+
"group": [
7+
8+
],
69
"id": "2lXd1j7OwZVfxh",
710
"workspace": "community/showcase"
811
},
912
{
13+
"group": [
14+
15+
],
1016
"id": "38QXz4OfQDpwOV",
1117
"workspace": "community/showcase"
1218
},
1319
{
20+
"group": [
21+
22+
],
1423
"id": "3iFMo0NtH1Byvy",
1524
"workspace": "community/showcase"
1625
},
1726
{
27+
"group": [
28+
29+
],
1830
"id": "4Bi5xBK6E2Nbhj",
1931
"workspace": "community/showcase"
2032
},
2133
{
34+
"group": [
35+
36+
],
2237
"id": "4LWT4uaXDaGcDY",
2338
"workspace": "community/showcase"
2439
}
2540
]
2641
],
2742
"meta": {
2843
"nf-test": "0.9.2",
29-
"nextflow": "24.04.2"
44+
"nextflow": "25.01.0"
3045
},
31-
"timestamp": "2024-11-11T11:32:52.476285"
46+
"timestamp": "2025-02-26T16:10:24.54507716"
3247
}
3348
}

workflows/nf_aggregate/main.nf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ workflow NF_AGGREGATE {
6666
BENCHMARK_REPORT (
6767
SEQERA_RUNS_DUMP.out.run_dump.collect{it[1]},
6868
SEQERA_RUNS_DUMP.out.run_dump.collect{it[0].group},
69-
aws_cur_report
69+
aws_cur_report,
70+
params.remove_failed_tasks
7071
)
71-
ch_versions = ch_versions.mix(BENCHMARK_REPORT.out.versions.first())
72+
ch_versions = ch_versions.mix(BENCHMARK_REPORT.out.versions)
7273
}
7374

7475
//

0 commit comments

Comments
 (0)