.sif container image format.
To run a containerized job by using Apptainer:
- Connect to a login node of your Soperator cluster.
-
Install Apptainer:
-
Verify that the installation was successful by checking the Apptainer version:
Expected output:
-
Use
srunto pull a container image and convert it to the.sifformat:Thepullcommand 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. -
Create the
apptainer_job.shscript with the following contents:This script uses the following parameters:--gres=gpu:8requests 8 GPUs for the job.--nvenables NVIDIA GPU support inside the container.
cuda_image.sifwith a different container image. Also, replacenvidia-smiwith the required application or command. For example:Ensure thatmy_custom_image.sifcontains Python and all other dependencies oftrain.py. -
Run the job:
The output contains the following confirmation:
-
When the job completes, check the logs. The
output.logfile contains the list of all 8 GPUs that are available for usage inside the container: