Containers on the Central HPC Cluster
The Central HPC Cluster supports Apptainer Containers (formerly known as Singularity). This container technology can make use of docker images from dockerhub and other oci images.
Singuarity once has a remote build option, but that is no longer supported since apptainer was rolled into the linux foundation.
Load the apptainer module in your shell:
module load apptainer/1.1.9-gcc-11.3.1-mbji4yi
To pull an image from dockerhub you can use apptainer commands:
module load apptainer/1.1.9-gcc-11.3.1-mbji4yi
To pull an image from dockerhub you can use apptainer commands:
[naveed@login3 ~]$ apptainer pull docker://sylabsio/lolcow:latest
INFO: Converting OCI blobs to SIF format
INFO: Starting build...
Copying blob 16ec32c2132b done |
Copying blob 5ca731fc36c2 done |
Copying config fd0daa4d89 done |
Writing manifest to image destination
2024/11/11 16:07:57 info unpack layer: sha256:16ec32c2132b43494832a05f2b02f7a822479f8250c173d0ab27b3de78b2f058
2024/11/11 16:07:58 info unpack layer: sha256:5ca731fc36c28789c5ddc3216563e8bfca2ab3ea10347e07554ebba1c953242e
INFO: Creating SIF file...
[naveed@login3 ~]$
And to run the image, you can run the newly download image
[naveed@login3 ~]$ apptainer run lolcow_latest.sif
INFO: gocryptfs not found, will not be able to use gocryptfs
______________________________
< Mon Nov 11 16:09:03 PST 2024 >
------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
[naveed@login3 ~]$
To get a shell in a container (this is to show the /etc/issue file on the local system, and then see it in the container):
[naveed@login3 ~]$ cat /etc/issue
\S
Kernel \r on an \m
[naveed@login3 ~]$ apptainer exec lolcow_latest.sif cat /etc/issue
INFO: gocryptfs not found, will not be able to use gocryptfs
Ubuntu 20.04.2 LTS \n \l
[naveed@login3 ~]$
To bind a local directory to a location in the container you can use the bind command in appatiner:
[naveed@login3 ~]$ apptainer exec lolcow_latest.sif ls /central/canary
INFO: gocryptfs not found, will not be able to use gocryptfs
/usr/bin/ls: cannot access '/central/canary': No such file or directory
[naveed@login3 ~]$ apptainer exec --bind /central:/central lolcow_latest.sif ls /central/canary
INFO: gocryptfs not found, will not be able to use gocryptfs
/central/canary