Skip to content
NAISS Logo
Allocations Support Training Software naiss.se

Using containers

Apptainer is available on Arrhenius to run and build containers. With apptainer containers you package your software and all of its dependencies into a single file. Making it a good alternative for distributed storage filesystems such as LustreFS which is used for project storage on Arrhenius.

If have a container from previously it is likely it wasn't built for the aarch64 CPU-architecture on the GPU-partition. If you want it for the GPU-partition you will need to rebuild it.

To get the recipe of your existing container you can run the inspect command:

apptainer inspect -d my_container.sif > my_recipe.def

Image locations

Container image files can be large, and should preferably be built automatically from a bootstrap file and updated at regular intervals.

Due to this, we see no need to store them on $HOME (which is small, and backed up to tape).

Apptainer has been configured to only allow using container images that are stored on any folder outside of $HOME or its underlaying folders.

In most cases you should run your images directly from your project directory.

Building containers

It is important that you build your container on the right node type. If you are going to use the container for the CPU partition, build on a CPU node and if you are going to use it for the GPU partition build it in a job on the GPU partition.

  1. Get an interactive job interactive -A <... and other SLURM arguments>.
  2. Build your container apptainer build my_container.sif my_recipe.def.
  3. (If needed). If your build fails and you need to debug, you can use a sandbox on local disk.
    1. apptainer build --sandbox /tmp/my_sandbox.sif my_partial_recipe.def (don't use project storage or homedir)
    2. apptainer shell --writable /tmp/my_sandbox.sif/
    3. investigate the build interactively to learn what you need to fix your recipe
    4. build your container without sandbox on project storage

Multi-node

To use the fast slingshot interconnect to communicate between nodes your container needs to have been built to use slingshot capable libfabric.

We are currently looking at the easiest way to modify any existing container to enable it to make use of the slingshot interconnect. If internode communication is important for your application, please contact support through the support form in SUPR: