From 59ad63c5f6a1fd68a45ad4ce235284338c95a83c Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Mon, 26 Aug 2024 12:24:24 -0400 Subject: [PATCH] refactor: allow future user override of sing cachedir location --- src/ccbr_tools/pipeline/hpc.py | 2 +- src/ccbr_tools/pipeline/nextflow.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ccbr_tools/pipeline/hpc.py b/src/ccbr_tools/pipeline/hpc.py index b05ad81..54308d8 100644 --- a/src/ccbr_tools/pipeline/hpc.py +++ b/src/ccbr_tools/pipeline/hpc.py @@ -40,7 +40,7 @@ def __init__(self): self.env_vars = "\n".join( ( self.env_vars, - f"export PATH=${{PATH}}:/mnt/projects/CCBR-Pipelines/bin", + "export PATH=${PATH}:/mnt/projects/CCBR-Pipelines/bin", ) ) diff --git a/src/ccbr_tools/pipeline/nextflow.py b/src/ccbr_tools/pipeline/nextflow.py index ffc00f7..733be97 100644 --- a/src/ccbr_tools/pipeline/nextflow.py +++ b/src/ccbr_tools/pipeline/nextflow.py @@ -76,7 +76,12 @@ def run( "submit_slurm.sh", PIPELINE=pipeline_name if pipeline_name else "CCBR_nxf", MODULES=hpc.modules, - ENV_VARS=hpc.env_vars, + ENV_VARS="\n".join( + ( + hpc.env_vars, + f"export SINGULARITY_CACHEDIR={get_singularity_cachedir()}", + ) + ), # TODO allow user override of singularity cache dir with CLI RUN_COMMAND=nextflow_command, ) run_command = f"sbatch {slurm_filename}"