By ULHPC Licence GitHub issues Github Documentation Status GitHub forks

UL HPC Tutorial: HPC Containers with Singularity

 Copyright (c) 2018- UL HPC Team <>

The objective of this tutorial is to practice using Singularity containers on the UL HPC iris cluster.

It's important that you read the slides first.

They review:

  1. setting up Singularity on your workstation
  2. common Singularity commands
  3. how to download existing Docker registry images
  4. how to create and customize containers locally
  5. how to run Singularity containers on the UL HPC platform

Practice using Singularity containers

Part 1 - using existing containers

  1. Connect to the Iris cluster, load the Singularity module.
  2. Download using Singularity the official Docker image of Tensorflow (CPU version)
  3. Download the Git repository of Tensorflow models and examples
  4. Run the LeNet-5-like convolutional MNIST model example tutorials/image/mnist/ with Singularity
    (node)$> mkdir singularity-tests
    (node)$> git clone
    (node)$> module use /opt/apps/resif/data/devel/default/modules/all
    (node)$> module load tools/Singularity 
    (node)$> singularity pull docker://tensorflow/tensorflow
    (node)$> singularity exec tensorflow.simg python models/tutorials/image/mnist/

Part 2 - building a container

  1. Set up Singularity on your workstation or laptop
  2. Create a definition file to create a CentOS 7 container
  3. Customize the definition file to install Python, NumPy, SciPy and Seaborn
  4. Build the container as production SquashFS image
  5. Transfer the image to the Iris cluster
  6. Use the container's embedded python and libraries to run a Seaborn plot example

Part 3 - MPI parallel execution with containers

  1. On your workstation or laptop set up a new definition file for a CentOS 7 container
  2. Build the container as a sandbox directory
  3. Install OpenMPI 2.1.3 within the sandbox
  4. Install the OSU Microbenchmarks in the sandbox, see instructions within the dedicated UL HPC tutorial
  5. Build the sandbox into a production SquashFS image
  6. Transfer the image to the Iris cluster
  7. Run the mpi/one-sided/osu_get_bw benchmark within the container on 2 MPI processes in parallel

Part 4 - use your own

Extra challenge - embed your own code / software in a container and use it on the UL HPC platform :-)