Skip to content
Snippets Groups Projects
Commit 6738fe08 authored by Ravi Tripathi's avatar Ravi Tripathi
Browse files

Adding basic information about using a singularity container

parent 23cff5f2
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# SIngularity Containers
%% Cell type:markdown id: tags:
## What is a container?
%% Cell type:markdown id: tags:
A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
Containers use the host system's kernel, and can access its hardware more directly. When you run a process in a container it runs on the host system, directly visible as a process on that system. Unlike a Virtual Machine, container is a virtualization at the software level, whereas VMs are virtualization at hardware level. If you are interested in finding out more differences between VM and a container, go to this [link](https://www.electronicdesign.com/dev-tools/what-s-difference-between-containers-and-virtual-machines)
%% Cell type:markdown id: tags:
## Why use a container?
Containers package together a program and all of its dependencies, so that if you have the container you can use it on any Linux system with the container system software installed. It doesn't matter whether the system runs Ubuntu, RedHat or CentOS Linux - if the container system is available then the program runs identically on each, inside its container. This is great for distributing complex software with a lot of dependencies, and ensuring you can reproduce experiments exactly. If you still have the container you know you can reproduce your work. Also since the container runs as a process on the host machine, it can be run very easily in a [SLURM job](https://docs.uabgrid.uab.edu/wiki/Slurm)
%% Cell type:markdown id: tags:
## Docker vs Singularity?
[Docker](https://www.docker.com/) is the most popular and widely used container system in the industry. But [Singularity](https://www.sylabs.io/singularity/) was built keeping HPC in mind, i.e a shared environment. Singularity is designed so that you can use it within SLURM jobs and it does not violate security constraints on the cluster. Though, since Docker is very popular and a lot of people were already using the Docker for their softwares, Singularity maintained a compatibility for Docker images. We'll be seeing this compatibility later in the notebook.
Singularity is already available on Cheaha. To check the available modules for Cheaha, run the cell below:
%% Cell type:code id: tags:
``` python
!module avail Singularity
```
%% Cell type:markdown id: tags:
As you might have already noticed that we already loaded a Singularity module while starting up this notebook. You can check the version of the Singularity loaded below:
%% Cell type:code id: tags:
``` python
!singularity --version
```
%% Cell type:markdown id: tags:
## Basic singularity command line functions:
To check the basic functions or command line options provided run help on the singularity
%% Cell type:code id: tags:
``` python
!singularity --help
```
%% Cell type:markdown id: tags:
To check more information about a particular parameter, use help in conjunction with that parameter
%% Cell type:code id: tags:
``` python
!singularity build help
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment