Skip to content

Apptainer

Apptainer is a container system for secure high performance computing. See its home page here: https://apptainer.org Do have a read of their “Introduction to Apptainer” here https://apptainer.org/docs/user/latest/introduction.html. as it has a good explaination of how containers are useful for scientific research.

Note

This used to be called “Singularity”. In 2022 they changed the name to “Apptainer”. On the HPC the executable /usr/bin/singularity is now a symlink to /usr/bin/apptainer.

I have installed the last version of “singularity” under /shared/opt/singularity-3.10.3/. You might need this if your application thinks that the “aptainer” version is too low.

The current HPC Apptainer version can be found by running the command: apptainer version

Often on a HPC we can’t install a later version of a package as it might conflict with the requirements of other packages in the system. However, we can bundle an application, plus whatever libraries it requires to run, into a “container image”. This “container image” also contains any operating system stuff that is needed to run the application. It’s just a single big file that is a snapshot containing everything that we need. This container then be “run” and it will not conflict with the HPC software or libraries. From now on we will just refer to it as a “container”.

We can download an existing container and run an application(s) within that container or we can build our own container and install into that our own applications, plus whatever libraries they require to run.

In this short guide we will first run some short apps from a container, then we will build our own container containing some applications.

Although we will be using the “apptainer” format, this tutorial will be applicable to the “singularity” format. The Singularity Community Edition is still available and its documentation is here: https://docs.sylabs.io/guides/latest/user-guide/

Finally, there are several container formats and applications that run containers, such as Docker and Virtual Box.