Commit c3da0947 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixes to the oasis documentation and operation.

parent ea062077
Pipeline #87071 passed with stages
in 23 minutes and 45 seconds
......@@ -86,6 +86,8 @@ services:
restart: always
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2
container_name: nomad_oasis_elastic
environment:
- discovery.type=single-node
volumes:
- nomad_oasis_elastic:/usr/share/elasticsearch/data
......@@ -133,8 +135,6 @@ services:
volumes:
- ./nomad.yaml:/app/nomad.yaml
- ./env.js:/app/gui/build/env.js
- ./gunicorn.log.conf:/app/gunicorn.log.conf
- ./gunicorn.conf:/app/gunicorn.conf
- nomad_oasis_files:/app/.volumes/fs
command: ["./run.sh", "/nomad-oasis"]
......@@ -162,7 +162,7 @@ There are no mandatory changes necessary.
A few things to notice:
- All services use docker volumes for storage. This could be changed to host mounts.
- It mounts three configuration files that need to be provided (see below): `nomad.yaml`, `nginx.conf`, `env.js`, `gunicorn.conf`, `gunicorn.log.conf`.
- It mounts three configuration files that need to be provided (see below): `nomad.yaml`, `nginx.conf`, `env.js`.
- The only exposed port is `80`. This could be changed to a desired port if necessary.
- The NOMAD images are pulled from our gitlab in Garching, the other services use images from a public registry (*dockerhub*).
- All container will be named `nomad_oasis_*`. These names can be used to later reference the container with the `docker` cmd.
......@@ -289,13 +289,19 @@ A few things to notice:
### gunicorn
Simply create empty `gunicorn.conf` and `gunicorn.log.conf` in the beginning. Gunicorn
is the WSGI-server that runs the nomad app. Consult the [gunicorn documentation](https://docs.gunicorn.org/en/stable/configure.html)
for configuration options.
Gunicorn is the WSGI-server that runs the nomad app. Consult the
[gunicorn documentation](https://docs.gunicorn.org/en/stable/configure.html) for
configuration options.
## Starting and stopping
If you prepared the above files, simply use the usual `docker-compose` commands to start everything.
To make sure you have the latest docker images for everything run this first:
```
docker-compose pull
```
In the beginning and for debugging problems, it is recommended to start services separately:
```
docker-compose up -d mongodb elastic rabbitmq
......
......@@ -24,6 +24,8 @@ services:
restart: always
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2
container_name: nomad_oasis_elastic
environment:
- discovery.type=single-node
volumes:
- nomad_oasis_elastic:/usr/share/elasticsearch/data
......@@ -42,7 +44,7 @@ services:
# nomad worker (processing)
worker:
restart: always
image: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:oasis-migration
image: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:stable
container_name: nomad_oasis_worker
environment:
<<: *nomad_backend_env
......@@ -59,7 +61,7 @@ services:
# nomad app (api + gui)
app:
restart: always
image: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:oasis-migration
image: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:stable
container_name: nomad_oasis_app
environment:
<<: *nomad_backend_env
......@@ -71,8 +73,6 @@ services:
volumes:
- ./nomad.yaml:/app/nomad.yaml
- ./env.js:/app/gui/build/env.js
- ./gunicorn.log.conf:/app/gunicorn.log.conf
- ./gunicorn.conf:/app/gunicorn.conf
- nomad_oasis_files:/app/.volumes/fs
command: ["./run.sh", "/nomad-oasis"]
......
[loggers]
keys=root, gunicorn.error, gunicorn.access
[handlers]
keys=console, access, error
[formatters]
keys=generic
[logger_root]
level=INFO
handlers=console
[logger_gunicorn.error]
level=INFO
handlers=error
qualname=gunicorn.error
[logger_gunicorn.access]
level=INFO
handlers=access
qualname=gunicorn.access
[handler_console]
class=StreamHandler
formatter=generic
args=(sys.stdout, )
[handler_access]
class=StreamHandler
formatter=generic
args=(sys.stdout, )
[handler_error]
class=StreamHandler
formatter=generic
args=(sys.stdout, )
[formatter_generic]
format=%(asctime)s [%(process)d] [%(levelname)s] %(message)s
datefmt=%Y-%m-%d %H:%M:%S
class=logging.Formatter
#!/bin/sh
find gui/build -type f -exec sed -i "s_/fairdi/nomad/latest/gui_$1/gui_g" {} \;
python -m gunicorn.app.wsgiapp --config gunicorn.conf --log-config gunicorn.log.conf -b 0.0.0.0:8000 nomad.app:app
\ No newline at end of file
#!/bin/bash
find gui/build -type f | xargs -L1 bash -c 'sed "s_/fairdi/nomad/latest/gui_$1/gui_g" $2 > /tmp/temp_file; cp /tmp/temp_file $2;' -- $1
params=()
[ -e gunicorn.conf ] && params+=(--config gunicorn.conf)
[ -e gunicorn.log.conf ] && params+=(--log-config, gunicorn.log.conf)
python -m gunicorn.app.wsgiapp "${params[@]}" -b 0.0.0.0:8000 nomad.app:app
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment