dice-group / sask

Projectgroups Search and Extraction
GNU Affero General Public License v3.0
2 stars 10 forks source link

Docker #71

Closed KHaack closed 6 years ago

KHaack commented 6 years ago

Setup the project for docker support. In addition to the windows and linux profiles, we introduced docker and local.

For example, if you want to run the eureka-server on your local windows machine you can use the following command:

mvn clean spring-boot:run -P local,windows

If you want to build a Docker container from a microservice, use the following command: You need to run this command on a linux machine

sudo mvn clean install dockerfile:build -P docker,linux

To run a docker container use:

sudo docker run -p 8761:8761 -v /logs/:/logs --net sask --name "eureka-server" -t dicegroup/sask-eureka

This works for all microservices.

In addition, the docker run command from fuseki and hadoop are slightly different from the local ones.

sudo docker run -it -p 50070:50070 -p 50075:50075 -p 2401:8088 --net sask --name "hadoop" -h hadoop sequenceiq/hadoop-docker:2.7.0 /etc/bootstrap.sh -bash -u $(date -u +%m%d%H%M%Y)
sudo docker run -d --name fuseki --net sask -p 3030:3030 -v /ssd/data/fuseki:/fuseki stain/jena-fuseki:3.4.0
guruprasads7 commented 6 years ago

@KHaack, does the chatbot application work properly when run in a docker containers. Cause in this version of code, the chatbot references to resource directories via path src/main/resources. But this was not available inside docker containers as it is packaged as an executable jar.

The fix was to load the resources via Spring classpath.

Since we only need a bare minimum java to run our application, can we use a slim version of the docker base image found in https://hub.docker.com/_/openjdk/ , cause if we take a standard java image, each docker image for each microservice will be around 700 MB or so, which creates lot of bandwadith usage for each commit as finally the intention is to use run them as part of travis CI for each pull request.

KHaack commented 6 years ago

yeah i was looking for a config file, where can i find it? then i would use the mvn profiles for configuration. :)

the problem with the java version is, that there is no supported java 9 version anymore. you will find there only 8 and 10 :P oracle canceled the supported in march '18 and since then its hard to find java 9.

prasanthhs commented 6 years ago

@KHaack I think @guru5590 modified the code of chatbot in his branch to change to using class path to solve the src/main/resources problem. Because chatbot causes some issues with any user input inside a docker.

@guru5590 Can you please point to the files?

guruprasads7 commented 6 years ago

Hi Kevin,

Can we introduce a yaml config file, for all the environment variables like the docker base image, ports (if needed dependencies between microservices). Then we could read it via java code or the deployment scripts.

We can use open jdk images instead of oracle jdk. The good thing would be openjdk comes security patches Instead of we needing to manage it in oracle jdk. And there is lot more open source maintenance on these images.

I think I have use openjdk9-slim version. It’s in the ci-deployment branch under playbooks folder.

Thanks, Guru

On Sun 8. Jul 2018 at 11:51, Kevin Haack notifications@github.com wrote:

yeah i was looking for an config file, where can i find it? then i would use the mvn profiles for configuration. :)

the problem with the java version is, that there is no supported java 9 version anymore. you will find there only 8 and 10 :P oracle canceled the supported in march '18 and since then its hard to find java 9.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/dice-group/sask/pull/71#issuecomment-403276038, or mute the thread https://github.com/notifications/unsubscribe-auth/AHcXu36zWvZmxPP6buKh9Ko2GQr4goysks5uEdYngaJpZM4VGUau .

guruprasads7 commented 6 years ago

Prashanth it’s in ci-deployment branch. @kevin can we meet tomorrow in the project. Actually there are many things we can reuse among our code, instead of rewriting the same.

Thanks, Guru

On Sun 8. Jul 2018 at 15:16, Prashanth notifications@github.com wrote:

@KHaack https://github.com/KHaack I think @guru5590 https://github.com/guru5590 modified the code of chatbot in his branch to change to using class path to solve the src/main/resources problem. Because chatbot causes some issues with any user input inside a docker.

@guru5590 https://github.com/guru5590 Can you please point to the files needed to be merged here?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/dice-group/sask/pull/71#issuecomment-403287153, or mute the thread https://github.com/notifications/unsubscribe-auth/AHcXuxsrmK3y93OQeAOAQOuRzlBsoYLEks5uEgYrgaJpZM4VGUau .

KHaack commented 6 years ago

I think openjdk is not longer available in version 9.

And I think we shouldnt make bigger changes then this. I can merge this little chatbot changes. Then we are ready, everything else is documented in the wiki :) but we can talk tomorrow :)

guruprasads7 commented 6 years ago

@KHaack , I had added the changes needed for dockerizing chatbot application.

@prasanthhs , if the changes are fine, please merge it to master