Skip to content

Commit 4f766b8

Browse files
authored
Merge pull request #127 from seqeralabs/cursor/open-prs-dev-alignment-6d6c
fix(ci): restore lint workflow on dev; document private CA for Platform
2 parents 71b00d7 + cfa47bf commit 4f766b8

18 files changed

Lines changed: 92 additions & 85 deletions

File tree

.github/workflows/linting.yml

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
name: nf-core linting
2-
# This workflow is triggered on pushes and PRs to the repository.
3-
# It runs the `nf-core pipelines lint` and markdown lint tests to ensure
4-
# that the code meets the nf-core guidelines.
1+
name: Pipeline linting
2+
# Runs pre-commit (Prettier, editorconfig, etc.) on pushes to dev and on pull requests.
53
on:
64
push:
75
branches:
@@ -26,58 +24,3 @@ jobs:
2624

2725
- name: Run pre-commit
2826
run: pre-commit run --all-files
29-
30-
nf-core:
31-
runs-on: ubuntu-latest
32-
steps:
33-
- name: Check out pipeline code
34-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
35-
36-
- name: Install Nextflow
37-
uses: nf-core/setup-nextflow@v2
38-
39-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
40-
with:
41-
python-version: "3.12"
42-
architecture: "x64"
43-
44-
- name: read .nf-core.yml
45-
uses: pietrobolcato/action-read-yaml@1.1.0
46-
id: read_yml
47-
with:
48-
config: ${{ github.workspace }}/.nf-core.yml
49-
50-
- name: Install dependencies
51-
run: |
52-
python -m pip install --upgrade pip
53-
pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }}
54-
55-
- name: Run nf-core pipelines lint
56-
if: ${{ github.base_ref != 'master' }}
57-
env:
58-
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-
GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }}
61-
run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md
62-
63-
- name: Run nf-core pipelines lint --release
64-
if: ${{ github.base_ref == 'master' }}
65-
env:
66-
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }}
69-
run: nf-core -l lint_log.txt pipelines lint --release --dir ${GITHUB_WORKSPACE} --markdown lint_results.md
70-
71-
- name: Save PR number
72-
if: ${{ always() }}
73-
run: echo ${{ github.event.pull_request.number }} > PR_number.txt
74-
75-
- name: Upload linting log file artifact
76-
if: ${{ always() }}
77-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
78-
with:
79-
name: linting-logs
80-
path: |
81-
lint_log.txt
82-
lint_results.md
83-
PR_number.txt

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ testing/
77
testing*
88
*.pyc
99
bin/
10+
# Large single-line fixture JSON (Prettier would expand to thousands of lines)
11+
workflows/nf_aggregate/assets/log_dirs/**/*.json

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ uv run --with typer --with pyyaml \
6666

6767
### Services overview
6868

69-
| Service | Purpose | Run command |
70-
|---------|---------|-------------|
71-
| Nextflow pipeline | Core product — aggregates metrics from Seqera Platform runs | `nextflow run . --input <csv> --outdir results -profile docker` |
72-
| Python benchmark_report.py | Normalizes JSON -> JSONL, aggregates report data, then renders HTML | See "Rebuild Command" section above |
69+
| Service | Purpose | Run command |
70+
| -------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------- |
71+
| Nextflow pipeline | Core product — aggregates metrics from Seqera Platform runs | `nextflow run . --input <csv> --outdir results -profile docker` |
72+
| Python benchmark_report.py | Normalizes JSON -> JSONL, aggregates report data, then renders HTML | See "Rebuild Command" section above |
7373

7474
### Running tests
7575

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The pipeline fetches run data from the Seqera Platform API and generates benchma
1919

