Singularity

Revision as of 21:22, 29 November 2017 by Ppomorsk (talk | contribs)


This article is a draft

This is not a complete article: This is a draft, a work in progress that is intended to be published into an article, which may or may not be ready for inclusion in the main wiki. It should not necessarily be considered factual or authoritative.



Singularity is an application containerization solution for High-Performance Computing (HPC). The goal of Singularity is to allow for "mobility of computing": an application containerized on one Linux system should be able to run on another system, as it is, and without the need to reconcile software dependencies and Linux version differences between the source and target systems. One of the main benefits of Singularity is that containers are executed as user and can have access to local and network filesystems.

You can create containers and install and setup software in them on systems where you have root access (e.g. your laptop or a cloud VM). Once you have created your singularity container, you can copy it to an HPC cluster such as Cedar or Graham and run your container as a user on that system. For more information about singularity see singularity main page

Using

Singularity has been installed via modules. To see which versions are available, execute:

$ module avail singularity

To load and use one of the modules, in this example version 2.3, execute:

$ module load singularity/2.3

A good place to find more images to use with singularity is: docker hub e.g. search for ubuntu, and then you can create a new singularity container with a given Ubuntu image with:

$ module load singularity/2.3
$ singularity create my-container.img
$ singularity import my-container.img docker://ubuntu:16.10

or in fewer steps

$ module load singularity/2.3
$ singularity pull -n my-container.img docker://ubuntu:16.10

To start a shell inside this newly created container, execute:

$ singularity shell my-container.img


if the docker image name and tag are ubuntu and 16.10 for example. It is also likely if installing software that you will want larger than the default image. The size of the image can be specified with the -s option, e.g. -s 4096 to specify that the image should be 4096 MB or 4G.

See also: