NVIDIA HPC Container Maker (HPCCM)

By Staff

May 20, 2018 | Blog

HPC Container Maker (HPCCM) generates container specification files, either Dockerfiles or Singularity recipe files, based on a “recipe.” A recipe specifies the series of steps to be performed when building a container. The recipe format is described elsewhere. Recipes provide more portable, higher level building blocks that separate the concerns of choosing what to include in a container from the low level details of container specification.

The same recipe file generates specification files for Docker or Singularity. There is no need for separate development for each container implementation you want to natively support.

For example, from this single recipe both a Dockerfile and Singularity recipe file can be easily generated. (Don’t worry about the syntax of a recipe right now, although as you can see it’s straight forward.)

Project home: https://github.com/NVIDIA/hpc-container-maker

Creating Singularity Images

There are two ways to create Singularity images, one using Docker and the other using Singularity natively.

If container image size is a concern and multi-stage recipes are being used, the Docker-based workflow must be used.

Docker-based workflow

  1. Generate a Dockerfile from the recipe. E.g., hpccm.py --recipe recipes/examples/basic.py > Dockerfile
  2. Build the Docker container. E.g., docker build -t basic -f Dockerfile .
  3. Convert the container to a Singularity image. E.g., docker run -t --rm --privileged -v
    /var/run/docker.sock:/var/run/docker.sock -v /tmp:/output
    singularityware/docker2singularity basic

Singularity native workflow

  1. Generate a Singularity recipe file. E.g., hpccm.py --recipe recipes/examples/basic.py --format singularity > Singularity
  2. Build the Singularity container. E.g., sudo singularity build basic.simg Singularity

Join Our Mailing List

Related Posts

QA and Stability in Singularity

There are many different approaches that can be taken when building software. At one end of the spectrum is the extreme caution and conservatism that’s appropriate, for example, of safety critical code used in vehicles or in real-time operating systems. At the other...

read more

Improve Security in your CI/CD Workflows

In the development world, continuous integration is where members of a team integrate all their work frequently, for example, think of a team all working on the same code base, they are fixing bugs, implementing new features, so to prevent conflicts, all the code is...

read more