Skip to content

Commit 2b652fb

Browse files
committed
FAQ updates
1 parent 2ca4685 commit 2b652fb

1 file changed

Lines changed: 28 additions & 64 deletions

File tree

pages/docs/overview/faq.md

Lines changed: 28 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,27 @@ folder: docs
88
## General Singularity info
99

1010
### Why the name "Singularity"?
11+
A "Singularity" is an astrophysics phenomenon in which a single point becomes infinitely dense. This type of a singularity can thus contain massive quantities of universe within it and thus encapsulating an infinite amount of data within it.
1112

12-
The name "Singularity" for me (Greg) stems back from my past experience working at a company called <a href="https://en.wikipedia.org/wiki/Linuxcare" target="_blank">Linuxcare</a> where the Linux Boot-able Business Card (LNX-BBC) was developed. The BBC, was a Linux rescue disk which paved the way for all live CD bootable distributions using a loop back file system called the "singularity".
13+
Additionally, the name "Singularity" for me (Greg) also stems back from my past experience working at a company called <a href="https://en.wikipedia.org/wiki/Linuxcare" target="_blank">Linuxcare</a> where the Linux Boot-able Business Card (LNX-BBC) was developed. The BBC, was a Linux rescue disk which paved the way for all live CD bootable distributions using a compressed single image file system called the "singularity".
1314

14-
This nomenclature represented that all files within the environment were contained within a single file, and for the same reason Singularity emphasizes the same nomenclature. (Thanks LNX-BBC!)
15+
The name has **NOTHING** to do with Kurzweil's (among others) prediction that artificial intelligence will abruptly have the ability to reprogram itself, surpass that of human intelligence and take control of the planet. If you are interested in this may I suggest the movie **Terminator 2: Judgement Day**.
1516

17+
### What is so special about Singularity?
18+
While Singularity is a container solution (like many others), Singularity differs in it's primary design goals and architecture:
1619

17-
### Which namespaces are virtualized? Is that select-able?
18-
19-
The goal of Singularity is to run an application within a contained environment such as it was not contained. Thus there is a balance between what to separate and what not to separate. At present the virtualized namespaces are process, mount points, and certain parts of the contained file system.
20-
21-
When you run your Singularity container, you may find that the process IDs start with 1 (one) and increment from there. You will also find that while the file system is contained starting with '/' (root), you can have access outside the container via your starting path. This means that relative paths will resolve outside the container, and fully qualified paths will resolve inside the container.
22-
23-
To achieve this behavior, you will find that several Linux namespaces are separated (PIDS, file systems and descriptors, mounts, and root file system). These can be enabled or disabled by the build and what namespaces the host system supports as well as through environment variables.
24-
20+
1. **Reproducible software stacks:** These must be easily verifiable via checksum or cryptographic signature in such a manner that does not change formats (e.g. splatting a tarball out to disk). By default Singularity uses a container image file which can be checksummed, signed, and thus easily verified and/or validated.
21+
2. **Mobility of compute:** Singularity must be able to transfer (and store) containers in a manner that works with standard data mobility tools (rsync, scp, gridftp, http, NFS, etc..) and maintain software and data controls compliancy (e.g. HIPPA, nuclear, export, classified, etc..)
22+
3. **Compatibility with complicated architectures:** The runtime must be immediately compatible with existing HPC, scientific, compute farm and even enterprise architectures any of which maybe running legacy kernel versions (including RHEL6 vintage systems) which do not support advanced namespace features (e.g. the user namespace)
23+
4. **Security model:** Unlike many other container systems designed to support *trusted users running trusted containers* we must support the opposite model of *untrusted users running untrusted containers*. This changes the security paradigm considerably and increases the breadth of use cases we can support.
2524

26-
### Can't you do this with Docker?
27-
Singularity has taken off within the scientific computing world because Docker, while fantastic for enterprise services and local use, is a no starter on traditional HPC resources. There are no HPC centers utilizing Docker on their traditional HPC resources because it is inheritiatnly incompatible with HPC.
28-
29-
Singularity has a very different usage model then Docker in that Singularity utilizes complete image files while Docker containers are made up of layers of tar files. With Singularity, you can prefetch an entire container, cache it on shared optimized storage, and run it from there. Singularity also limits user privileges and access from within the container, making it safe for user's to bring their own containers. It doesn't open up security risks of users being able to control a root owned daemon, and it integrates seemlessly into existing process and resource manager workflows, supports GPU, MPI, architecture independent, among lots of other aspects that Docker does not.
30-
31-
In the end, Docker is designed for micro-service network virtulization and emulation of the full isolation requirements in the legacy of full machine level virtualization platforms (e.g. VMWare, Xen, KVM, etc.). Singularity is designed specifically for the scentific, application and environment virtulization. The right tool for the right job. :)
32-
33-
If you already have a Docker container you can port it directly into a Singularity image!
34-
35-
```bash
36-
singularity pull docker://godlovedc/lolcow
37-
singularity build lolcow.simg docker://godlovedc/lolcow
3825

39-
# Shell right in
40-
singularity shell docker://godlovedc/lolcow
41-
42-
# Or just run
43-
singularity run docker://godlovedc/lolcow
44-
```
45-
46-
47-
### How does Singularity relate/differ from other container technology?
48-
Singularity differs from other container systems in several major ways that impact usability on shared systems. For example, most container systems emulate standard systems in that there is the ability and necessity to escalate to root, run on separate IP/network address, run services, and in some cases even virtually boot the container system.
49-
50-
Singularity on the other hand focuses on the ability to virtualized only what is necessary to achieve run-time application container and portable environments. For instance, you can not obtain root from within a Singularity container.
51-
52-
There are some additional performance and design enhancements which make Singularity also more appropriate in a scheduled HPC environment. The back-end image type is one such feature that negates the need for temporary caching of container images and optimizes meta-data IO (especially on parallel file systems). Another feature is how Singularity interacts with the host operating system to facilitate application work-flows like X11 and MPI.
26+
### Which namespaces are virtualized? Is that select-able?
27+
That is up to you!
5328

54-
### How does Singularity relate/differ from statically compiled binaries?
55-
Statically compiled binaries are a good comparison to what Singularity can do for a single program because it will package up all of the dynamic libraries and package them into a single executable (interpreted) format.
29+
While some namespaces, like newns (mount) and fs (file system) must be virtualized, all of the others are conditional depending on what you want to do. For example, if you have a workflow that relies on communication between containers (e.g. MPI), it is best to not isolate any more then absolutely necessary to avoid performance regressions. While other tasks are better suited for isolation (e.g. web and data base services).
5630

57-
But because Singularity is actually wrapping operating system files in to a container, you can do much more with it... Such as include other files, scripts, work-flows, pipe lines, data, and multi program processes and package them into a single portable executable format.
31+
Namespaces are selected via command line usage and system administration configuration.
5832

5933
### What Linux distributions are you trying to get on-board?
6034
All of them! Help us out by letting them know you want Singularity to be included!
@@ -63,13 +37,12 @@ All of them! Help us out by letting them know you want Singularity to be include
6337
## Basic Singularity usage
6438

6539
### Do you need administrator privileges to use Singularity?
66-
You generally do not need admin/sudo to use Singularity containers. As of version 2.3, you can create, import, run, export, and shell without it. You do however need admin/root access to install Singularity and to bootstrap a container (build it from a specification file called `Singularity`). This means that, given that your cluster has Singularity installed, you are empowered to generate your own portable environments.
40+
You generally do not need admin/sudo to use Singularity containers but you do however need admin/root access to install Singularity and for some container build functions (for example, building from a recipe, or a writable image).
6741

68-
This then defines the work-flow to some extent. If you have a container (whether Singularity or Docker) ready to go, you can run/shell/import without root access. If you want to build and bootstrap, then your Singularity container image must be built and configured on a host where you have root access (this can be a physical system or on a VM or Docker image). And of course once the container image has been configured it can be used on a system where you do not have root access as long as Singularity has been installed there.
42+
This then defines the work-flow to some extent. If you have a container (whether Singularity or Docker) ready to go, you can run/shell/import without root access. If you want to build a new Singularity container image from scratch it must be built and configured on a host where you have root access (this can be a physical system or on a VM). And of course once the container image has been configured it can be used on a system where you do not have root access as long as Singularity has been installed there.
6943

7044

