Commit d1b75487 authored by Jan Siwiec's avatar Jan Siwiec

Update singularity.md

parent f356318d
Pipeline #11306 passed with stages
in 23 minutes and 46 seconds
# Singularity Container
[Singularity][a] enables users to have full control of their environment. A non-privileged user can "swap out" the operating system on the host for one they control. So if the host system is running RHEL6 but your application runs in Ubuntu/RHEL7, you can create an Ubuntu/RHEL7 image, install your applications into that image, copy the image to another host, and run your application on that host in its native Ubuntu/RHEL7 environment.
[Singularity][a] enables users to have full control of their environment. A non-privileged user can "swap out" the operating system on the host for one they control. So if the host system is running RHEL6 but your application runs in Ubuntu/RHEL7, you can create an Ubuntu/RHEL7 image, install your applications into that image, copy the image to another host, and run your application on that host in its native Ubuntu/RHEL7 environment.
Singularity also allows you to leverage the resources of whatever host you are on. This includes HPC interconnects, resource managers, file systems, GPUs and/or accelerators, etc. Singularity does this by enabling several key facets:
......@@ -20,7 +20,7 @@ This documentation is for Singularity version 2.4 and newer.
## Using Docker Images
Singularity can import, bootstrap, and even run Docker images directly from [Docker Hub][b]. You can easily run RHEL7 container like this:
Singularity can import, bootstrap, and even run Docker images directly from [Docker Hub][b]. You can easily run an RHEL7 container like this:
```console
hra0031@login4:~$ cat /etc/redhat-release
......@@ -37,7 +37,7 @@ Singularity centos:latest:~> cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
```
In this case, image is downloaded from Docker Hub, extracted to a temporary directory and Singularity interactive shell is invoked. This procedure can take a lot of time, especially with large images.
In this case, the image is downloaded from Docker Hub, extracted to a temporary directory, and Singularity interactive shell is invoked. This procedure can take a lot of time, especially with large images.
## Importing Docker Image
......@@ -47,7 +47,7 @@ Singularity containers can be in three different formats:
* writable **ext3** (--writable option)
* writable **(ch)root directory** (--sandbox option) - best for development
Squashfs and (ch)root directory images can be built from Docker source directly on the cluster, no root privileges are needed. It is strongly recomended to create native Singularity image to speed up the launch of the container.
Squashfs and (ch)root directory images can be built from Docker source directly on the cluster, no root privileges are needed. It is strongly recommended to create a native Singularity image to speed up the launch of the container.
```console
hra0031@login4:~$ ml Singularity
......@@ -83,7 +83,7 @@ DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
```
A command can be run inside the container (without interactive shell) by invoking `singularity exec` command.
A command can be run inside the container (without an interactive shell) by invoking the `singularity exec` command.
```
hra0031@login4:~$ singularity exec ubuntu.img cat /etc/lsb-release
......@@ -93,7 +93,7 @@ DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
```
Singularity image can contain a runscript. This script is executed inside the container after the `singularity run` command is used. The runscript is mostly used to run an application for which the container is built. In the following example it is `fortune | cowsay` command.
A singularity image can contain a runscript. This script is executed inside the container after the `singularity run` command is used. The runscript is mostly used to run an application for which the container is built. In the following example, it is the `fortune | cowsay` command:
```
hra0031@login4:~$ singularity run ubuntu.img
......@@ -109,7 +109,7 @@ hra0031@login4:~$ singularity run ubuntu.img
## Accessing /HOME and /SCRATCH Within Container
User home directory is mounted inside the container automatically. If you need access to **/SCRATCH** storage for your computation, this must be mounted by `-B | --bind` option.
A user home directory is mounted inside the container automatically. If you need access to the **/SCRATCH** storage for your computation, this must be mounted by the `-B | --bind` option.
!!!Warning
The mounted folder has to exist inside the container or the container image has to be writable!
......@@ -122,7 +122,7 @@ Singularity ubuntu.img:~> ls /scratch
ddn sys temp work
```
Comprehensive documentation can be found at the [Singularity][c] website.
A comprehensive documentation can be found at the [Singularity][c] website.
[a]: http://singularity.lbl.gov/
[b]: https://hub.docker.com/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment