...
How to run Singularity container from rhel6-64, centos7 and sdf-login:
- export myimage=/gpfs/slac/atlasfermi/fs1fs2/swsoftware/singularitycontainers/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.
...