Singularity or Apptainer allow instantiating an alternative operating system environment on our Linux systems.

In other words:

And all this without significant overhead. Sounds like fiction? It's fact. Right now. Some caveats do apply though.

Credit: Singularity was and is being developed at Berkeley Lab. Please see https://apptainer.org/docs-legacy for upstream information.

Apptainer is the new name of Singularity, developed under the umbrella of Linux Foundation. For documentation, see https://apptainer.org/docs .



There are several ways to instantiate an Apptainer container and run software in it. The two most important ones are:


Apptainer containers can be instantiated on any current user accessible Linux system at DESY Zeuthen. In particular, Apptainer is available on all

The current set of standard images available in /project/singularity/images includes

These short image names are symbolic links to the current versions of the standard images for these operating systems. The specific images are being kept around for a few months, but not forever.

Note users can copy a current image to any location to make sure this exact version will remain available.

Also note users can bring their own images and thus don't have to rely on the ones provided by DV. Creating those is rather simple and documented upstream. It currently requires root access though, so cannot be done on supported Linux systems in Zeuthen. But have a look at https://singularity-hub.org .

Since Release 2.3, it's also possible to import docker images without root privileges. Note that the environment variable APPTAINER_CACHEDIR is used to place downloaded image layers, and it defaults to ~/.apptainer. Change the variable to something more sensible to avoid wasting a lot of home space.

Batch system support

In case you want to run your batch jobs directly under the standard images available in /project/singularity/images, it is possible via the qsub switch -l singularity_os=<os>, whereas <os> defines the image to be used. Example:

[wgs] ~ % qrsh -w n -l singularity_os=sl6 lsb_release -d
Description:    Scientific Linux release 6.9 (Carbon)
[wgs] ~ % qrsh -w n -l singularity_os=u18 lsb_release -d
Description:    Ubuntu 18.04 LTS

/!\ Note: The -w n switch is recommended for qsub/qrsh in this case to avoid the warning "warning: no suitable queues".

Filesystems shared between Host and Container

Subject to availability on the host:

Users can specify additional folders on the host to be bind mounted inside the container when the container is started. This shouldn't be required. But if it is, please see apptainer help run for info how to do it - and let DV know why you need to do this.

CUDA support

To run CUDA code in apptainer, the CUDA libraries must be available both inside and outside the container. Apptainer can automatically bind the needed directories into the container like this:

apptainer exec --nv -B /etc/OpenCL/vendors yourprogram


Apptainer (last edited 2023-01-26 13:46:54 by GötzWaschk)