Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
start:software:containers:singularity [2021/01/11 22:54] ntretyak [Basic usage] |
start:software:containers:singularity [2021/09/14 15:26] jrutte02 [Using Singularity on Mogon] |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== What is a container? ===== | ===== What is a container? ===== | ||
- | Container | + | Container |
- | ===== Why Singularity? | + | |
- | Citing the official documentation of Singularity: <callout type=" | + | ===== About Singularity |
+ | |||
+ | <callout type=" | ||
It is an open-source project initiated at the Lawrence Berkeley National Laboratory. It is focused on: | It is an open-source project initiated at the Lawrence Berkeley National Laboratory. It is focused on: | ||
Line 14: | Line 15: | ||
* Portability and reproducibility of computations. The single file SIF container format is easy to transport and share. | * Portability and reproducibility of computations. The single file SIF container format is easy to transport and share. | ||
- | * A simple, effective security model. You are the same user inside a container as outside, and cannot gain additional privilege on the host system by default. | + | * A simple, effective security model. You are the same user inside a container as outside, and cannot gain additional privilege on the host system by default. |
+ | |||
+ | ===== Using Singularity on MOGON ===== | ||
+ | |||
+ | We provide Singularity as an [[start: | ||
+ | |||
+ | <code bash> | ||
+ | $ module load tools/ | ||
+ | </ | ||
+ | |||
+ | ==== Interactive usage ==== | ||
+ | |||
+ | You can use Singularity in your [[https:// | ||
+ | <code bash> | ||
+ | $ singularity shell my-fluffy-cow.sif | ||
+ | </ | ||
+ | Cross your fingers and if everything goes right, your prompt will tell you that you are inside the container now. | ||
+ | |||
+ | === Executing Commands within Singularity Containers | ||
+ | |||
+ | You want just to check your container quickly? Or maybe execute a specific command as a part of your data analysis? In this case, you don't need to start a shell inside of the container. You can rather execute a specific command inside of the container. Let's take our example '' | ||
+ | |||
+ | <code bash> | ||
+ | $ singularity exec my-fluffy-cow.sif pwd | ||
+ | </ | ||
+ | |||
+ | The part of the command following the name of the container will be executed in the container (in this case the working directory of the container will be printed onto the screen). After its successful execution your prompt will return to the cluster shell. | ||
+ | |||
+ | |||
+ | Other use cases are described in the official documentation [[https:// | ||
+ | ===== Converting Docker Images to Singularity Images ===== | ||
+ | |||
+ | <callout type=" | ||
+ | NO, but you can convert your Docker image into a Singularity image and launch it on MOGON 2. | ||
+ | </ | ||
- | ===== Basic usage ===== | ||
- | '' | + | * It is possible to directly download a Docker image from the docker hub and convert it into Singularity image: <code bash>$ singularity build my-fluffy-cow.sif docker:// |
- | ===== Use cases ===== | + | |
- | === Interactive usage === | + | * If you have already your own image, which is not on the docker hub, you still can convert it. Here are the steps you have to do **on your local machine**, where you have a Docker image called '' |
- | === Usage as a "black box" === | + | - Find out the Docker image ID with '' |
+ | REPOSITORY | ||
+ | my-fluffy-cow | ||
+ | </ | ||
+ | - Create | ||
+ | - Copy the tarball to MOGON 2 via '' | ||
- | ===== Are there any plans to provide Docker as well? ===== | + | After this, you'll have to wait couple of moments until the archive is copied. When it is done, login to the MOGON 2 and: |
- | **NO** | + | - Load Singularity module with: <code bash>$ module load tools/ |
+ | - Convert Docker tarball to Singularity image: <code bash>$ singularity build my-fluffy-cow.sif docker-archive:// |