Skip to content

Instantly share code, notes, and snippets.

@ChristinaLK
Last active April 28, 2019 12:57
Show Gist options
  • Save ChristinaLK/3e147f940cd02513c4cdc7c4b04ccfed to your computer and use it in GitHub Desktop.
Save ChristinaLK/3e147f940cd02513c4cdc7c4b04ccfed to your computer and use it in GitHub Desktop.
Using singularity image to run jobs in CHTC
#!/bin/bash
img=$1
exec=$2
shift 2
args=$*
singularity exec -B $_CONDOR_SCRATCH_DIR:/scratch $img /scratch/$exec $args
universe = vanilla
log = $(Cluster)_$(Process).log
error = $(Cluster)_$(Process).err
output = $(Cluster)_$(Process).out
executable = run.singularity.sh
arguments = ubuntu.img hello.sh $(Cluster) $(Process)
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = ubuntu.img, hello.sh
requirements = HasSingularity == true && OpSysMajorVer == 7
request_cpus = 1
request_memory = 1GB
#increase disk request based on size of your image!
request_disk = 2GB
queue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment