You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »


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.sif
    • This is a new, untested image
  • 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:

  1. export myimage=/gpfs/slac/fermi/fs2/software/containers/slac-fermi.img.ext3
    1. or use the new image file:
    2. export myimage=/gpfs/slac/fermi/fs2/software/containers/fermi-centos6.sif
  2. Go inside the container:
    1. singularity shell -B /afs:/afs -B /gpfs:/gpfs $myimage
    2. By default, the prompt is changed to “Singularity> “. You are now in a shell and can do “ls”, “cd”, etc. 
    3. If you run command “id”, you will see you are running as yourself.
  3. Run a command in the container:
    1. singularity exec -B /afs:/afs -B /gpfs:/gpfs $myimage ls -l /afs
    2. singularity exec -B /afs:/afs -B /gpfs:/gpfs $myimage sh /afs/slac/myscript.sh
    3. The above is usually used in batch jobs.
  4. “-B /afs:/afs” means bind mount (make /afs available inside the container, as path /afs)
    1. Bind mount may not work well when running singularity on rhel6-64 machines, especially when autofs path (e.g. /nfs) is involved 
    2. By default, /tmp and your working directories are bind mounted.
    3. on centos7, you can also bind mount nfs similarly.


page for collecting questions/issues and answers

  • No labels