Skip to content

Commit 7492121

Browse files
authored
Merge branch 'main' into feature/coassembly-schema
2 parents a96c5da + a04bf1e commit 7492121

File tree

7 files changed

+49
-30
lines changed

7 files changed

+49
-30
lines changed

deployment/ebi-wp-k8s-hl/Taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ tasks:
2626
cmds:
2727
- kubectl --context=emgapiv2-hl-exp exec -it $(task get-api-pod-name) -- python manage.py prefectcli deploy {{ .FILE | default (list "workflows/flows/" .FLOW ".py" | join "") }}:{{.FLOW}} --name {{.FLOW}}_deployment -p {{.POOL}} --prefect-file workflows/prefect_deployments/prefect-ebi-codon.yaml
2828
vars:
29-
POOL: "slurm_2"
29+
POOL: "slurm"
3030
requires:
3131
vars: [FLOW]
3232

deployment/ebi-wp-k8s-hl/start_prefect_slurm_worker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ source /nfs/production/rdf/metagenomics/jenkins-slurm/dev-prefect-agent/deployme
99
source /nfs/production/rdf/metagenomics/jenkins-slurm/dev-prefect-agent/venv/bin/activate
1010

1111
cd /nfs/production/rdf/metagenomics/jenkins-slurm/dev-prefect-agent/
12-
python manage.py prefectcli worker start --type "slurm" --pool "slurm_2" >> /nfs/production/rdf/metagenomics/jenkins-slurm/logs/dev-prefect-slurm-worker.log 2>&1 &
12+
python manage.py prefectcli worker start --type "slurm" --pool "slurm" >> /nfs/production/rdf/metagenomics/jenkins-slurm/logs/dev-prefect-slurm-worker.log 2>&1 &
1313

1414
echo $! > "${DJANGOPIDFILE}"

workflows/flows/analyse_study_tasks/raw_reads/run_rawreads_pipeline_via_samplesheet.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ def run_rawreads_pipeline_via_samplesheet(
4747
):
4848
if workdir is None:
4949
workdir = (
50-
Path(f"{EMG_CONFIG.slurm.default_nextflow_workdir}")
51-
/ Path(f"{mgnify_study.ena_study.accession}")
52-
/ f"{EMG_CONFIG.rawreads_pipeline.pipeline_name}_{EMG_CONFIG.amplicon_pipeline.pipeline_version}"
50+
Path(EMG_CONFIG.slurm.default_nextflow_workdir)
51+
/ mgnify_study.ena_study.accession
52+
/ f"{EMG_CONFIG.rawreads_pipeline.pipeline_name}_{EMG_CONFIG.rawreads_pipeline.pipeline_version}"
5353
)
5454
if outdir is None:
5555
outdir = (
56-
Path(f"{EMG_CONFIG.slurm.default_workdir}")
57-
/ Path(f"{mgnify_study.ena_study.accession}")
58-
/ f"{EMG_CONFIG.rawreads_pipeline.pipeline_name}_{EMG_CONFIG.amplicon_pipeline.pipeline_version}"
56+
Path(EMG_CONFIG.slurm.default_workdir)
57+
/ mgnify_study.ena_study.accession
58+
/ f"{EMG_CONFIG.rawreads_pipeline.pipeline_name}_{EMG_CONFIG.rawreads_pipeline.pipeline_version}"
5959
)
6060