7145
### What if I don't want to install Singularity on my computer?
72-
7346
If you don't want to build your own images, <a href="https://singularity-hub.org" target="_blank">Singularity Hub</a> will connect to your Github repos with build specification files, and build the containers automatically for you. You can then interact with them easily where Singularity is installed (e.g., on your cluster):
7447

7548
```bash
@@ -80,7 +53,9 @@ singularity build hello-world.simg shub://vsoch/hello-world # redundant, you wou
8053
```
8154

8255
### Can you edit/modify a Singularity container once it has been instantiated?
83-
We strongly advocate for reproducibility, so if you build a squashfs container, it is immutable. However, if you build with `--sandbox` or `--writable` you can produce a writable sandbox folder or ext3 image, respectively. From a sandbox you can develop, test, and make changes, and then build into a full squashfs image. We recommend to our users to use the compressed, immutable format for production containers.
56+
We strongly advocate for reproducibility, so if you build a squashfs container, it is immutable. However, if you build with `--sandbox` or `--writable` you can produce a writable sandbox folder or a writable ext3 image, respectively. From a sandbox you can develop, test, and make changes, and then build or convert it into a standard image.
57+
58+
We recommend to use the default compressed, immutable format for production containers.
8459

8560
### Can multiple applications be packaged into one Singularity Container?
8661
Yes! You can even create entire pipe lines and work flows using many applications, binaries, scripts, etc.. The `%runscript` bootstrap section is where you can define what happens when a Singularity container is run, and with the introduction of [modular apps](/docs-apps) you can now even define `%apprun` sections for different entrypoints to your container.
@@ -98,45 +73,45 @@ singularity run --bind /home/vanessa/Desktop:/data container.img
9873

9974

10075
### How does Singularity handle networking?
101-
As of 2.4, Singularity now has the ability to support instances, each with their own Network namespace, and the starting behavior defined by the `%startscript`. Without running as an instance, Singularity does no network isolation and runs like any other application on the system. It has all of the same networking privileges as any program running as that user. This means that if you run a process in the container directed to localhost, it will show up on your host machine browser as localhost. Take a look at some of our <a href="https://github.com/vsoch/singularity-web" target="_blank">web examples</a> to get a sense for this.
76+
As of 2.4, Singularity can support the network namespace to a limited degree. At present, we just use it for isolation, but it will soon be more featurefull.
10277

10378

104-
### Can a Singularity container be multi-threaded?
79+
### Can Singularity support daemon processes?
80+
Singularity has container "instance" support which allows one to start a container process, within its own namespaces, and use that instance like it was a stand alone, isolated system.
81+
82+
At the moment (as above describes), the network (and UTS) namespace is not well supported, so if you spin up a process daemon, it will exist on your host's network. This means you can run a web server, or any other daemon, from within a container like and access it directly from your host.
10583

84+
### Can a Singularity container be multi-threaded?
10685
Yes. Singularity imposes no limitations on forks, threads or processes in general.
10786

10887
### Can a Singularity container be suspended or check-pointed?
88+
Yes and maybe respectively. Any Singularity application can be suspended using standard Linux/Unix signals. Check-pointing requires some preloaded libraries to be automatically loaded with the application but because Singularity escapes the hosts library stack, the checkpoint libraries would not be loaded. If however you wanted to make a Singularity container that can be check-pointed, you would need to install the checkpoint libraries into the Singularity container via the specfile.
10989

110-
Yes and maybe respectively. Any Singularity application can be suspended using standard Linux/Unix signals. Check-pointing requires some preloaded libraries to be automatically loaded with the application but because Singularity escapes the hosts library stack, the checkpoint libraries would not be loaded. If however you wanted to make a Singularity container that can be check-pointed, you would need to install the checkpoint libraries into the Singularity container via the specfile
90+
On our roadmap is the ability to checkpoint the entire container process thread, and restart it. Keep an eye out for that feature!
11191

11292

113-
### Are there any special requirements to use Singularity through a job scheduler?
114-
93+
### Are there any special requirements to use Singularity through an HPC job scheduler?
11594
Singularity containers can be run via any job scheduler without any modifications to the scheduler configuration or architecture. This is because Singularity containers are designed to be run like any application on the system, so within your job script just call Singularity as you would any other application!
11695

11796

11897
### Does Singularity work in multi-tenant HPC cluster environments?
119-
12098
Yes! HPC was one of the primary use cases in mind when Singularity was created.
12199

122100
Most people that are currently integrating containers on HPC resources do it by creating virtual clusters within the physical host cluster. This precludes the virtual cluster from having access to the host cluster's high performance fabric, file systems and other investments which make an HPC system high performance.
123101

124102
Singularity on the other hand allows one to keep the high performance in High Performance Computing by containerizing applications and supporting a runtime which seamlessly interfaces with the host system and existing environments.
125103

126104
### Can I run X11 apps through Singularity?
127-
128105
Yes. This works exactly as you would expect it to.
129106

130107
### Can I containerize my MPI application with Singularity and run it properly on an HPC system?
131-
132108
Yes! HPC was one of the primary use cases in mind when Singularity was created.
133109

134110
While we know for a fact that Singularity can support multiple MPI implementations, we have spent a considerable effort working with Open MPI as well as adding a Singularity module into Open MPI (v2) such that running at extreme scale will be as efficient as possible.
135111

136112
note: We have seen no major performance impact from running a job in a Singularity container.
137113

138114
### Why do we call 'mpirun' from outside the container (rather then inside)?
139-
140115
With Singularity, the MPI usage model is to call 'mpirun' from outside the container, and reference the container from your 'mpirun' command. Usage would look like this:
141116

142117
```bash
@@ -149,9 +124,7 @@ In the end, we do not gain anything by calling 'mpirun' from within the containe
149124

150125
See the Singularity on HPC page for more details.
151126

152-
153127
### Does Singularity support containers that require GPUs?
154-
155128
Yes. Many users run GPU dependant code within Singularity containers. The
156129
experimental `--nv` option allows you to leverage host GPUs without installing
157130
system level drivers into your container. See the [`exec`](/docs-exec#a-gpu-example) command for
@@ -160,7 +133,6 @@ an example.
160133
## Container portability
161134

162135
### Are Singularity containers kernel dependent?
163-
164136
No, never. But sometimes yes.
165137

166138
Singularity is using standard container principals and methods so if you are leveraging any kernel version specific or external patches/module functionality (e.g. OFED), then yes there maybe kernel dependencies you will need to consider.
@@ -172,19 +144,16 @@ There is also some level of glibc forward compatibility that must be taken into
172144
note: If you require kernel dependent features, a container platform is probably not the right solution for you.
173145

174146
### Can a Singularity container resolve GLIBC version mismatches?
175-
176147
Yes. Singularity containers contain their own library stack (including the Glibc version that they require to run).
177148

178149
### What is the performance trade off when running an application native or through Singularity?
179-
180150
So far we have not identified any appreciable regressions of performance (even in parallel applications running across nodes with InfiniBand). There is a small start-up cost to create and tear-down the container, which has been measured to be anywhere from 10 - 20 thousandths of a second.
181151

182152
## Misc
183153

184154
The following are miscellaneous questions.
185155

186156
### Are there any special security concerns that Singularity introduces?
187-
188157
No and yes.
189158

190159
While Singularity containers always run as the user launching them, there are some aspects of the container execution which requires escalation of privileges. This escalation is achieved via a SUID portion of code. Once the container environment has been instantiated, all escalated privileges are dropped completely, before running any programs within the container.
@@ -193,14 +162,10 @@ Additionally, there are precautions within the container context to mitigate any
193162

194163
You can read more about the Singularity <a href="/docs-security">security overview here</a>.
195164

196-
197165
## Troubleshooting
198-
199166
A little bit of help.
200167

201-
202168
### How to use Singularity with GRSecurity enabled kernels
203-
204169
To run Singularity on a GRSecurity enabled kernel, you must disable several security features:
205170

206171
```bash
@@ -252,11 +217,10 @@ Also, make sure you are using an up-to-date Singularity to bootstrap your contai
252217

253218

254219
### Error running Singularity with sudo
255-
256220
This fix solves the following error when Singularity is installed into the default compiled prefix of /usr/local:
257221

258222
```bash
259-
$ sudo singularity create /tmp/centos.img
223+
$ sudo singularity instance.start container.img daemon1
260224
sudo: singularity: command not found
261225
```
262226

0 commit comments

Comments
 (0)