diff --git a/profiles/slurm-conda/config.yaml b/profiles/slurm-conda/config.yaml index 2fb09692eb55b9db38d4a286bc603d6742a1c6b0..dcf097604a0ff1cdb2a32f24eec2f347a196a342 100644 --- a/profiles/slurm-conda/config.yaml +++ b/profiles/slurm-conda/config.yaml @@ -1,6 +1,7 @@ jobscript: "../slurm-jobscript.sh" cluster: "../slurm-submit.py" cluster-status: "../slurm-status.py" +config: "cluster_logs='logs/cluster'" snakefile: "../../workflow/Snakefile" cores: 256 jobs: 256 diff --git a/profiles/slurm-singularity/config.yaml b/profiles/slurm-singularity/config.yaml index 4fc0a6b90e85ead088aa17db3e950f6eb62f61d3..960bee6e95ca1380d882f7b101ec918d09724879 100644 --- a/profiles/slurm-singularity/config.yaml +++ b/profiles/slurm-singularity/config.yaml @@ -1,6 +1,7 @@ jobscript: "../slurm-jobscript.sh" cluster: "../slurm-submit.py" cluster-status: "../slurm-status.py" +config: "cluster_logs='logs/cluster'" snakefile: "../../workflow/Snakefile" cores: 256 jobs: 256 diff --git a/resources/config_schema.json b/resources/config_schema.json index 1ad78462f661002ea16af05cb95303286069b328..299c43a033d2102d4c96bd8c8dbc33fa66142ec9 100644 --- a/resources/config_schema.json +++ b/resources/config_schema.json @@ -17,6 +17,10 @@ "type": "string", "description": "Path to log directory." }, + "cluster_logs": { + "type": "string", + "description": "Path to cluster log directory." + }, "kallisto_indexes": { "type": "string", "description": "Path to kallisto indexes directory." diff --git a/workflow/Snakefile b/workflow/Snakefile index d5ac1eaa0519c5534a134624d61fbf81b2645c8c..210c07712a609ce638db2ab0cccf928a120d77b6 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -38,11 +38,12 @@ except KeyError: logger.warning(f"No rule config specified: using default values for all tools.") # Create dir for cluster logs, if applicable -if cluster_config: - os.makedirs( - os.path.join( - os.getcwd(), - os.path.dirname(cluster_config['__default__']['out']), +onstart: + if config["cluster_logs"]: + os.makedirs( + os.path.join( + os.getcwd(), + config["cluster_logs"], ), exist_ok=True)