Skip to content

Commit db8a91b

Browse files
committed
merging master into 2.4
2 parents 6c24000 + 7cab358 commit db8a91b

10 files changed

Lines changed: 190 additions & 8 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "Announcement: Problem downloading from Docker Hub to be resolved soon"
3+
category: news
4+
permalink: 2017-docker-problem
5+
---
6+
7+
To all Singularity users,
8+
9+
On Tuesday September 12, Docker released a new version of Docker image metadata. This means that any new images built on Docker Hub cannot currently be downloaded using a singularity `pull` or other commands like `shell`, `exec`, and `bootstrap` when updated Docker registries are queried.
10+
11+
Vanessa (`@v`) has created an interim fix for the problem and we have merged it into the development branch. Pending further testing we plan to merge this fix into master and create a new minor release (2.3.2). We will make another announcement as soon as it is ready to install.
12+
13+
Thanks for your patience!
14+
15+
The Singularity team
16+
17+
{% include links.html %}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Standard Container Integration Format (SCI-F) Final Draft"
3+
category: news
4+
permalink: 2017-scif-contribute
5+
---
6+
7+
Hi Singularity Community!
8+
9+
Thanks to everyone that provided comments on the early draft for SCI-F. The goals were initially:
10+
11+
- write specification draft (this was done via a Google Doc)
12+
- implement into Singularity (now in [development branch](https://github.com/singularityware/singularityware.github.io/blob/docs/2.4/pages/docs/user-docs/docs-apps.md))
13+
- get feedback on both, adjust implementation and draft
14+
- do several (N=4) implemented use cases for SCI-F, write up ([available here](http://containers-ftw.org/apps/category/#Example))
15+
- make an interactive, open source repository to contribute and share SCI-F apps [http://containers-ftw.org/apps/](http://containers-ftw.org/apps/)
16+
- write up the (almost) "final" draft formally [http://containers-ftw.org/SCI-F/](http://containers-ftw.org/SCI-F/)
17+
18+
I'm (`@vsoch`) happy to report that I've finished the above, and I'd like to ask the following:
19+
20+
- if you contributed, please check the AUTHORS file in the SCI-F repository to make sure that I added you, and spelled your name correctly (apologies in advance).
21+
- Any further suggestions, additions, or entire new contributions can be added to the draft by way of pull request. I'm not in any rush, and if you have a good contribution, I want to help.
22+
- If you have not contributed yet and would like to, see the ideas linked on the [draft abstract page](http://containers-ftw.org/SCI-F/).
23+
24+
The plan is (as of now) to submit this no later than the end of October, and I want to make sure everyone that wants to contribute has had ample chance. Indeed, with Singularity there are many ways to cook your container, and SCi-F definitely exemplifies that.
25+
26+
![egg](/images/logo/three-ways.png)
27+
28+
Thanks again everyone!
29+
30+
{% include links.html %}

_posts/recipes/2017-01-26-singularity-hub-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The easiest thing to do is to install Singularity on your local workstation:
3030
sudo make install
3131
```
3232

33-
If you have the unfortunate situation of using a Mac, or just need a virtual machine, then you will want to follow the instructions <a href="http://singularity.lbl.gov/install-mac" target="_blank">here</a>. Basically, you need to install vagrant, virtual box, and then do this:
33+
If you are using a Mac, or just need a virtual machine, then you will want to follow the instructions <a href="http://singularity.lbl.gov/install-mac" target="_blank">here</a>. Basically, you need to install vagrant, virtual box, and then do this:
3434

3535
```bash
3636
vagrant init ubuntu/trusty64
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: "Singularity 2.3.2 Quick Fix Release"
3+
category: releases
4+
permalink: "release-2-3-2"
5+
targz: "2.3.2.tar.gz"
6+
---
7+
8+
<a target="_blank" href="https://github.com/singularityware/singularity/releases/tag/2.3.2">Release 2.3.2 </a> This dot release includes a fix for a change that Docker implemented to their registry RESTful API which broke compatibility with Singularity (among several other low minor fixes).
9+
10+
11+
## What happened?
12+
13+
14+
**Where does Docker image metadata come from?**
15+
The Docker Registry serves metadata about images via manifests, where each image has a manifest that tells Singularity important information like environment, labels, and entrypoints and running command. Importantly, the image manifest serves the actual layers that should be obtained to create the image. The manifests come in different flavors, or schema versions. Version 1 serves the primary load of metadata (labels, environment) while the first release of version 2 served layers, and had the addition of size. This addition made it possible to pull an image with Singularity and calculate the size on the fly for images generated with support for this manifest.
16+
17+
Singularity had an old default to retrieve the version 2 (done by way of a header asking for it), and ask it for layers. If the remote registry could only offer version 1, we were still able to obtain a list of layers (under a different key, `fsLayers` instead of `layers`) and metadata via the older (schema 1) manifest. However, with the update, the API version 2 schema can now return a <a href="https://docs.docker.com/registry/spec/manifest-v2-2/#manifest-list"> list of manifests</a>. This meant that when we checked the response for the keys `layers` or `fslayers`, they wouldn't be found, becaues we needed to look under `manifests`, and then do a second call to retrieve the manifest of interest based on a system architecture and OS. This of course broke most `import`, `shell`, `pull`, `exec`, because all of these commands require retrieving the layers.
18+
19+
## The Patch
20+
A super quick fix would have been to fall back to the version 1 manifest, always, but then we would lose the automatic calculation of size, which is important to many users. The "better" fix is obvious - the code needs to:
21+
22+
- check for a `manifests` key
23+
- if found, select a default manifest to use
24+
- retrieve it, and continue!
25+
- if not found, fall back to version 1
26+
27+
This means that we've added environment variables `SINGULARITY_DOCKER_OS` and `SINGULARITY_DOCKER_ARCHITECTURE` to specify this choice, with defaults `linux` and `amd64`. This is a pretty exciting change, because it means down the line you (as a user!) can specify the specifics of the layers you want returned, given an image that has this metadata available. We can see the fix running as follows:
28+
29+
30+
```
31+
DEBUG
32+
*** STARTING DOCKER IMPORT PYTHON ****
33+
```
34+
This is the initialization of the Docker client, it's parsing the image name provided
35+
```
36+
DEBUG Starting Docker IMPORT, includes env, runscript, and metadata.
37+
VERBOSE Docker image: ubuntu:14.04
38+
VERBOSE2 Specified Docker ENTRYPOINT as %runscript.
39+
DEBUG Headers found: Content-Type,Accept
40+
VERBOSE Registry: index.docker.io
41+
VERBOSE Namespace: library
42+
VERBOSE Repo Name: ubuntu
43+
VERBOSE Repo Tag: 14.04
44+
VERBOSE Version: None
45+
```
46+
The initial poke to Docker hub asks for tags, to determine if we need some kind of token
47+
```
48+
VERBOSE Obtaining tags: https://index.docker.io/v2/library/ubuntu/tags/list
49+
DEBUG GET https://index.docker.io/v2/library/ubuntu/tags/list
50+
```
51+
52+
401 means that we do, and with the response the API sends back the scope and other details we need to make to request it
53+
54+
```
55+
DEBUG Http Error with code 401
56+
```
57+
58+
Here we are requesting it
59+
```
60+
DEBUG GET https://auth.docker.io/token?service=registry.docker.io&expires_in=9000&scope=repository:library/ubuntu:pull
61+
DEBUG Headers found: Content-Type,Authorization,Accept
62+
```
63+
64+
And here is the new bit. Instead of blindly doing one call, we have a function to update two versions of the manifest - the older (with metadata) and some version of the newer (with layers and size) with a fallback to use the version 1
65+
```
66+
DEBUG Updating manifests.
67+
68+
# Here is version 2+
69+
DEBUG MANIFEST (Primary): not found, making initial call.
70+
VERBOSE Obtaining manifest: https://index.docker.io/v2/library/busybox/manifests/latest
71+
DEBUG GET https://index.docker.io/v2/library/busybox/manifests/latest
72+
73+
# Here is version 1 (Metadata)
74+
DEBUG MANIFEST (Metadata): not found, making initial call.
75+
VERBOSE Obtaining manifest: https://index.docker.io/v2/library/busybox/manifests/latest
76+
DEBUG GET https://index.docker.io/v2/library/busybox/manifests/latest
77+
```
78+
Notice that the two calls are the same - that's because the headers are actually different, to request different ones.
79+
80+
And here is the (new) indication that we found a list
81+
```
82+
DEBUG Image manifest version 2.2 list found.
83+
```
84+
Here is the default architecture / os
85+
```
86+
DEBUG Obtaining architecture: amd64, OS: linux
87+
```
88+
And the specific call to get it
89+
```
90+
VERBOSE Obtaining manifest: https://index.docker.io/v2/library/busybox/manifests/sha256:030fcb92e1487b18c974784dcc110a93147c9fc402188370fbfd17efabffc6af
91+
DEBUG GET https://index.docker.io/v2/library/busybox/manifests/sha256:030fcb92e1487b18c974784dcc110a93147c9fc402188370fbfd17efabffc6af
92+
```
93+
94+
With this fix - we can again use `pull`/`import`, etc, and also have a working `singularity pull docker://busybox` that estimates the size automatically.
95+
96+
Please report any additional bugs to <a target="_blank" href="https://github.com/singularityware/singularity/issues/new">our issues board.</a>

images/logo/three-ways.png

222 KB
Loading

pages/docs/overview/faq.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ In the end, we do not gain anything by calling 'mpirun' from within the containe
125125
See the Singularity on HPC page for more details.
126126

127127
### Does Singularity support containers that require GPUs?
128+
128129
Yes. Many users run GPU dependant code within Singularity containers. The
129130
experimental `--nv` option allows you to leverage host GPUs without installing
130131
system level drivers into your container. See the [`exec`](/docs-exec#a-gpu-example) command for
@@ -165,6 +166,34 @@ You can read more about the Singularity <a href="/docs-security">security overvi
165166
## Troubleshooting
166167
A little bit of help.
167168

169+
### Segfault on Bootstrap of Centos Image
170+
If you are bootstrapping a centos 6 docker image from a debian host, you might hit a segfault:
171+
172+
```
173+
$ singularity shell docker://centos:6
174+
Docker image path: index.docker.io/library/centos:6
175+
Cache folder set to /home/jbdenis/.singularity/docker
176+
Creating container runtime...
177+
Singularity: Invoking an interactive shell within container...
178+
179+
Segmentation fault
180+
```
181+
182+
The fix is on your host, you need to pass the variable `vsyscall=emulate` to the kernel, meaning in the file `/etc/default/grub` (note, this file is debian specific), add the following:
183+
184+
```
185+
GRUB_CMDLINE_LINUX_DEFAULT="vsyscall=emulate"
186+
```
187+
188+
and then update grub and reboot:
189+
190+
```
191+
update-grub && reboot
192+
```
193+
194+
Please note that this change might have <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt?h=v4.13-rc3#n4387" target="_blank">security implications</a> that you should be aware of. For more information, see the <a href="https://github.com/singularityware/singularity/issues/845" target="_blank">original issue</a>.
195+
196+
168197
### How to use Singularity with GRSecurity enabled kernels
169198
To run Singularity on a GRSecurity enabled kernel, you must disable several security features:
170199

pages/docs/user-docs/action-mount.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When Singularity 'swaps' the host operating system for the one inside your conta
1515

1616
To *mount* a bind path inside the container, a **bind point** must be defined within the container. The bind point is a directory within the container that Singularity can use to bind a directory on the host system. This means that if you want to bind to a point within the container such as `/global`, that directory must already exist within the container.
1717

18-
It is however possible that the system administrator has enabled a Singularity feature called *overlay* in the `/etc/singularity/singularity.conf` file. This will cause the bind points to be created on an as needed basis so that the underlying container is not modified. But because the *overlay* feature is not always used or unavailable in some kernels, it maybe necessary for container standards to exist to ensure portability from host to host.
18+
It is however possible that the system administrator has enabled a Singularity feature called *overlay* in the `/etc/singularity/singularity.conf` file. This will cause the bind points to be created on an as needed basis in an overlay file system so that the underlying container is not modified. But because the *overlay* feature is not always used or is unavailable in some kernels, it may be necessary for container standards to exist to ensure portability from host to host.
1919

2020
If a bind path is requested, and the bind point does not exist within the container, a warning message will be displayed, and Singularity will continue trying to start the container. For example:
2121

pages/docs/user-docs/action-pull.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ Progress |===================================| 100.0%
8181
Done. Container is at: /tmp/vsoch-hello-world-master.img
8282
```
8383

84+
### Pull by commit
85+
You can also pull different versions of your container by using their commit id (`version`).
86+
87+
```
88+
singularity pull shub://vsoch/hello-world@42e1f04ed80217895f8c960bdde6bef4d34fab59
89+
Progress |===================================| 100.0%
90+
Done. Container is at: ./vsoch-hello-world-master.img
91+
```
92+
93+
In this example, the first build of this container will be pulled.
94+
95+
8496
## Docker
8597
Docker pull is similar (on the surface) to a Singularity Hub pull, and we would do the following:
8698

pages/docs/user-docs/action-shell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ folder: docs
66
toc: false
77
---
88

9-
The `shell` Singularity sub-command will automatically spawn an interactive shell within a container. As of v2.3 the default shell that is spawned via the `shell` command is Bash if it exists otherwise `/bin/sh` is called.
9+
The `shell` Singularity sub-command will automatically spawn an interactive shell within a container. As of v2.3 the default shell that is spawned via the `shell` command is `/bin/bash` if it exists otherwise `/bin/sh` is called.
1010

1111
{% include toc.html %}
1212

pages/docs/user-docs/docs-docker.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Registry: pancakes.registry.index.io
9292
Namespace: blue/berry/cream
9393
```
9494

95-
The power of bootstrap comes with the other stuff that you can do! This means running specific install commands, specifying your containers runscript (what it does when you execute it), adding files, labels, and customizing the environment. Here is a full Singularity file:
95+
The power of build comes with the other stuff that you can do! This means running specific install commands, specifying your containers runscript (what it does when you execute it), adding files, labels, and customizing the environment. Here is a full Singularity file:
9696

9797

9898
```bash
@@ -196,7 +196,7 @@ Namespace: library
196196
```
197197

198198
## Custom Authentication
199-
For both import and bootstrap using a build spec file, by default we use the Docker Registry `index.docker.io`. Singularity first tries the call without a token, and then asks for one with pull permissions if the request is defined. However, it may be the case that you want to provide a custom token for a private registry. You have two options. You can either provide a `Username` and `Password` in the build specification file (if stored locally and there is no need to share), or (in the case of doing an import or needing to secure the credentials) you can export these variables to environmental variables. We provide instructions for each of these cases:
199+
For both import and build using a build spec file, by default we use the Docker Registry `index.docker.io`. Singularity first tries the call without a token, and then asks for one with pull permissions if the request is defined. However, it may be the case that you want to provide a custom token for a private registry. You have two options. You can either provide a `Username` and `Password` in the build specification file (if stored locally and there is no need to share), or (in the case of doing an import or needing to secure the credentials) you can export these variables to environmental variables. We provide instructions for each of these cases:
200200

201201

202202
### Authentication in the Singularity Build File
@@ -258,8 +258,6 @@ Have any more best practices? Please <a href="https://www.github.com/singularity
258258

259259

260260
## Troubleshooting
261-
Why won't my image bootstrap work? If you can't find an answer on this site, please <a href="https://www.github.com/singularityware/singularity/issues" target="_blank">ping us an issue</a>.
261+
Why won't my image build work? If you can't find an answer on this site, please <a href="https://www.github.com/singularityware/singularity/issues" target="_blank">ping us an issue</a>.
262262
If you've found an answer and you'd like to see it on the site for others to benefit from, then post to us <a href="https://www.github.com/singularityware/singularityware.github.io/issues" target="_blank">here</a>.
263263

264-
## Future
265-
This entire process will hopefully change in two ways. First, we hope to collapse the image creation and bootstrapping, so you have the option to do them both in one full swing. Second, we hope to eventually figure out some kind of solution to import Docker containers without needing sudo.

0 commit comments

Comments
 (0)