Other notable container tools

Overview

Teaching: 10 min
Exercises: 0 min
Questions
Objectives
  • Get an overview of other tools of interest for containers on HPC

HPC Container Maker

HPC Container Maker (HPCCM) is a Python tool developed by Nvidia, whose only purpose is to write recipe files for containers.

The most interesting aspect is that recipes are written in a container engine agnostic format, and then HPCCM can translate them both in Dockerfiles and Singularity def files, allowing to simply produce container images in both formats.

Another interesting feature is that HPCCM ships a set of so called building blocks, i.e. ready to use units that install common packages in containers in an optimised way. For instance, these include compilers, MPI libraries, scientific libraries and a few applications.

To give an idea of how a HPCCM recipe looks like, here is one for the lolcow example we have explored when building Singularity and Docker containers:

Stage0 += baseimage(image='ubuntu:18.04')

Stage0 += packages(ospackages=['fortune', 'cowsay', 'lolcat'])
Stage0 += environment(variables={'PATH': '/usr/games:$PATH'})

Stage0 += label(metadata={'Author': '"Pawsey Supercomputing Centre"'})
Stage0 += label(metadata={'Version': 'v0.0.1'})

You can cd into the demo directory:

$ cd $ERNZ20/demos/12_lolcow_hpccm

And then create the def file:

$ hpccm --recipe lolcow.py --format singularity

and the Dockerfile:

$ hpccm --recipe lolcow.py --format docker

Note how this recipe does not produce exactly the def file and Dockerfile we have discussed in previous episodes. It is just meant to convey a general idea of the working principle of HPCCM.

More information on HPCCM can be found in the HPCCM docs.

Podman

Podman is an open-source container engine maintained by Red Hat. It has quite similar features to Docker, with two important differences:

Like Docker, it still doesn’t provide support for MPI, schedulers, GPU (natively).

One reason to consider it is for building container images in rootless mode, right within a HPC system. On the other hand, for HPC runtime it lacks relevant features when compared to Singularity, Shifter and Sarus. Notably, at the time of writing it is still a bit buggy.

Interestingly, the API is mostly identical to that of Docker, so that in principle one could just use podman by means of

$ alias docker=podman

Charliecloud

Charliecloud is a promising container engine developed by LANL for HPC.

More information about it will be added to this tutorial in the near future.

NERSC Shifter

NERSC Shifter is a container engine developed by NERSC for HPC.

It complies with HPC security requirements by design, and features native support for MPI and schedulers; interestingly, it cannot run GPU applications. It cannot be used to build images, just to run them.

At the time of writing, its development seems a bit stalled, for which reason we suggest considering CSCS Shifter/Sarus instead.

CSCS Shifter (or Shifter-NG)

CSCS Shifter is a fork of NERSC Shifter by CSCS.

Most notably, it adds GPU support to the runtime engine.

It is being deprecated by CSCS, as they have evolved the project into Sarus, see below.

Sarus

Sarus is the latest incarnation of a container runtime engine by CSCS.

It is fully compliant with the Docker image format (whereas it cannot run Singularity images), natively supports schedulers, MPI, and GPU applications. Then in terms of runtime features it is mostly equivalent to Singularity (although at the moment it doesn’t offer a feature comparable to OverlayFS). However, to build container images, it relies on the users being able to run Docker somewhere else. Also, uptake at the moment is quite limited compared to Singularity.

As at the moment Sarus seems the only practical alternative to running containers on HPC, let us proceed with a quick overview of the syntax. The key commands are:

If you want to test it, you might just use the image ubuntu:18.04 as a test bed, similar to what we did earlier on with Singularity and Docker.

Note how, at the time of writing, Sarus is still in a phase of beta testing, with the code base still subject to relevant changes.

Key Points

  • HPCCM can be useful to write image recipes that are compatible both with Docker and Singularity

  • Other than Singularity, at the moment other interesting container engines for HPC are Sarus, Charliecloud and enroot