Skip to content

Instantly share code, notes, and snippets.

@tcooper
Created November 30, 2017 01:23
Show Gist options
  • Save tcooper/0f025030a8805390e6b4518f386e2656 to your computer and use it in GitHub Desktop.
Save tcooper/0f025030a8805390e6b4518f386e2656 to your computer and use it in GitHub Desktop.
Example Singularity image with help for binding to typical HPC data directories on Comet
Bootstrap: docker
From: python:2.7.13
%help
This container creates internal directories to bind HPC system locations to as
follows...
/pfs_data - The location of your high performance parallel file system data
/pfs_scratch - The location of your high performance parallel file system scratch
/local_scratch - The location of you node-local scratch
Assuming the following ENV vars exist as would typically be the case in a Slurm
batch job on Comet...
SLURM_JOB_USER, SLURM_JOB_ACCOUNT, SLURM_JOB_ID
You would run this container inside your Slurm job on Comet with...
$ singularity shell \
--bind /oasis/projects/nsf/$SLURM_JOB_ACCOUNT/$SLURM_JOB_USER:/pfs_data \
--bind /oasis/scratch/comet/$SLURM_JOB_USER/temp_project:/pfs_scratch
--bind /scratch/$SLURM_JOB_USER/$SLURM_JOB_ID:/local_scratch
<container_img> $OPTS
%labels
Maintainer HPCDevOps
Version v1.0
%post
# Creating Comet compatible mount points
mkdir -p /pfs_data /pfs_scratch /local_scratch
%test
python --version
/bin/ls /pfs_data /pfs_scratch /local_scratch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment