Print
Singularity (https://sylabs.io/singularity/) enables users to have full control of their environment. Singularity containers can be used to package entire scientific workflows, software and libraries, and even data. This means that you don’t have to ask your cluster admin to install anything for you, you can put it in a Singularity container and run.

  • Did you already invest in Docker? The Singularity software can import your Docker images without having Docker installed or being a superuser.
  • Need to share your code? Put it in a Singularity container and your collaborator won’t have to go through the pain of installing missing dependencies.
  • Do you need to run a different operating system entirely? You can “swap out” the operating system on your host for a different one within a Singularity container.
  • As the user, you are in control of the extent to which your container interacts with its host. There can be seamless integration, or little to no communication at all.

For more information about Singularity, please visit: https://sylabs.io/guides/3.10/user-guide/introduction.html

In HPCC, you can use “module” to load Singularity into your environment.

module add singularity/3.10.0

Build a Container

If you want to build your own container, you can create it in your own computer with root: https://sylabs.io/guides/3.10/user-guide/build_a_container.html

To build a container using a Docker image, you can use “build” command to download an existing container from Docker Hub or NVIDIA NGC:

singularity build software.sif docker://software/software_1.0.sif

ICTO have already built some containers in HPCC. To view the available containers by using the following command:

ll /share/apps/singularity/simg/

Execute Commands

Use the singularity “exec” command to execute a custom command within a container by specifying the image file. The “nv” flag enables NVIDIA GPU support, while the “bind” flag allows you to bind directories from HPCC Coral to the container.

export SIMG=/share/apps/singularity/simg/software/software_1.0.sif
singularity exec --nv --bind /data/home:/data/home,/share:/share,/home:/home,/icto/user:/icto/user ${SIMG} software --help

Interact with Containers

To interact with containers, you can use the singularity “shell” command.

export SIMG=/share/apps/singularity/simg/software/software_1.0.sif
singularity shell --nv --bind /data/home:/data/home,/share:/share,/home:/home,/icto/user:/icto/user ${SIMG}