Biocluster Singularity: Difference between revisions
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
== Creating Containers == | == Creating Containers == | ||
* You '''CAN NOT''' create containers on the Biocluster. It has to be done on your local machine. Creating a container requires root access. | * You '''CAN NOT''' create containers on the Biocluster. It has to be done on your local machine. Creating a container requires root access which we do not allow. | ||
== Download Containers == | == Download Containers == | ||
* You need to use the biologin nodes (biologin- | * You need to use the biologin nodes (biologin-2 and biologin-3) to download containers | ||
* This will not work from the compute nodes as they do not have access to the internet | * This will not work from the compute nodes as they do not have access to the internet | ||
* Download a pre-existing container from Singularity Hub - https://singularity-hub.org/. singularity-r is an example '''R''' container | * Download a pre-existing container from Singularity Hub - https://singularity-hub.org/. singularity-r is an example '''R''' container | ||
Line 24: | Line 24: | ||
== Running Containers == | == Running Containers == | ||
* Do not use the biologin nodes (biologin- | * Do not use the biologin nodes (biologin-2 and biologin-3) to run containers. The login nodes are only allowed to be used to download containers | ||
* From a compute node or a SLURM job script, run the following. r-base_latest.sif is name of the container. R is the program to run in the container. This can be bash to get a command line. | * From a compute node or a SLURM job script, run the following. r-base_latest.sif is name of the container. R is the program to run in the container. This can be bash to get a command line. | ||
<pre> | <pre> |
Latest revision as of 16:44, 19 February 2025
About
- Containers contain applications in a way that keep them isolated from the host system that they run on. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.
- Singularity is a program that can launch containers securely in a HPC environment. Other similar programs are Docker, LXD, and Kubernetes.
Module
- Load Singularity Module to run any singularity commands
module load singularity/3.8.1
Creating Containers
- You CAN NOT create containers on the Biocluster. It has to be done on your local machine. Creating a container requires root access which we do not allow.
Download Containers
- You need to use the biologin nodes (biologin-2 and biologin-3) to download containers
- This will not work from the compute nodes as they do not have access to the internet
- Download a pre-existing container from Singularity Hub - https://singularity-hub.org/. singularity-r is an example R container
singularity pull --name r-base_latest.sif shub://nickjer/singularity-r
- Download a pre-existing container from Docker - https://hub.docker.com/. r-base is an example R container
singularity pull docker://r-base
Running Containers
- Do not use the biologin nodes (biologin-2 and biologin-3) to run containers. The login nodes are only allowed to be used to download containers
- From a compute node or a SLURM job script, run the following. r-base_latest.sif is name of the container. R is the program to run in the container. This can be bash to get a command line.
singularity exec r-base_latest.sif R
Storage
- Your home folder is automatically mounted
- You should have access to any group folders in /home/groups, /home/labs, and /private_stores
- The local /scratch space is accessible.
Issues
- If the container does run properly or can't find the command it is trying to run, its possible that the program exists in the /home folder within the singularity container. Since we automatically mount the biocluster's /home folder in the container, it then can't find the command. To get around this, you can remount the biocluster's /home folder in a new directory
singularity exec --no-mount hostfs --bind /home:/newhome container.sif