diff --git a/scripts/config.py b/scripts/config.py index f483dfb..288b9f2 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -4,7 +4,7 @@ import logging from pathlib import Path from os import access as check_access, R_OK -from os.path import expandvars +from os.path import expandvars, expanduser from socket import gethostname from uuid import uuid4 from collections import defaultdict @@ -161,18 +161,11 @@ def get_tmp_dir(host): this_tmp = TMP_CONFIGS[host]['user'] - try: - Path(expandvars(this_tmp)).mkdir(parents=False, exist_ok=True) - except Exception as e: - logging.error("SLURM TMP DIR NOT FOUND: " + traceback.format_exc()) - this_tmp = TMP_CONFIGS[host]['global'] - - try: - Path(expandvars(this_tmp)).mkdir(parents=False, exist_ok=True) - except: - raise OSError(f'TMPDIR does exist and can not be created: "{this_tmp}"') - - return this_tmp + # this directory, if it does not exist, + if Path(this_tmp).parents[0].exists(): + return this_tmp + else: + return TMP_CONFIGS[host]['global'] DIRECTORY_CONFIGS = { diff --git a/scripts/utils.py b/scripts/utils.py index 0d97cd1..3a48f72 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -188,13 +188,6 @@ def get_mods(init=False): def get_mounts(*extras): mount_binds = [] resources = get_resource_config() - slurm_id = os.environ - - if os.environ.get("SLURM_JOB_ID", None): - tmpdir = get_tmp_dir(get_current_server()) - if not Path(os.path.expandvars(tmpdir)).exists(): - Path(tmpdir).mkdir(parents=True, exist_ok=True) - mount_binds.append(str(tmpdir) + ':/tmp:rw') if resources: for this_mount_label, this_mount_attrs in resources['mounts'].items(): @@ -227,6 +220,8 @@ def get_mounts(*extras): raise FileNotFoundError(f"Can't mount {str(bind)}, it doesn't exist!") file_to, file_from, mode = str(bind), str(bind), 'rw' mounts.append(file_from + ':' + file_to + ':' + mode) + + mounts.append('\$TMPDIR:/tmp:rw') return ','.join(mounts) diff --git a/utils b/utils index 54258bf..5722207 160000 --- a/utils +++ b/utils @@ -1 +1 @@ -Subproject commit 54258bf30456dca44251846c068ac9caa90115e5 +Subproject commit 5722207ae6ef07ad6ca59eaa94abafb2af5f0276 diff --git a/workflow/demux.smk b/workflow/demux.smk index 5ffb073..bfad0f3 100644 --- a/workflow/demux.smk +++ b/workflow/demux.smk @@ -36,6 +36,7 @@ rule bcl2fastq: threads: 34 resources: mem_mb = int(64e3), + runtime = 4*60, shell: """ bcl2fastq \ @@ -94,6 +95,7 @@ rule bclconvert: threads: 50 resources: mem_mb = int(64e3), + runtime = 4*60, shell: """ bcl-convert \