SCIAMA
High Performance Compute Cluster
Apptainer (Singularity) on SCIAMA
Apptainer, formerly Singularity, is installed as a module on SCIAMA. It allows you to load full system images other than the one on the host which is currently Centos 7. Apptainer also allows users to run Docker images (which requires root access) in an unprivileged environment.
module load apptainer
Running Apptainer on SCIAMA
To get an interactive shell in to the image, use the following command:
apptainer exec /path/to/imagefile.img /bin/bash
You can use the exec command to run any script inside the container:
apptainer exec /path/to/imagefile.img myscript.sh
Using Containters inside Batch Jobs.
Create a Slurm batch script that will call the same command to execute the image and run a script, e.g.
#!/bin/bash
#SBATCH --job-name=apptainer
#SBATCH --output=output/%j.log
#SBATCH --time=24:00:00
#SBATCH --partition=sciama3.q
#SBATCH --nodes=1
#
#
apptainer exec /path/to/imagefile.img myscript.sh
#SBATCH --job-name=apptainer
#SBATCH --output=output/%j.log
#SBATCH --time=24:00:00
#SBATCH --partition=sciama3.q
#SBATCH --nodes=1
#
#
apptainer exec /path/to/imagefile.img myscript.sh
Using Nvidia GPU's with Apptainer Images.
You can use GPU's in your image by adding the --nv flag to the command, e.g.
apptainer exec --nv /path/to/imagefile.img nvidia-smi