Skip to content

Commit b437ffe

Browse files
authored
Merge pull request #89 from seqeralabs/external_run_dumps
Enable using external run logs with nf-aggregate
2 parents 013e545 + e766ed1 commit b437ffe

File tree

15 files changed

+240
-34
lines changed

15 files changed

+240
-34
lines changed

.devcontainer/devcontainer.json

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
1+
//
2+
// MAIN PRODUCTION DEVCONTAINER CONFIG
3+
// Uses image that is pre-built and pushed to GitHub
4+
// See .github/.devcontainer/devcontainer.json for build
5+
//
16
{
2-
"name": "nfcore",
3-
"image": "nfcore/gitpod:latest",
4-
"remoteUser": "gitpod",
5-
"runArgs": ["--privileged"],
6-
7-
// Configure tool-specific properties.
7+
"name": "nf-aggregate",
8+
"image": "ghcr.io/nextflow-io/training:latest",
9+
"workspaceFolder": "/workspaces/nf-aggregate",
10+
"remoteUser": "root",
11+
"remoteEnv": {
12+
// Nextflow installation version
13+
"NXF_HOME": "/workspaces/.nextflow",
14+
"NXF_EDGE": "0",
15+
"NXF_VER": "24.10.4",
16+
// Other env vars
17+
"HOST_PROJECT_PATH": "/workspaces/nf-aggregate",
18+
"SHELL": "/bin/bash" // Ush bash
19+
},
20+
"onCreateCommand": "bash .devcontainer/setup.sh",
821
"customizations": {
9-
// Configure properties specific to VS Code.
1022
"vscode": {
11-
// Set *default* container specific settings.json values on container create.
23+
"extensions": ["nf-core.nf-core-extensionpack"],
24+
// Use Python from conda
1225
"settings": {
1326
"python.defaultInterpreterPath": "/opt/conda/bin/python"
1427
},
15-
16-
// Add the IDs of extensions you want installed when the container is created.
17-
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"]
28+
// Use bash
29+
"terminal.integrated.defaultProfile.linux": "bash"
1830
}
1931
}
2032
}

.devcontainer/setup.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
# Fix for Java options
4+
printf 'unset JAVA_TOOL_OPTIONS\n' >> $HOME/.bashrc
5+
unset JAVA_TOOL_OPTIONS
6+
7+
# Customise the terminal command prompt
8+
printf "export PS1='\\[\\e[3;36m\\]\${PWD#/workspaces/} ->\\[\\e[0m\\] '\n" >> $HOME/.bashrc
9+
export PS1='\[\e[3;36m\]${PWD#/workspaces/} ->\[\e[0m\] '
10+
11+
# Force Java environment variables to use conda installation
12+
printf 'export JAVA_HOME=/opt/conda\nexport JAVA_CMD=/opt/conda/bin/java\n' >> $HOME/.bashrc
13+
export JAVA_HOME=/opt/conda
14+
export JAVA_CMD=/opt/conda/bin/java
15+
16+
# Update Nextflow
17+
nextflow self-update
18+
nextflow -version
19+
20+
cat /usr/local/etc/vscode-dev-containers/first-run-notice.txt

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"markdown.styles": ["public/vscode_markdown.css"]
2+
"markdown.styles": ["public/vscode_markdown.css"],
3+
"nextflow.telemetry.enabled": false
34
}

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,34 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
## 0.6.0
6+
## 0.7.0
7+
8+
Special thanks to the following for their contributions to the release:
9+
10+
- [Edmund Miller](https://github.com/edmundmiller)
11+
- [Florian Wuennemann](https://github.com/FloWuenne)
12+
- [Maxime Garcia](https://github.com/maxulysse)
13+
14+
Thank you to everyone else that has contributed by reporting bugs, enhancements or in any other way, shape or form.
15+
16+
### Enhancements & fixes
17+
18+
- [PR #88](https://github.com/seqeralabs/nf-aggregate/pull/88) - Update tw cli container version to 0.11.2 and allow .nextflow.log to be missing from tw call
19+
- [PR #89](https://github.com/seqeralabs/nf-aggregate/pull/89) - Enable usage of external run dumps with nf-aggregate & update devcontainer specifications
20+
21+
### Software dependencies
22+
23+
| Dependency | Old version | New version |
24+
| ----------- | ----------- | ----------- |
25+
| `tower-cli` | 0.9.2 | 0.11.2 |
26+
27+
> **NB:** Dependency has been **updated** if both old and new version information is present.
28+
>
29+
> **NB:** Dependency has been **added** if just the new version information is present.
30+
>
31+
> **NB:** Dependency has been **removed** if new version information isn't present.
32+
33+
## [[0.6.0](https://github.com/seqeralabs/nf-aggregate/releases/tag/0.6.0] - 2024-03-31)
734

835
### Credits
936

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ id,workspace,group
6969
4VLRs7nuqbAhDy,community/showcase,group2
7070
```
7171

72+
## Use logs from an external Seqera Platform deployment
73+
74+
Sometimes we want to compile benchmark reports from runs from two different Seqera platform deployments, for example a dev and a production environment to compare performance. External logs in nf-aggregate can be used by specifying the workspace as `external` and providing some additional optional columns that point to the log folder and specify whether these external logs contain fusion logs (did you export them with the `--add-fusion-logs` flag in your `tw run dumps`. If they do contain fusion logs, you can generate a gannt plot for them, as for runs supplied only via id.)
75+
76+
Here is an example of using a mix of run ids for which we want to extract logs from our platform deployment and some run logs from another deployment we want to compare. In the example below, `1JI5B1avuj3o58` is a run that contains fusion logs, while `1vsww7GjKBsVNa` does not contain fusion logs.
77+
78+
```
79+
id,workspace,group,logs,fusion
80+
3VcLMAI8wyy0Ld,community/showcase,group1,
81+
1JI5B1avuj3o58,external,group2,/path/to/my/run_dumps_tarball.tar.gz,true
82+
1vsww7GjKBsVNa,external,group2,/path/to/my/run_dumps_folder,false
83+
```
84+
85+
## Incorporate AWS split cost allocation data
86+
7287
To incorporate AWS cost data into the benchmark report, use the `benchmark_aws_cur_report` parameter. This should point to a valid AWS Cost and Usage Report (CUR) file in Parquet format, currently only supporting CUR 1.0. The file can be stored locally or in a cloud bucket.
7388
To run nf-aggregate and generate benchmark reports, you can use the following command:
7489

assets/schema_input.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,26 @@
1515
},
1616
"workspace": {
1717
"type": "string",
18-
"pattern": "^[a-zA-Z0-9](?:[a-zA-Z0-9]|[-_](?=[a-zA-Z0-9])){1,38}/[a-zA-Z0-9](?:[a-zA-Z0-9]|[-_](?=[a-zA-Z0-9])){1,38}$",
19-
"errorMessage": "Please provide a valid Seqera Platform Workspace name",
18+
"pattern": "^(?:external|[a-zA-Z0-9][a-zA-Z0-9-_]{0,38}/[a-zA-Z0-9][a-zA-Z0-9-_]{0,38})$",
19+
"errorMessage": "Please provide a valid Seqera Platform Workspace name or 'external'",
2020
"meta": ["workspace"]
2121
},
2222
"group": {
2323
"type": "string",
2424
"pattern": "^[a-zA-Z0-9][-a-zA-Z0-9_ ]{0,37}$",
2525
"errorMessage": "Please provide a valid group name",
2626
"meta": ["group"]
27+
},
28+
"logs": {
29+
"type": "string",
30+
"format": "file-path",
31+
"pattern": "^\\S+$",
32+
"errorMessage": "Please provide a valid file path to your Seqera Platform logs.",
33+
"meta": ["logs"]
34+
},
35+
"fusion": {
36+
"type": "boolean",
37+
"meta": ["fusion"]
2738
}
2839
},
2940
"required": ["id", "workspace"]

nextflow.config

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ profiles {
6262
test {
6363
params.input = "${projectDir}/workflows/nf_aggregate/assets/test_run_ids.csv"
6464
}
65+
test_benchmark {
66+
params.input = "${projectDir}/workflows/nf_aggregate/assets/test_benchmark.csv"
67+
params.generate_benchmark_report = true
68+
params.skip_run_gantt = true
69+
params.skip_multiqc = true
70+
}
6571
test_full {
6672
params.input = "${projectDir}/workflows/nf_aggregate/assets/test_run_ids.csv"
6773
}
@@ -320,7 +326,7 @@ manifest {
320326

321327
// Nextflow plugins
322328
plugins {
323-
id 'nf-schema@2.3.0' // Validation of pipeline parameters and creation of an input channel from a sample sheet
329+
id 'nf-schema@2.2.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet
324330
}
325331

326332
validation {

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,76 @@
33
"content": [
44
[
55
{
6+
"fusion": [
7+
8+
],
69
"group": [
710

811
],
912
"id": "2lXd1j7OwZVfxh",
13+
"logs": [
14+
15+
],
1016
"workspace": "community/showcase"
1117
},
1218
{
19+
"fusion": [
20+
21+
],
1322
"group": [
1423

1524
],
1625
"id": "38QXz4OfQDpwOV",
26+
"logs": [
27+
28+
],
1729
"workspace": "community/showcase"
1830
},
1931
{
32+
"fusion": [
33+
34+
],
2035
"group": [
2136

2237
],
2338
"id": "3iFMo0NtH1Byvy",
39+
"logs": [
40+
41+
],
2442
"workspace": "community/showcase"
2543
},
2644
{
45+
"fusion": [
46+
47+
],
2748
"group": [
2849

2950
],
3051
"id": "4Bi5xBK6E2Nbhj",
52+
"logs": [
53+
54+
],
3155
"workspace": "community/showcase"
3256
},
3357
{
58+
"fusion": [
59+
60+
],
3461
"group": [
3562

3663
],
3764
"id": "4LWT4uaXDaGcDY",
65+
"logs": [
66+
67+
],
3868
"workspace": "community/showcase"
3969
}
4070
]
4171
],
4272
"meta": {
4373
"nf-test": "0.9.2",
44-
"nextflow": "25.01.0"
74+
"nextflow": "24.10.4"
4575
},
46-
"timestamp": "2025-02-26T16:10:24.54507716"
76+
"timestamp": "2025-04-19T22:12:59.208411"
4777
}
4878
}

tests/.nftignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ multiqc/multiqc_report.html
1010
nf-core_*/gantt/*_gantt.html
1111
pipeline_info/*.{html,json,txt,yml}
1212
**/runs_dump/**/service-info.json
13+
benchmark_report/benchmark_report.html

tests/main.nf.test

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,39 @@ nextflow_pipeline {
1313
}
1414
}
1515

16+
then {
17+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
18+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
19+
// stable_path: All files in ${params.outdir}/ with stable content
20+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
21+
assertAll(
22+
{ assert workflow.success},
23+
{ assert snapshot(
24+
// Number of successful tasks
25+
workflow.trace.succeeded().size(),
26+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
27+
removeNextflowVersion("$outputDir/pipeline_info/collated_software_mqc_versions.yml"),
28+
// All stable path name, with a relative path
29+
stable_name,
30+
// All files with stable contents
31+
stable_path
32+
).match() }
33+
)
34+
}
35+
}
36+
37+
test("-profile test_benchmark") {
38+
39+
when {
40+
params {
41+
input = "${projectDir}/workflows/nf_aggregate/assets/test_benchmark.csv"
42+
outdir = "$outputDir"
43+
generate_benchmark_report = true
44+
skip_run_gantt = true
45+
skip_multiqc = true
46+
}
47+
}
48+
1649
then {
1750
// stable_name: All files + folders in ${params.outdir}/ with a stable name
1851
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])

0 commit comments

Comments
 (0)