Skip to content

Latest commit

 

History

History
134 lines (105 loc) · 4.52 KB

getting_started.md

File metadata and controls

134 lines (105 loc) · 4.52 KB

DaCHS on Docker

ToC


This repository contains the dockerfiles for GAVO DaCHS. You'll find the corresponding images in ['chbrandt/dachs' DockerHub repository][4]. DaCHS (or suite) is composed by a Postgres server in the background managed by the dachs-server which interfaces the database to the user.

The dockerfiles in here setup image families (with their respective tags):

  • chbrandt/dachs: DaCHS server + Postgres db -- used for testing only
  • chbrandt/dachs:server: the DaCHS data-manager/server suite
  • chbrandt/dachs:postgres: the Postgres db used by DaCHS

In this document we'll see how to run [Dachs-on-Docker][4], the containerized version of DaCHS.

For detailed information on DaCHS itself or Docker, please visit their official documentation, DaCHS/docs or [Docker/docs][5].

Command-lines running from the host system are prefixed by (host). And command-lines preceded by (dock) are run from inside the container.

Getting started

Docker image tags: latest,stable,bundle (and 1,1.4,all-in-one)

The "default" -- or latest, in Docker jargon -- is composed by dachs-server and postgresql. You run it by mapping the container's port (8080) to some on your host:

(host)$ docker run -it --name dachs -p 80:8080 chbrandt/dachs

, where we mapped the host's port 80 to container's 8080. Dachs settings included in this image are in bundle/etc.

Inside the container, to start the services work like in a normal machine:

(dock)$ service postgresql start
(dock)$ service dachs start

. You can also use a convenience dachs.sh script to start postgresql for you:

(dock)$ /dachs.sh start

You can now go to your host's 'http://localhost' to check DaCHS web interface.

To make a directory from the host system available from the container one can use the option argument '-v' to mount a volume at given location inside the container:

(host)$ docker run -it --name dachs -p 80:8080 \
                   -v /data/inputs/resourceX:/var/gavo/inputs/resourceX \
                   chbrandt/dachs

You can mount as many volumes (directories) as you want.

Inside the container, you can use dachs as you would on an usual machine. For instance, run DaCHS and load/pub "resourceX":

(dock)$ service postgresql start
(dock)$ service dachs start
(dock)$
(dock)$ cd /var/gavo/inputs
(dock)$ gavo imp resourceX/q.rd
(dock)$ gavo pub resourceX/q.rd
(dock)$
(dock)$ service dachs reload

If you want to test the services -- dachs-server and postgresql -- running separately, check section [DaCHS and PostgreSQL containers][].

Test migration

If you're using the container to test a new version to eventually migrate your database, you'll likely want to mount your VO/DaCHS resources as in the example above. To add security to your data -- if they are being shared with the data resource live in production -- you may want to use 'ro' (read-only) as an option for mounting points:

(host)$ docker run -v /data/rd/input:/var/gavo/inputs/input:ro \
                   -it --name dachs -p 80:8080 \
                   chbrandt/dachs

And then do the imports, publications, data access tests necessary to check for compatibility; and eventually migrate to the new version if/when everything is fine.

DaCHS 2

  • Docker image tags: beta,2,2-beta

DaCHS' version 2 is available as a beta version, which runs on Python-3. Because it is a major upgrade dachs has gone through, it is a good idea to test your data and services as extensively as possible.

To use the new version, just have to use the beta image:

(host)$ docker run -v /data/rd/input:/var/gavo/inputs/input:ro \
                   -it --name dachs -p 80:8080 \
                   chbrandt/dachs:beta

Everything should feel the same. Start docker (here through the convenience script left in your container's '/'), and use/test it as usual:

(dock)$ /dachs.sh start
9.6/main (port 5432): down
[ ok ] Starting PostgreSQL 9.6 database server: main.
[ ok ] Starting VO server: dachs.
(dock)$
(dock)$ dachs --version
Software (2.0.4) Schema (23/23)

/.\