@@ -14,8 +14,8 @@ or services.
1414
1515Singularity compose uses Singularity on the backend, so anything that would require sudo (root)
1616permissions for Singularity is also required for Singularity compose. This includes most
17- networking commands (e.g., asking to allocate ports) and builds from recipe files.
18- However, if you are using Singularity v3.3 or higher, you can take advantage of
17+ networking commands (e.g., asking to allocate ports) and builds from recipe files.
18+ However, if you are using Singularity v3.3 or higher, you can take advantage of
1919[ fakeroot] ( https://sylabs.io/guides/3.3/user-guide/fakeroot.html ) to try and get around this.
2020The snippet below shows how to add fakeroot as an option under a build section:
2121
@@ -32,17 +32,38 @@ And a complete example is provided [here](https://github.com/singularityhub/sing
3232
3333## Getting Started
3434
35+ ### Install
36+
37+ Note that you can install from pip:
38+
39+ ` ` ` bash
40+ $ pip install singularity-compose
41+ ```
42+
43+ If you want to run ` singularity-compose check ` you'll need jsonschema:
44+
45+ ``` bash
46+ $ pip install singularity-compose[checks]
47+ ```
48+
49+ To get full dependencies including those for testing and the above:
50+
51+ ``` bash
52+ $ pip install singularity-compose[all]
53+ ```
54+
55+
3556### Dependencies
3657
37- Singularity Compose *must* use a version of [Singularity](https://sylabs.io/guides/latest/user-guide/)
58+ Singularity Compose * must* use a version of [ Singularity] ( https://sylabs.io/guides/latest/user-guide/ )
38593.2.1 or greater. It's recommended to use the latest (3.3.0 release at the time of this writing) otherwise there was
3960a bug with some versions of 3.2.1. Singularity 2.x absolutely will not work.
4061Python 3 is also required, as Python 2 is at end of life.
4162
4263### singularity-compose.yml
4364
4465For a singularity-compose project, it's expected to have a ` singularity-compose.yml `
45- in the present working directory. You can look at a simple example here, here is a
66+ in the present working directory. You can look at a simple example here, here is a
4667version 1.0 spec (before we added networking and exec options):
4768
4869``` yaml
@@ -60,7 +81,7 @@ instances:
6081 - 80:80
6182` ` `
6283
63- and [here](https://github.com/singularityhub/singularity-compose-examples/tree/4241ea8b4e068d93859acb7d2b924702815af0ce/v2.0/ping)
84+ and [here](https://github.com/singularityhub/singularity-compose-examples/tree/4241ea8b4e068d93859acb7d2b924702815af0ce/v2.0/ping)
6485is a version 2.0 spec that shows adding networking and exec options:
6586
6687` ` ` yaml
@@ -77,7 +98,7 @@ instances:
7798 options :
7899 - fakeroot
79100 exec :
80- options:
101+ options :
81102 - " env-file=myvars.env"
82103 command : printenv SUPERHERO
83104 alp2 :
@@ -95,17 +116,17 @@ instances:
95116 - alp1
96117` ` `
97118
98- If you are familiar with [docker-compose](https://docs.docker.com/compose/)
99- the file should look very familiar. A key difference is that instead of
100- " services" we have "instances." And you guessed correctly - each
101- section there corresponds to a
119+ If you are familiar with [docker-compose](https://docs.docker.com/compose/)
120+ the file should look very familiar. A key difference is that instead of
121+ "services" we have "instances." And you guessed correctly - each
122+ section there corresponds to a
102123[Singularity instance](https://sylabs.io/guides/3.2/user-guide/running_services.html)
103124that will be created. In this guide, we will walk through each of the sections
104125in detail.
105126
106127### Instance folders
107128
108- Generally, each section in the yaml file corresponds with a container instance to be run,
129+ Generally, each section in the yaml file corresponds with a container instance to be run,
109130and each container instance is matched to a folder in the present working directory.
110131For example, if I give instruction to build an ` nginx` instance from
111132a `nginx/Singularity.nginx` file, I should have the
@@ -155,15 +176,15 @@ This will pull a container `nginx.sif` into a `nginx` context folder:
155176```
156177
157178It's less likely that you will be able to pull a container that is ready to
158- go, as typically you will want to customize the
159- [ startscript] ( https://sylabs.io/guides/3.2/user-guide/definition_files.html#startscript )
179+ go, as typically you will want to customize the
180+ [ startscript] ( https://sylabs.io/guides/3.2/user-guide/definition_files.html#startscript )
160181for the instance. Now that we understand the basic organization, let's
161182bring up some instances.
162183
163184## Quick Start
164185
165- For this quick start, we are going to use the
166- [ singularity-compose-simple] ( https://www.github.com/singularityhub/singularity-compose-simple )
186+ For this quick start, we are going to use the
187+ [ singularity-compose-simple] ( https://www.github.com/singularityhub/singularity-compose-simple )
167188example. Singularity has a networking issue that currently doesn't allow communication
168189between multiple containers (due to iptables and firewall issues) so for now the most we
169190can do is show you one container. First, install singularity-compose from pip:
@@ -255,7 +276,7 @@ $ singularity-compose exec app uname -a
255276```
256277
257278When you open your browser to [ http://127.0.0.1 ] ( http://127.0.0.1 )
258- you should see the upload interface.
279+ you should see the upload interface.
259280
260281![ img/upload.png] ( img/upload.png )
261282
@@ -277,7 +298,7 @@ The images that you upload are stored in `images` at the root:
277298
278299``` bash
279300$ ls images/
280- 2018-02-20-172617.jpg 40-acos.png _upload
301+ 2018-02-20-172617.jpg 40-acos.png _upload
281302```
282303
283304And static files are in ` static ` .
@@ -349,7 +370,7 @@ $ singularity instance start \
349370
350371Control and customization of these instances is probably the coolest (and not widely
351372used) feature of Singularity. You can create your own network configurations,
352- and customie the arguments to the command. Read [ here] ( https://sylabs.io/guides/3.2/user-guide/running_services.html ) for more detalis.
373+ and customize the arguments to the command. Read [ here] ( https://sylabs.io/guides/3.2/user-guide/running_services.html ) for more detalis.
353374
354375## Commands
355376
@@ -360,7 +381,7 @@ Python API, see [here](/singularity-compose/api/).
360381
361382The [ specification] ( spec/ ) describes in more detail the sections of the singularity-compose.yml.
362383For example, in the quick start above, we have a post command for the app instance
363- that creates a series of folders on the host.
384+ that creates a series of folders on the host.
364385
365386## Examples
366387
0 commit comments