Skip to content

Commit

Permalink
fix to get it working with sbatch
Browse files Browse the repository at this point in the history
the path we were giving to sbatch for the location of its output and
error logs was the singularity-internal one, so it was throwing an
error. to fix that, bind DATA_DIR to the same location in the
container, so the paths are identical. do the same thing for
WORKING_DIR
  • Loading branch information
Billy Broderick committed Oct 26, 2021
1 parent 73cc13b commit 9f897c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions run_singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,13 @@ def main(image, args=[], software='singularity', sudo=False):
f'{config["MATLAB_PATH"]}:/home/sfp_user/matlab',
f'{config["FREESURFER_HOME"]}:/home/sfp_user/freesurfer',
f'{config["FSLDIR"]}:/home/sfp_user/fsl',
f'{config["DATA_DIR"]}:/home/sfp_user/sfp_data',
f'{config["DATA_DIR"]}:{config["DATA_DIR"]}',
f'{config["WORKING_DIR"]}:{config["WORKING_DIR"]}'
]
volumes = check_bind_paths(volumes)
# join puts --bind between each of the volumes, we also need it in the
# beginning
volumes = '--bind ' + " --bind ".join(volumes)
# make sure we use the image-internal data directory
if any([config['DATA_DIR'] in a for a in args]):
args = [a.replace(config['DATA_DIR'], '/home/sfp_user/sfp_data') for a in args]
# if the user is passing a snakemake command, need to pass
# --configfile /home/sfp_user/sfp_config.json, since we modify the config
# file when we source singularity_env.sh
Expand Down

0 comments on commit 9f897c4

Please sign in to comment.