Skip to content

Commit

Permalink
Adding step to ensure tmp dir bind path resolves correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
skchronicles committed Sep 21, 2022
1 parent 0765be5 commit 61318fa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,15 @@ def runner(mode, outdir, alt_cache, logger, additional_bind_paths = None,
# Add any default PATHs to bind to
# the container's filesystem, like
# tmp directories, /lscratch
bindpaths = "{},{}".format(outdir, os.path.dirname(tmp_dir.rstrip('/')))
addpaths = []
temp = os.path.dirname(tmp_dir.rstrip('/'))
if temp == os.sep:
temp = tmp_dir.rstrip('/')
if outdir not in additional_bind_paths:
addpaths.append(outdir)
if temp not in additional_bind_paths:
addpaths.append(temp)
bindpaths = ','.join(addpaths)
# Set ENV variable 'SINGULARITY_CACHEDIR'
# to output directory
my_env = {}; my_env.update(os.environ)
Expand All @@ -681,7 +689,9 @@ def runner(mode, outdir, alt_cache, logger, additional_bind_paths = None,

if additional_bind_paths:
# Add Bind PATHs for rawdata directories
bindpaths = "{},{}".format(additional_bind_paths,bindpaths)
if bindpaths:
bindpaths = ",{}".format(bindpaths)
bindpaths = "{}{}".format(additional_bind_paths,bindpaths)

if not exists(os.path.join(outdir, 'logfiles')):
# Create directory for logfiles
Expand Down

0 comments on commit 61318fa

Please sign in to comment.