Skip to content

Commit d6cff7a

Browse files
GodloveDvsoch
authored andcommitted
added toc and fixed a few links (#126)
1 parent 6e8a2a2 commit d6cff7a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

pages/docs/user-docs/docs-instances.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ toc: false
88

99
Singularity 2.4 introduces the ability to run "container instances", allowing you to run services (*e.g. Nginx, MySQL, etc...*) using Singularity. A container instance, simply put, is a persistant and isolated version of the container image that runs in the background.
1010

11+
{% include toc.html %}
12+
1113
## Why container instances?
1214
Let's say I want to run a web server. With nginx, that is pretty simple, I install nginx and start the service:
1315

@@ -64,7 +66,7 @@ web2 791 /home/mibauer/nginx.img
6466
web3 792 /home/mibauer/nginx.img
6567
```
6668

67-
Once an instance is started, the environment inside of that instance will never change. If the service you want to run in your instance requires a bind mount, then you must pass the `-B` option when calling `instance.start`. For example, if you wish to capture the output of the `web1` container instance which is placed at `/output/` inside the container you could do:
69+
If the service you want to run in your instance requires a bind mount, then you must pass the `-B` option when calling `instance.start`. For example, if you wish to capture the output of the `web1` container instance which is placed at `/output/` inside the container you could do:
6870

6971
```
7072
$ singularity instance.start -B output/dir/outside/:/output/ nginx.img web1
@@ -141,7 +143,7 @@ Also, the `url-to-pdf-api` server requires some environment variables be set, wh
141143
export NODE_ENV PORT ALLOW_HTTP URL
142144
```
143145

144-
Now we can build the definition file into an image! Simply run build and the image will be ready to go:
146+
Now we can build the definition file into an image! Simply run `build` and the image will be ready to go:
145147

146148
```
147149
$ sudo singularity build url-to-pdf-api.img Singularity
@@ -187,7 +189,7 @@ Singularity pdf_server.img:~/bauerm97/instance-example> exit
187189

188190
### Making it Pretty
189191

190-
Now that we have comfirmation that the server is working, let's make it a little cleaner. It's difficult to remember the exact curl comand and URL syntax each time you want to request a PDF, so let's automate that. To do that, we're going to be using Standard Container Integration Format (SCIF) apps, which are integrated directly into singularity. If you haven't already, check out the [Singularity app documentation](link-to-app-docs-or-scif) to come up to speed.
192+
Now that we have comfirmation that the server is working, let's make it a little cleaner. It's difficult to remember the exact curl comand and URL syntax each time you want to request a PDF, so let's automate that. To do that, we're going to be using Standard Container Integration Format (SCIF) apps, which are integrated directly into singularity. If you haven't already, check out the [Singularity app documentation](docs-scif-apps) to come up to speed.
191193

192194
First off, we're going to move the installation of the `url-to-pdf-api` into an app, so that there is a designated spot to place output files. To do that, we want to add a section to our definition file to build the server:
193195

@@ -241,4 +243,4 @@ google.pdf
241243

242244
## Important Notes
243245

244-
- The instances are linked with your user. So if you start an instance with sudo, that is going to go under root, and you will need to call `sudo singularity instance.list` in order to see it.
246+
- The instances are linked with your user. So if you start an instance with sudo, that is going to go under root, and you will need to call `sudo singularity instance.list` in order to see it.

0 commit comments

Comments
 (0)