π¬ In this tutorial we get familiar with the basic usage of Singularity containers.
sinteractive
.
sinteractive --account project_xxxx # Change the xxxx for the project number
wget https://a3s.fi/saren-2001659-pub/tutorial.sif
ls -lh tutorial.sif
π¬ There are three basic ways to run software in a Singularity container:
singularity exec
.
singularity exec tutorial.sif hello_world
cat /etc/*release
singularity exec tutorial.sif cat /etc/*release
π The tutorial container is based on Ubuntu 18.04. The host and the container use the same kernel, but the rest of the system can vary.
π¬ When containers are created, a standard action, called the runscript
is defined. Depending on the container, it may simply print out a message, or it may launch a program or service inside the container.
π If you are using a container created by somebody else, you will need to check the documentation provided by the creator for details.
singularity run tutorial.sif
chmod u+x tutorial.sif
./tutorial.sif
singularity inspect --runscript tutorial.sif
singularity shell tutorial.sif
Singularity>
. You can now run any software inside the container interactively:
hello_world
exit
You can check if the creator of the container has included any help on the usage:
singularity run-help tutorial.sif
Adding this help is, however, optional, and in many containers it is missing. In those case yoy could check e.g. the developers web site for details.
For software installed by CSC, check Docs CSC.
π¬ This tutorial is meant as a brief introduction to get you started.
βπ» When searching the internet for instruction, pay attention that the instructions are for the same version of Singularity that you are using. There has been some command syntax changes etc. between the versions, so older instructions may not work with copy-paste.
π‘ For authoritative instructions see Singularity documentation.