Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/local/benchmark_report/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ process BENCHMARK_REPORT {
path run_dumps
val groups
path benchmark_aws_cur_report
val remove_failed_tasks

output:
path "benchmark_report.html" , emit: benchmark_html
Expand All @@ -14,6 +15,8 @@ process BENCHMARK_REPORT {
script:
def aws_cost_param = benchmark_aws_cur_report ? "--profile cost -P aws_cost:\$TASK_DIR/${benchmark_aws_cur_report}" : ""
def benchmark_samplesheet = "benchmark_samplesheet.csv"
def failed_tasks = remove_failed_tasks ? "-P remove_failed_tasks:True" : ""

"""
# Set up R environment from renv
export R_LIBS_USER=/project/renv/library/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu
Expand All @@ -33,6 +36,7 @@ process BENCHMARK_REPORT {
quarto render main_benchmark_report.qmd \\
-P log_csv:"\$TASK_DIR/"${benchmark_samplesheet} \\
$aws_cost_param \\
$failed_tasks \\
--output-dir .\\
--output benchmark_report.html

Expand Down
41 changes: 41 additions & 0 deletions modules/local/benchmark_report/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
nextflow_process {
name "Test Process BENCHMARK_REPORT"
script "../main.nf"
process "BENCHMARK_REPORT"

setup {
run("SEQERA_RUNS_DUMP") {
script "../../seqera_runs_dump/main.nf"
process {
"""
input[0] = ['id': 'fjV0o6yPbbamB', 'workspace': 'community/showcase', 'group': 'group1']
input[1] = "https://api.tower.nf"
input[2] = ""
input[3] = ""
"""
}
}
}

test("Should run with removing failed tasks") {
when {
params {
outdir = "tests/results"
}
process {
"""
input[0] = SEQERA_RUNS_DUMP.out.run_dump.collect{it[1]}
input[1] = SEQERA_RUNS_DUMP.out.run_dump.collect{it[0].group}
input[2] = []
input[3] = true
"""
}
}

then {
assert process.success
assert path(process.out.benchmark_html.get(0)).exists()
assert path(process.out.versions.get(0)).exists()
}
}
}
8 changes: 4 additions & 4 deletions modules/local/seqera_runs_dump/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Should run without failures": {
"content": [
[
"service-info.json:md5,75a5b8cded8f0ce9aab2125c0ee89f63",
"service-info.json:md5,5738071394871f50948ae77090d4af50",
"workflow-load.json:md5,4f02d5a24ab89aa648cd4346785c8f2c",
"workflow-metadata.json:md5,b37b4faeddf283a2c44cbe4000e4ab6e",
"workflow-metrics.json:md5,13a5b5d7447fad4a8baa053d1abf85e5",
Expand All @@ -13,8 +13,8 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "23.10.1"
"nextflow": "25.01.0"
},
"timestamp": "2024-11-11T11:53:03.835699"
"timestamp": "2025-02-21T15:07:19.112104"
}
}
}
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ params {
skip_multiqc = false

// Benchmark report options
generate_benchmark_report = false
generate_benchmark_report = false
benchmark_aws_cur_report = null
remove_failed_tasks = true

// Boilerplate options
outdir = 'results'
Expand Down
5 changes: 5 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
"description": "AWS CUR report from data exports.",
"pattern": "^\\S+\\.parquet",
"format": "file-path"
},
"remove_failed_tasks": {
"type": "boolean",
"fa_icon": "fas fa-times-circle",
"description": "Remove failed tasks from the benchmark report."
}
},
"required": ["seqera_api_endpoint"]
Expand Down
19 changes: 17 additions & 2 deletions subworkflows/local/utils_nf_aggregate/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,46 @@
"content": [
[
{
"group": [

],
"id": "2lXd1j7OwZVfxh",
"workspace": "community/showcase"
},
{
"group": [

],
"id": "38QXz4OfQDpwOV",
"workspace": "community/showcase"
},
{
"group": [

],
"id": "3iFMo0NtH1Byvy",
"workspace": "community/showcase"
},
{
"group": [

],
"id": "4Bi5xBK6E2Nbhj",
"workspace": "community/showcase"
},
{
"group": [

],
"id": "4LWT4uaXDaGcDY",
"workspace": "community/showcase"
}
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.04.2"
"nextflow": "25.01.0"
},
"timestamp": "2024-11-11T11:32:52.476285"
"timestamp": "2025-02-26T16:10:24.54507716"
}
}
5 changes: 3 additions & 2 deletions workflows/nf_aggregate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ workflow NF_AGGREGATE {
BENCHMARK_REPORT (
SEQERA_RUNS_DUMP.out.run_dump.collect{it[1]},
SEQERA_RUNS_DUMP.out.run_dump.collect{it[0].group},
aws_cur_report
aws_cur_report,
params.remove_failed_tasks
)
ch_versions = ch_versions.mix(BENCHMARK_REPORT.out.versions.first())
ch_versions = ch_versions.mix(BENCHMARK_REPORT.out.versions)
}

//
Expand Down
Loading