Body
Containers on Hellbender
Containerization makes it possible to bundle applications together with all required libraries and dependencies into a portable software environment. This approach simplifies deployment, improves reproducibility, and ensures applications behave consistently across different computing systems.
Note: The Hellbender cluster supports Singularity/Apptainer as its container platform. Docker and Podman are not available because they are not suitable for the security and operational requirements of a shared HPC environment.
Using containers on Hellbender allows you to:

Singularity / Apptainer
Singularity (now distributed under the name Apptainer) is the container runtime provided on Hellbender. Unlike traditional container platforms designed for cloud infrastructure, it was created specifically for scientific computing on shared HPC systems. It delivers the convenience of containers while maintaining the security model required on multi-user clusters.
Main Features

Getting Started
Singularity/Apptainer is already installed on Hellbender.
To verify the installation, first request an interactive session (avoid running this on a login node), then execute:
singularity --version
or
apptainer --version
Important: The software is currently transitioning from the name Singularity to Apptainer. Depending on the installation, either or both commands may be available, but they refer to the same container runtime.

Building Containers
Although you can execute Singularity containers on Hellbender, creating new containers directly on login nodes is not allowed because container builds consume significant system resources. Instead, consider one of the following approaches.
Option 1: Download a Pre-built Image
Many popular scientific applications are already available as container images.
singularity pull docker://tensorflow/tensorflow:latest-gpu
Option 2: Build on Your Local Machine
Create the container on your workstation and copy the finished image to Hellbender.
singularity build mycontainer.sif mydef.def
scp mycontainer.sif username@hellbender.rnet.missouri.edu:~

Option 3: Import a Docker Image
Singularity can automatically download and convert Docker images.
singularity pull docker://ubuntu:20.04
Creating Custom Containers
Custom container images are built from Singularity definition files.
Example:
Bootstrap: docker
From: ubuntu:20.04
%post
apt-get update
apt-get install -y python3 python3-pip
pip3 install numpy scipy pandas
%runscript
python3 "$@"
%labels
Author Your Name
Version v0.1
Running Containers
There are several ways to launch applications inside a container.
Run the Default Application
singularity run mycontainer.sif
Open an Interactive Shell
singularity shell mycontainer.sif
Execute a Specific Command
singularity exec mycontainer.sif python3 myscript.py
Using Containers in Slurm Jobs
Containerized applications can be launched directly from a Slurm batch script.
#!/bin/bash
#SBATCH --job-name=container_job
#SBATCH --partition=requeue
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks=4
singularity exec mycontainer.sif ./my_application
Accessing Host Files
Use bind mounts whenever your application needs to read or write files outside the container.
singularity exec --bind /mnt:/mnt mycontainer.sif python3 /mnt/pixstor/data/your_username/analysis.py
MPI Containers
MPI applications require a hybrid execution model that combines the containerized software with the host system's MPI libraries.
Running MPI Applications
Host MPI libraries are automatically made available inside the container. Launch MPI programs as follows:
mpirun -n 4 singularity exec mpi_container.sif /path/to/mpi/executable
Make sure the MPI libraries installed inside the container are compatible with the MPI implementation available on the cluster.

Example Slurm MPI Script
#!/bin/bash
#SBATCH --job-name=mpi_container
#SBATCH --partition=requeue
#SBATCH --time=01:00:00
#SBATCH --nodes=2
#SBATCH --ntasks=16
module load openmpi/4.1.5_gcc_12.3.0
srun -n $SLURM_NTASKS singularity exec mpi_container.sif /app/mpi_program
GPU Containers
NVIDIA GPU support is enabled with the --nv option.
singularity exec --nv gpu_container.sif python3 /app/train_model.py
This option exposes the host's NVIDIA drivers and GPU devices inside the container.

Example GPU Job
#!/bin/bash
#SBATCH --job-name=gpu_container
#SBATCH --partition=gpu
#SBATCH --time=02:00:00
#SBATCH --nodes=1
#SBATCH --gres=gpu:2
singularity exec --nv tensorflow.sif python3 /path/to/tensorflow_script.py
Best Practices
Limitations
Containers are extremely useful, but they also have some constraints.
Frequently Asked Questions
Why isn't Docker available on Hellbender?
Docker requires privileged operations that are not appropriate on shared HPC systems. Singularity provides comparable functionality while allowing users to run containers securely without root access.

Can Docker images be used with Singularity?
Yes. Docker images can be downloaded and automatically converted.
singularity pull docker://ubuntu:20.04

How can I access files on the host system?
Mount directories from the host into the container using the --bind option.
singularity exec --bind /path/on/host:/path/in/container mycontainer.sif command

Where should container images be stored?
Small images can be kept in your data directory. Larger images are better placed in your lab-project space, where more capacity is available.

Can software be installed inside an existing container?
Standard SIF images are read-only and cannot be modified after they are created. To add or update software, rebuild the container or work with a writable sandbox during development. Regular Hellbender users cannot create writable sandboxes on the cluster, so container development should be performed on a local Linux system before transferring the finished .sif image to Hellbender.
For Additional Assistance
For additional assistance with containers, please join the Research Facilitators in Office Hours. Article - Getting Hellbender/RDE Help