You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hpc/07_containers/01_intro.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,33 @@
1
1
# Custom Applications with Containers
2
2
3
3
## What is Apptainer?
4
-
Apptainer is a container based Linux kernel workspace that works just like Docker. You can run pre-built programs in containers without having to worry about the pre-install environment. You can even run Docker containers with Apptainer. Please see the [Apptainer and Docker](https://apptainer.org/docs/user/main/docker_and_oci.html) documentation by Syslabs for details about all the ways Apptainer supports Docker. For a detailed introduction on Apptainer, visit their [official site](https://apptainer.org/documentation/).
4
+
Apptainer is a container based Linux kernel workspace that works just like Docker. You can run pre-built programs in containers without having to worry about the pre-install environment. You can even run Docker containers with Apptainer. Please see the [Apptainer and Docker](https://apptainer.org/docs/user/main/docker_and_oci.html) documentation by Syslabs for details about all the ways Apptainer supports Docker. For a detailed introduction on Apptainer, visit their [official site](https://apptainer.org/documentation/).
5
5
6
-
Apptainer is the continuation of the Singularity project. When we transition to the new Torch cluster you will only see reference to Apptainer. The reason for this is that there were two container projects with the name Singularity. The original free and open-source (FOSS) project and a closed-source corporate fork. The FOSS version has renamed itself to Apptainer to avoid confusion and this is the version we use.
6
+
Apptainer is the continuation of the Singularity project. When we transition to the new Torch cluster you will only see reference to Apptainer. The reason for this is that there were two container projects with the name Singularity. The original free and open-source (FOSS) project and a closed-source corporate fork. The FOSS version has renamed itself to Apptainer to avoid confusion and this is the version we use.
7
7
8
-
## Why do we use Apptainer
8
+
## Why Do We Use Apptainer
9
9
There are multiple reasons to use Apptainer on the HPC clusters:
10
10
-**Security**: Apptainer provides a layer of security as it does not require any root access on our clusters. This makes it safer against malware and bad scripts that might jeopardize the outer system. Thus we only support Apptainer on our clusters (there are not other options such as Kubernetes or Docker on our clusters right now).
11
-
-**Containerization**: Apptainer will run all your images (packaged and pre-built programs) inside of its containers, each container works like a small vm. They contain all the required environment and files of a single Linux kernel and you don't have to worry about any pre-installation issues.
11
+
-**Containerization**: Apptainer will run all your images (packaged and prebuilt programs) inside of its containers, each container works like a small vm. They contain all the required environment and files of a single Linux kernel and you don't have to worry about any pre-installation issues.
12
12
-**Inter-connectivity**: Containers are able to talk to each other, as well as the home system, so while each container has its own small space, they are still a part of a big interconnected structure. Thus enabling you to connect your programs.
13
13
-**Accessibility**: Probably the most important feature of all, Apptainer allows you to run your program in 2 to 3 simple steps, as shown below.
14
14
15
-
## How to run an Apptainer container
15
+
## How to Run an Apptainer Container
16
16
There are 3 steps to run an Apptainer container on our clusters:
17
17
18
18
:::warning
19
19
Running containers on login nodes is not encouraged, as processes may be terminated due to resource limits; please use compute nodes instead.
20
20
:::
21
21
22
-
### 1. pull an image from Docker hub
22
+
### 1. Pull an Image from Docker Hub
23
23
```sh
24
24
$ apptainer pull docker://godlovedc/lolcow
25
25
# image name can be for example docker://godlovedc/lolcow
26
26
```
27
27
28
28

29
29
30
-
### 2. build the image (optional)
30
+
### 2. Build the Image (Optional)
31
31
```sh
32
32
$ apptainer build <a name of your choosing>.sif <image name>
33
33
# the image name can be a local image or an image from a hub
@@ -39,16 +39,16 @@ Building an image is optional for most use cases. In many cases, users can direc
39
39
40
40
You can now run your container using the built image.
41
41
42
-
### 3. run container
42
+
### 3. Run Container
43
43
```sh
44
44
# this is one way of running a container
45
45
$ apptainer run <image name>.sif
46
46
# this is another way to run a container
47
47
$ ./<image name>.sif
48
48
```
49
49
50
-
:::warning
51
-
Apptainer images are immutable by default and do not support write access. To modify files within a container, an overlay must be used.
50
+
:::info
51
+
Apptainer images are immutable by default. You can mount an writeable overlay file and edit files within the overlay.
In some cases, you may need elevated permissions inside the container to install software or modify system files. Apptainer provides a `--fakeroot` option that allows you to run commands inside the container with root-like privileges, without requiring actual root access on the system.
81
81
@@ -92,7 +92,7 @@ So what if you want to create an image from your container and save it for a rai
92
92
93
93
Apptainer documentation has [instructions for building containers](https://apptainer.org/docs/user/latest/build_a_container.html) for your convenience. Please read through them to create your own Apptainer container and package it into an image!
94
94
95
-
Similarly, you can build docker containers using the information from [Docker's documentation](https://docs.docker.com/get-started/docker-concepts/building-images/). You can then upload them onto docker hub and pull them using Apptainer. Apptainer supports all docker images!
95
+
Similarly, you can build docker containers using the information from [Docker's documentation](https://docs.docker.com/get-started/docker-concepts/building-images/). You can then upload them onto docker hub and pull them using Apptainer. Apptainer supports all Docker images!
96
96
97
97
## Apptainer vs Docker
98
98
Why are there so many mentions of Docker? The reason is that Apptainer is essentially compatible with Docker and you don't need to relearn Apptainer if you already have experience with Docker. Now let's get into some pros and cons between the two programs.
0 commit comments