6161
rawreads_analyses = analyses.models.Analysis.objects.select_related("run").filter(

workflows/flows/analysis/assembly/flows/run_assembly_analysis_pipeline_batch.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ def run_assembly_analysis_pipeline_batch(
142142
)
143143
nextflow_workdir.mkdir(parents=True, exist_ok=True)
144144

145+
nextflow_workdir = (
146+
Path(EMG_CONFIG.slurm.default_nextflow_workdir)
147+
/ mgnify_study.ena_study.accession
148+
/ f"{EMG_CONFIG.assembly_analysis_pipeline.pipeline_name}_{EMG_CONFIG.assembly_analysis_pipeline.pipeline_version}"
149+
/ f"{assembly_analysis_batch.id}"
150+
)
151+
nextflow_workdir.mkdir(parents=True, exist_ok=True)
152+
145153
command = cli_command(
146154
[
147155
(
@@ -163,12 +171,6 @@ def run_assembly_analysis_pipeline_batch(
163171
EMG_CONFIG.assembly_analysis_pipeline.pipeline_nf_profile,
164172
),
165173
"-resume",
166-
(
167-
"-work-dir",
168-
Path(EMG_CONFIG.assembly_analysis_pipeline.workdir_root)
169-
/ mgnify_study.first_accession
170-
/ "asa",
171-
),
172174
EMG_CONFIG.assembly_analysis_pipeline.has_fire_access
173175
and "--use_fire_download",
174176
("--input", samplesheet),

workflows/flows/analysis/assembly/flows/run_map_batch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from datetime import timedelta
33
from pathlib import Path
44

5-
from django.utils.text import slugify
65
from django.db import close_old_connections
76
from django.db.models import Q
87
from prefect import flow, get_run_logger
@@ -151,9 +150,10 @@ def run_map_batch(assembly_analyses_batch_id: uuid.UUID):
151150
logger.info(f"Using output dir {map_outdir} for MAP pipeline")
152151

153152
nextflow_workdir = (
154-
Path(assembly_analysis_batch.workspace_dir)
155-
/ "map"
156-
/ f"map-sheet-{slugify(map_samplesheet_path)}"
153+
Path(EMG_CONFIG.slurm.default_nextflow_workdir)
154+
/ mgnify_study.ena_study.accession
155+
/ f"{EMG_CONFIG.map_pipeline.pipeline_name}_{EMG_CONFIG.map_pipeline.pipeline_version}"
156+
/ f"{assembly_analysis_batch.id}"
157157
)
158158
nextflow_workdir.mkdir(parents=True, exist_ok=True)
159159

workflows/flows/analysis/assembly/flows/run_virify_batch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from datetime import timedelta
33
from pathlib import Path
44

5-
from django.utils.text import slugify
65
from django.db import close_old_connections
76
from prefect import flow, get_run_logger
87
from prefect.runtime import flow_run
@@ -137,9 +136,10 @@ def run_virify_batch(assembly_analyses_batch_id: uuid.UUID):
137136
logger.info(f"Using output dir {virify_outdir} for VIRify pipeline")
138137

139138
nextflow_workdir = (
140-
Path(assembly_analysis_batch.workspace_dir)
141-
/ "virify"
142-
/ f"virify-sheet-{slugify(virify_samplesheet_path)}"
139+
Path(EMG_CONFIG.slurm.default_nextflow_workdir)
140+
/ mgnify_study.ena_study.accession
141+
/ f"{EMG_CONFIG.virify_pipeline.pipeline_name}_{EMG_CONFIG.virify_pipeline.pipeline_version}"
142+
/ f"{assembly_analysis_batch.id}"
143143
)
144144
nextflow_workdir.mkdir(parents=True, exist_ok=True)
145145

workflows/prefect_deployments/prefect-ebi-codon.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ deployments:
3636
entrypoint: workflows/flows/analysis/assembly/flows/analysis_assembly_study.py:analysis_assembly_study
3737
schedule: null
3838
work_pool:
39-
name: slurm_2
39+
name: slurm
4040

4141
- name: run_assembly_analysis_pipeline_batch_deployment
4242
description: |-
@@ -60,7 +60,7 @@ deployments:
6060
entrypoint: workflows/flows/analysis/assembly/flows/run_assembly_analysis_pipeline_batch.py:run_assembly_analysis_pipeline_batch
6161
schedule: null
6262
work_pool:
63-
name: slurm_2
63+
name: slurm
6464

6565
- name: run_virify_batch_deployment
6666
description: |-
@@ -82,7 +82,7 @@ deployments:
8282
entrypoint: workflows/flows/analysis/assembly/flows/run_virify_batch.py:run_virify_batch
8383
schedule: null
8484
work_pool:
85-
name: slurm_2
85+
name: slurm
8686

8787
- name: run_map_batch_deployment
8888
description: |-
@@ -104,7 +104,7 @@ deployments:
104104
entrypoint: workflows/flows/analysis/assembly/flows/run_map_batch.py:run_map_batch
105105
schedule: null
106106
work_pool:
107-
name: slurm_2
107+
name: slurm
108108

109109
- name: import_asa_batch_deployment
110110
description: |-
@@ -117,7 +117,7 @@ deployments:
117117
entrypoint: workflows/flows/analysis/assembly/flows/import_asa_batch.py:import_asa_batch
118118
schedule: null
119119
work_pool:
120-
name: slurm_2
120+
name: slurm
121121

122122
- name: import_virify_batch_deployment
123123
description: |-
@@ -127,7 +127,7 @@ deployments:
127127
entrypoint: workflows/flows/analysis/assembly/flows/import_virify_batch.py:import_virify_batch
128128
schedule: null
129129
work_pool:
130-
name: slurm_2
130+
name: slurm
131131

132132
- name: import_map_batch_deployment
133133
description: |-
@@ -137,7 +137,7 @@ deployments:
137137
entrypoint: workflows/flows/analysis/assembly/flows/import_map_batch.py:import_map_batch
138138
schedule: null
139139
work_pool:
140-
name: slurm_2
140+
name: slurm
141141

142142
- name: finalize_assembly_study_deployment
143143
description: |-
@@ -159,4 +159,21 @@ deployments:
159159
:type study_accession: str
160160
entrypoint: workflows/flows/analysis/assembly/flows/finalize_assembly_study.py:finalize_assembly_study
161161
work_pool:
162-
name: slurm_2
162+
name: slurm
163+
164+
- name: nextflow_trace_etl_flow
165+
description: |-
166+
Nextflow Trace extraction and transformation flow.
167+
168+
This flow orchestrates the extraction and transformation of Nextflow trace data
169+
from OrchestratedClusterJob models.
170+
171+
:param sqlite_db_path: Path to the SQLite database where the transformed data will be stored
172+
:param batch_size: Number of database records to process at once
173+
:param min_created_at: Only process jobs created after this datetime
174+
:param max_created_at: Only process jobs created before this datetime
175+
:param only_completed: Only process completed jobs
176+
:param exclude_failed: Exclude failed jobs
177+
entrypoint: workflows/flows/nf_traces/flows.py:nextflow_trace_etl_flow
178+
work_pool:
179+
name: slurm

0 commit comments

Comments
 (0)