2020
- [Nextflow](https://www.nextflow.io/docs/latest/getstarted.html#installation) >=25.10.0
2121
- Account in [Seqera Platform](https://seqera.io/platform/)
22-
- [Access token](https://docs.seqera.io/platform/23.3.0/api/overview#authentication) which is your personal authorization token for the Seqera Platform CLI. This can be created in the user menu under **Your tokens**. Export the token as a shell variable directly into your terminal if running the pipelie locally. You will not need to set this if running the pipeline within the Seqera Platform as it will automatically be inherited from the executing environment.
22+
- [Access token](https://docs.seqera.io/platform/23.3.0/api/overview#authentication) which is your personal authorization token for the Seqera Platform CLI. This can be created in the user menu under **Your tokens**. Export the token as a shell variable directly into your terminal if running the pipeline locally. You will not need to set this if running the pipeline within the Seqera Platform as it will automatically be inherited from the executing environment.
2323

2424
```bash
2525
export TOWER_ACCESS_TOKEN=<your access token>
@@ -46,7 +46,25 @@ nextflow run seqeralabs/nf-aggregate \
4646
-profile docker
4747
```
4848

49-
If you are using a Seqera Platform Enterprise instance that is secured with a private CA SSL certificate not recognized by default Java certificate authorities, you can specify a custom `cacerts` store path through the `--java_truststore_path` parameter and optionally, a password with the `--java_truststore_password`. This certificate will be used to achieve connectivity with your Seqera Platform instance through API and CLI.
49+
If you are using a Seqera Platform Enterprise instance that is secured with a private CA SSL certificate not recognized by default Java certificate authorities, you can specify a custom `cacerts` store path through the `--java_truststore_path` parameter and optionally, a password with the `--java_truststore_password`. This configures the Nextflow JVM used for Seqera Platform API access (see `lib/SeqeraApi.groovy`).
50+
51+
### Seqera Platform Enterprise with a private CA (containers)
52+
53+
For API access from Nextflow, `--java_truststore_path` / `--java_truststore_password` are usually sufficient. Task containers may still lack your private CA when they open TLS connections. As a workaround, add the following under **Advanced options → Nextflow config** in Seqera Platform (replace `tower-server-url` with your Seqera host name only, without `https://`):
54+
55+
```groovy
56+
process {
57+
withName: /NORMALIZE_BENCHMARK_JSONL|AGGREGATE_BENCHMARK_REPORT_DATA|RENDER_BENCHMARK_REPORT|EXTRACT_TARBALL/ {
58+
beforeScript = '''
59+
keytool -printcert -rfc -sslserver tower-server-url:443 > PRIVATE_CERT.pem
60+
keytool -importcert -alias seqera-ca -file PRIVATE_CERT.pem -keystore truststore.jks -storepass changeit -noprompt
61+
export JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=$(pwd)/truststore.jks -Djavax.net.ssl.trustStorePassword=changeit"
62+
'''
63+
}
64+
}
65+
```
66+
67+
This downloads the server certificate, builds a small JKS truststore in the task work directory, and points the JVM inside the task at it.
5068

5169
### Benchmark reports
5270

docs/DESIGN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ python bin/benchmark_report.py normalize-jsonl --data-dir <run_json_dir> --outpu
3636
```
3737

3838
Responsibilities:
39+
3940
- read run JSON payloads
4041
- normalize runs/tasks/metrics rows
4142
- optionally normalize CUR parquet into `costs.jsonl`
@@ -54,6 +55,7 @@ python bin/benchmark_report.py aggregate-report-data --jsonl-dir <jsonl_bundle>
5455
```
5556

5657
Responsibilities:
58+
5759
- stream JSONL rows
5860
- compute report sections:
5961
- `benchmark_overview`
@@ -75,13 +77,15 @@ python bin/benchmark_report.py render-html --data <report_data.json> --output <b
7577
```
7678

7779
Responsibilities:
80+
7881
- load report JSON
7982
- apply brand/logo overrides when provided
8083
- render self-contained HTML from the Jinja template
8184

8285
## Benchmark CLI surface
8386

8487
`bin/benchmark_report.py` provides:
88+
8589
- `normalize-jsonl`
8690
- `aggregate-report-data`
8791
- `render-html`

main.nf

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,9 @@
1313
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1414
*/
1515

16-
include { NF_AGGREGATE } from './workflows/nf_aggregate'
17-
include {
18-
checkCondaChannels ;
19-
dumpParametersToJSON ;
20-
getWorkflowVersion
21-
} from 'plugin/nf-core-utils'
22-
include {
23-
paramsSummaryLog ;
24-
samplesheetToList ;
25-
validateParameters
26-
} from 'plugin/nf-schema'
16+
include { NF_AGGREGATE } from './workflows/nf_aggregate'
17+
include { checkCondaChannels ; dumpParametersToJSON ; getWorkflowVersion } from 'plugin/nf-core-utils'
18+
include { paramsSummaryLog ; samplesheetToList ; validateParameters } from 'plugin/nf-schema'
2719

2820
/*
2921
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

modules/local/AGENTS.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
Each module should keep one clear responsibility and its own terse `AGENTS.md`.
44

5-
| Module | Status | Purpose |
6-
| --------------------------------------- | ---------- | ---------------------------------------------- |
7-
| `normalize_benchmark_jsonl/` | **active** | Raw run JSON (+ optional CUR parquet) → JSONL |
8-
| `aggregate_benchmark_report_data/` | **active** | JSONL bundle → `report_data.json` |
9-
| `render_benchmark_report/` | **active** | `report_data.json` + branding → HTML |
10-
| `extract_tarball/` | active | Extract run-data tarballs for external runs |
5+
| Module | Status | Purpose |
6+
| ---------------------------------- | ---------- | --------------------------------------------- |
7+
| `normalize_benchmark_jsonl/` | **active** | Raw run JSON (+ optional CUR parquet) → JSONL |
8+
| `aggregate_benchmark_report_data/` | **active** | JSONL bundle → `report_data.json` |
9+
| `render_benchmark_report/` | **active** | `report_data.json` + branding → HTML |
10+
| `extract_tarball/` | active | Extract run-data tarballs for external runs |
1111

1212
Testing
13+
1314
- Keep stage-specific pytest tests beside the module under `tests/`.
1415
- Keep pipeline routing/integration scenarios under top-level `tests/`.

modules/local/aggregate_benchmark_report_data/AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
# aggregate_benchmark_report_data
22

33
Purpose
4+
45
- Convert the JSONL bundle into a single `report_data.json` document for rendering.
56

67
Owns
8+
79
- `AGGREGATE_BENCHMARK_REPORT_DATA` in `main.nf`
810
- Python aggregation logic in `bin/benchmark_report_aggregate.py`
911
- Stage-scoped tests under `tests/`
1012

1113
Inputs
14+
1215
- `jsonl_bundle/` from `normalize_benchmark_jsonl`
1316

1417
Outputs
18+
1519
- `report_data.json`
1620
- `versions.yml`
1721

1822
Invariants
23+
1924
- This is the boundary between streaming records and presentation data.
2025
- Prefer streaming iteration over JSONL inputs; avoid full-file eager loads unless clearly bounded.
2126
- Cost joins must key by `(run_id, process, hash)` to avoid cross-process collisions.
@@ -31,8 +36,10 @@ Invariants
3136
- `cost_overview`
3237

3338
Edit guidance
39+
3440
- Keep rendering/template logic out of this stage.
3541
- If output schema changes, update render tests and any HTML assertions.
3642

3743
Tests
44+
3845
- `pytest modules/local/aggregate_benchmark_report_data/tests/test_aggregate.py -q`
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
# extract_tarball
22

33
Purpose
4+
45
- Extract external run-data tarballs into directories of JSON artifacts.
56

67
Owns
8+
79
- `EXTRACT_TARBALL` in `main.nf`
810

911
Inputs
12+
1013
- external tarball paths from the workflow routing layer
1114

1215
Outputs
16+
1317
- extracted directory per tarball
1418
- `versions.yml`
1519

1620
Invariants
21+
1722
- Extraction only. Do not mix benchmark parsing or aggregation into this module.
1823
- Downstream workflow code is responsible for collecting JSON files from extracted directories.
1924

2025
Edit guidance
26+
2127
- If tarball layout assumptions change, update the pipeline tarball scenario tests.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,43 @@
11
# normalize_benchmark_jsonl
22

33
Purpose
4+
45
- Normalize collected run JSON into a stream-friendly `jsonl_bundle/`.
56

67
Owns
8+
79
- `NORMALIZE_BENCHMARK_JSONL` in `main.nf`
810
- Python stage logic in `bin/benchmark_report_normalize.py`
911
- Stage-scoped tests under `tests/`
1012

1113
Inputs
14+
1215
- `data_dir/` of per-run JSON payloads
1316
- optional CUR parquet
1417

1518
Outputs
19+
1620
- `jsonl_bundle/runs.jsonl`
1721
- `jsonl_bundle/tasks.jsonl`
1822
- `jsonl_bundle/metrics.jsonl`
1923
- optional `jsonl_bundle/costs.jsonl`
2024
- `versions.yml`
2125

2226
Invariants
27+
2328
- JSONL is the handoff format for Fusion-friendly streaming.
2429
- One JSON object per line.
2530
- Task rows should already include derived fields needed downstream (`process_short`, `wait_ms`, `staging_ms`).
2631
- Failed tasks are filtered here so downstream stages stay simple.
2732

2833
Edit guidance
34+
2935
- Keep this stage about normalization only; no report aggregation or HTML concerns.
3036
- If you change row shape, update:
3137
- `bin/benchmark_report_normalize.py`
3238
- `modules/local/aggregate_benchmark_report_data/tests/test_aggregate.py`
3339
- any CLI compatibility tests affected
3440

3541
Tests
42+
3643
- `pytest modules/local/normalize_benchmark_jsonl/tests/test_normalize.py -q`

0 commit comments

Comments
 (0)