Deploy

Deploying NOMAD Archive and Analytics

This is adapted for labtest, you might need to change things on other machines

Kubernetes and Docker

As described in a separate page Kubernetes and Docker are a precondition, there are several ways to install them, see my last install.

If the content of the NOMAD archive should be accessible you also need its data available, normally in /nomad/nomadlab/raw-data/data the zip Archives with the original data, and in /nomad/nomadlab/normalized/productionH5 the normalized data. http://data.nomad-coe.eu is one way to get it.

The general infrastructure overview is described in the infrastructure page, here we just give the commands, with some comments.

Get the code

mkdir -p /nomad/nomadlab/servers/$(hostname)
cd /nomad/nomadlab/servers/$(hostname)
git clone -b v1.13 git@gitlab.mpcdf.mpg.de:nomad-lab/nomad-lab-base.git

Deploy all services

cd nomad-lab-base/deploy
# labdev-nomad
     ./deploy/deploy.sh --env labdev-nomad --target-hostname labdev-nomad --secret-web-certs web-certs > deploy/deploy.cmds
# labtest-nomad
     ./deploy/deploy.sh --env labtest-nomad --target-hostname labtest-nomad --secret-web-certs web-certs --debug > deploy/deploy.cmds

To rebuild a new docker image add --update-docker

Looks and execute deploy/deploy.cmds

The last commands are for the service dumper, this runs a pod that dumps the information on how to access all services and is then used by the frontend. You should re-run it if you change the kubernetes service entries (which you probably won’t, you will change just the deployment that performs them). It is possible to modify the yaml file to make it run periodically (just look at the comments in the yaml file).

cd ..

Container Manager by itself

The container manager commands are contained in the previous ones, but it is possible to just get and execute those by

cd container-manager/deploy
./deploy.sh > deploy.cmds

Frontend

The frontend is the entry point for all connections to NOMAD. It has to run on a machine that is reachable from internet. Setting it up has two steps, as described in frontend-nginx/Readme.md:

  1. Create the configuration file for it using the information created by the service dumper:
    docker run -ti -v $PWD:/frontend -v /nomad/nomadlab/servers/labdev-nomad/analytics/beaker:/usr/src/app -w /usr/src/app -v /nomad/nomadlab/servers/services-info:/services-info --rm node:carbon bash -c 'npm install; node app.js templateEvaluer --replacements /services-info/labtest-nomad.services.yaml --replacements /frontend/config/labtest-nomad.yaml --template /frontend/nginx.conf.in --out-file /frontend/nginx-labtest-nomad.conf'
    
  2. Run nginx with that configuration, either with docker or directly on the machine or with docker:
    docker run -d   --restart=unless-stopped   -v /root/certs:/certs:ro   -v /nomad/nomadlab/servers/labtest-nomad/web-certs:/web-certs:ro   -v /nomad/nomadlab/servers/labtest-nomad/frontend-nginx/nginx-labtest-nomad.conf:/etc/nginx/nginx.conf:ro   -v /nomad/nomadlab/servers/labtest-nomad/frontend-nginx/www-root:/usr/share/nginx/html:ro   -v /nomad/nomadlab/servers/labtest-nomad/frontend-nginx/client_temp:/etc/nginx/client_temp  -v /nomad/nomadlab/servers/labtest-nomad/frontend-nginx/cache:/var/cache/nginx -v /nomad/nomadlab/servers/labtest-nomad/frontend-nginx/run:/var/run -p 80:80 -p 443:443 -p 5509:5509 --name frontendNginx nginx
    

Hopefully all is up and running…

Leave a comment

Comments are moderated. Your email address is neither published nor stored, only an md5 hash of it. Required fields are marked with *

Loading...