Running NorESM in a container¶
What is a container?¶
A container is a unit of software that bundles a code and all its software dependencies so that an application can run quickly in various computing environments
A container image is a standalone, executable package which includes everything needed to run an application: source code, compilers, libraries, etc.
Images become containers at runtime when they run on a container engine (like Docker, Singularity, Shifter, CharlieCloud, etc.)
(Inspired from https://www.docker.com/resources/what-container)
Docker
¶
Docker is probably the most popular platform for creating and distributing container images
It is very easy to install (especially on Linux machines) and well documented

Note
Containers isolate applications from their environment
Docker for everything?
¶
Docker works well for local or private resources, and
it is great to develop and share (Docker-hub)
Docker images are built layer by layer from a recipe called Dockerfile, and should something fail in a particular layer, one can just fix it and resume the build from where it stopped
however, Docker is
not suitable for multi-user environments like High Performance Computers (HPC) because processes within the Docker container are executed with root privileges
and therefore no sensible HPC centers will allow it
Singularity
¶
Compared to Docker, Singularity exhibits several features which make it more suitable for use on HPC, and in particular:
there is no privilege escalation inside Singularity containers (user outside == user inside)
it does not requires any system changes for HPC
it provides a simple integration with resource managers (like Slurm)
Also, from the user point-of view:
Singularity uses a single-file based container format (SIF™ = Singularity Image File)
it supports multiple architectures (x86-64, PPC,
)
however
building container images from a Singularity definition file (.def) is tedious (although the content is similar to that of a Dockerfile)
it is possible to convert a Docker image into Singularity
the size of a Singularity Image File is significantly smaller than the equivalent Docker image archive