Many thanks to Wei Yang for creating and documenting use of the container.
Singularity image files:
- /gpfs/slac/fermi/fs2/software/containers/slac-fermi.img.ext3
- This is an old, tested image
- /gpfs/slac/fermi/fs2/software/containers/fermi-centos6.20230314.sif
- on s3df, these containers can be found in: /sdf/group/fermi/sw/containers/
- They are available on both the AFS side and SDF side. You can copy them to other locations
- Instructions for how to build the container are in: /gpfs/slac/fermi/fs2/software/containers/fermi-rhel6.build.txt
How to run Singularity container from rhel6-64, centos7 and sdf-login:
- export myimage=/gpfs/slac/fermi/fs2/software/containers/slac-fermi.img.ext3
- or use the new image file:
- export myimage=/gpfs/slac/fermi/fs2/software/containers/fermi-centos6.sif
- Go inside the container:
- singularity shell -B /afs:/afs -B /gpfs:/gpfs $myimage
- By default, the prompt is changed to “Singularity> “. You are now in a shell and can do “ls”, “cd”, etc.
- If you run command “id”, you will see you are running as yourself.
- Run a command in the container:
- singularity exec -B /afs:/afs -B /gpfs:/gpfs $myimage ls -l /afs
- singularity exec -B /afs:/afs -B /gpfs:/gpfs $myimage sh /afs/slac/myscript.sh
- The above is usually used in batch jobs.
- “-B /afs:/afs” means bind mount (make /afs available inside the container, as path /afs)
- Bind mount may not work well when running singularity on rhel6-64 machines, especially when autofs path (e.g. /nfs) is involved
- By default, /tmp and your working directories are bind mounted.
- on centos7, you can also bind mount nfs similarly.
For S3DF:
- export myimage=/sdf/group/fermi/sw/containers//fermi-rhel6.sif. That is symlinked to the "prod" container in that directory.
- Go inside the container:
- singularity shell -B /sdf $myimage
- By default, the prompt is changed to “Singularity> “. You are now in a shell and can do “ls”, “cd”, etc.
- If you run command “id”, you will see you are running as yourself.
- if you need to see SDF filesystems (Lustre), add -B /fs/ddn/sdf
- Run a command in the container:
- singularity exec -B /sdf $myimage ls -l
- singularity exec -B /sdf $myimage sh myscript.sh
- The above is usually used in batch jobs.
- to work on the scratch space in batch, add -B /lscratch
- if you need to see SDF filesystems (Lustre), add -B /fs/ddn/sdf
page for collecting questions/issues and answers