Kitware / minerva

Minerva: client/server/services for analysis and visualization
Apache License 2.0
36 stars 14 forks source link

Dockerize Minerva #338

Closed aashish24 closed 8 years ago

aashish24 commented 8 years ago

For now we just need:

1) MongoDB 2) CherryPy

To be running inside the container.

jbeezley commented 8 years ago

It's on dockhub as jbeezley/minerva. Docker makes it nearly impossible to daemonize a process inside container so we can't really serve both in one container without jumping through a lot of hoops. With the minerva container, you have to provide a URI to a running mongo server like this:

docker run -p 8080:8080 jbeezley/minerva -d mongodb://<mongo server>:27017/girder

Another option is to use docker compose to launch two containers together. There is an example of this in Girder's repo.

aashish24 commented 8 years ago

It's on dockhub as jbeezley/minerva.

thanks @jbeezley. Also, can you post / push script that creates the docker container.

Docker makes it nearly impossible to daemonize a process inside container so we can't really serve both in one container without jumping through a lot of hoops.

I see.

With the minerva container, you have to provide a URI to a running mongo server like this:

docker run -p 8080:8080 jbeezley/minerva -d mongodb://:27017/girder

And this mongo server will be somewhere outside the docker I am assuming?

Another option is to use docker compose to launch two containers together. There is an example of this in Girder's repo.

Can we try this then?

danlamanna commented 8 years ago

+1 for using multiple containers, it quickly becomes a mess otherwise. I ran into similar issues with Terra and ended up using something similar to docker-compose here.

jbeezley commented 8 years ago

A repo containing the docker file and docker-compose file is here: https://github.com/OpenGeoscience/minerva-docker

aashish24 commented 8 years ago

Cool thanks @jbeezley

aashish24 commented 8 years ago

@jbeezley once the docker creates the container, does user need to run Minerva manually or would that be running already?

aashish24 commented 8 years ago

@jbeezley running into this issue:

[chaudhary@einstein minerva-docker (master)]$ docker build . Sending build context to Docker daemon 15.74 MB Sending build context to Docker daemon Step 0 : FROM girder/girder Pulling repository girder/girder INFO[0001] Could not reach any registry endpoint

What docker version you are using?

danlamanna commented 8 years ago

I just spun this up out of curiosity, this worked for me (on Docker 1.9.1):

docker build -t minerva-docker .
docker run --name some-mongo -d mongo
docker run -p 8080:8080 --link some-mongo:some-mongo  minerva-docker --database mongodb://some-mongo:27017/girder
aashish24 commented 8 years ago

thanks @danlamanna I believe it is a docker version issue. Mine was 1.5.4 or something like that.

jbeezley commented 8 years ago

I updated the docker compose file in the repo to build the minerva image rather than pulling it. I think I also fixed the error you were getting. Newer versions of docker expect volumes to be provided as absolute paths. It works for me on the latest versions:

$ docker --version
Docker version 1.10.3, build 20f81dd
$ docker-compose --version
docker-compose version 1.6.2, build 4d72027
$ docker-machine --version
docker-machine version 0.6.0, build e27fb87
aashish24 commented 8 years ago

thanks @jbeezley this is great.

docker-composer up seems to be working now (its running).

aashish24 commented 8 years ago

@jbeezley everthing seems to be up and running in my initial testing. I am closing it now.

mgrauer commented 8 years ago

What is the right way of bringing this up?

I have Docker 1.11.0 running on Ubuntu 14.04, and cloned the minerva-docker repo.

I tried docker build -t minerva-docker . in my minerva-docker clone dir, following the steps laid out by @danlamanna, but I got

Sending build context to Docker daemon 72.7 kB Step 1 : FROM girder/girder latest: Pulling from girder/girder 3b8d91fe7572: Pull complete a3ed95caeb02: Pull complete dfc6505cfad4: Pull complete 47b142d56ce3: Pull complete 6397456b1db0: Pull complete c77c6a59d5d3: Pull complete 7b775c2eb5f2: Pull complete 40347c03ae0e: Pull complete c8ab3613a5a1: Pull complete 1f24c31556c0: Pull complete 6beda0d0c1ee: Pull complete 5aac8c773d32: Pull complete a5e8bdad0462: Pull complete 019415c46282: Pull complete 996277474b43: Pull complete 785059ea84e4: Pull complete b13061966a21: Pull complete 7531b5def107: Pull complete cd726e2f6358: Pull complete 30380205b9e4: Pull complete 92541dd9aab8: Pull complete 58ca923fcaad: Pull complete 1b4832f18664: Pull complete Digest: sha256:eaff90837e74384888569703ddd3af1ee6d2eb24d0af182e66ff94e3d37f1fb1 Status: Downloaded newer image for girder/girder:latest ---> aaae6a5c2293 Step 2 : ADD romanesco /girder/plugins/romanesco ---> dadeef7c3d9a Removing intermediate container 34e2a0916287 Step 3 : RUN pip install -e /girder/plugins/romanesco ---> Running in 75484d7622af Directory '/girder/plugins/romanesco' is not installable. File 'setup.py' not found. The command '/bin/sh -c pip install -e /girder/plugins/romanesco' returned a non-zero code: 1

jbeezley commented 8 years ago

Make sure the git submodules are initialized.

aashish24 commented 8 years ago

git submodule update --init