Skip to main content
Soperator clusters allow you to run jobs in containers by using Apptainer. Apptainer is a secure and portable container runtime compatible with Slurm. It is designed for high-performance computing (HPC) and scientific computing. Apptainer was formerly known as Singularity and supports the same .sif container image format.
Apptainer may provide lower performance than other supported tools for running jobs in containers. We recommend using container runtimes that Soperator has performance optimizations for, such as Enroot.
To run a containerized job by using Apptainer:
  1. Connect to a login node of your Soperator cluster.
  2. Install Apptainer:
  3. Verify that the installation was successful by checking the Apptainer version:
    Expected output:
  4. Use srun to pull a container image and convert it to the .sif format:
    The pull command can download or convert a container from the specified URL. In particular, you can pull an image from Docker Hub or another container registry. For more information, see the Apptainer documentation.
  5. Create the apptainer_job.sh script with the following contents:
    This script uses the following parameters:
    • --gres=gpu:8 requests 8 GPUs for the job.
    • --nv enables NVIDIA® GPU support inside the container.
    This script runs the nvidia-smi monitoring utility by NVIDIA to print information on GPU visibility inside the container. To run custom workloads, replace cuda_image.sif with a different container image. Also, replace nvidia-smi with the required application or command. For example:
    Ensure that my_custom_image.sif contains Python and all other dependencies of train.py.
  6. Run the job:
    The output contains the following confirmation:
  7. When the job completes, check the logs. The output.log file contains the list of all 8 GPUs that are available for usage inside the container: