Containers on Hellbender

Summary

Containers on Hellbender

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: 

  • Execute applications with complicated software dependencies  

  • Reproduce computational workflows consistently  

  • Run applications originally developed on other systems  

  • Share complete software environments with collaborators  

  • Take advantage of pre-built container images from public registries  

Uploaded image

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 

  • Runs without administrator privileges — containers execute entirely in user space.  

  • Access to host resources — applications can use local file systems, GPUs, and other hardware directly.  

  • MPI compatibility — supports high-performance MPI applications using the clusters native communication libraries.  

  • Docker image support — Docker images can be imported and used with minimal effort.  

Uploaded image

 

 

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. 

Uploaded image

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:~ 

Uploaded image

 

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. 

Uploaded image

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. 

Uploaded image

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 

  • Build small, focused containers that include only required software.  

  • Prefer SIF images whenever possible since they are read-only and more reliable.  

  • Keep datasets outside the container and access them through bind mounts.  

  • Include descriptive labels and documentation inside every container.  

  • Validate workflows on small test jobs before launching production runs.  

  • Store definition files under version control to make container builds reproducible.  

Limitations

Containers are extremely useful, but they also have some constraints. 

  • Docker and Podman are not supported on the Hellbender because they require elevated privileges that are incompatible with shared HPC environments.  

  • Containerized applications may experience a slight performance penalty compared to running directly on the host.  

  • Certain specialized hardware or software configurations may require additional setup before they can be accessed from inside a container.  

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. 

Uploaded image

Can Docker images be used with Singularity? 

Yes. Docker images can be downloaded and automatically converted. 

singularity pull docker://ubuntu:20.04 

Uploaded image

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 

Uploaded image

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. 

Uploaded image

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

Details

Details

Article ID: 2820
Created
Tue 9/15/26 4:43 PM
Modified
Wed 11/18/26 6:34 PM