diff --git a/.gitignore b/.gitignore index 062fd81..55a2dc3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ logs graphs elevation_cache data - +ors/openrouteservice diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index caf052e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM ubuntu:18.04 - -ENV VROOM_BRANCH master -RUN mkdir -p /src && \ - cd /src && \ - apt-get update && \ - apt-get install -qq \ - build-essential \ - g++ \ - git-core \ - libboost-all-dev \ - make \ - pkg-config && \ - git clone https://github.com/GIScience/vroom.git && \ - cd /src/vroom && \ - mkdir -p /src/vroom/bin && \ - cd /src/vroom/src && \ - make && \ - cp /src/vroom/bin/vroom /usr/local/bin && \ - apt-get clean && \ - cd / - -RUN git clone https://github.com/VROOM-Project/vroom-express.git /vroom-express - -#RUN mkdir /vroom-express -#ADD ./vroom-express /vroom-express -#TODO volume - -ENV VROOM_EXPRESS_BRANCH master -RUN apt-get update && \ - apt-get install -qq \ - npm \ - nodejs && \ - cd /vroom-express && \ - npm install && \ - apt-get clean - -#COPY config.js /vroom-express/src/config.js -#used volumes on run - -EXPOSE 3000 -CMD ["npm", "start", "--prefix", "/vroom-express"] diff --git a/README.md b/README.md index a32d7a0..5253142 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # docker-ors-vroom -* test.json example of vroom problem -* test.sh send test.json to vroom +## Setup + +```bash +git clone https://github.com/GIScience/openrouteservice.git ./ors/openrouteservice +``` + +* vroom/test.json example of vroom problem +* vroom/test.sh send test.json to vroom + +* example.ipynb python notebook to test Optimization Routing by ors python binding diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index 089bcae..a741f50 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,33 +4,33 @@ networks: driver: bridge services: ors: - container_name: ors-smartbin + container_name: smartbin-ors #TODO build ports: ["8080:8080"] - image: docker_ors-smartbin:latest + image: smartbin-ors:latest build: - context: ../openrouteservice/ + context: ./ors/openrouteservice/ + #dockerfile: ./ors/openrouteservice/Dockerfile args: - # APP_CONFIG: ../docker-ors-vroom/ors.config - # OSM_FILE: ../docker-ors-vroom/data/povo.osm.gz + #APP_CONFIG: ../config.json + #OSM_FILE: ../../data/povo.osm.gz JAVA_OPTS: -Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g CATALINA_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost volumes: - - ./ors-config.json:/ors-core/openrouteservice/src/main/resources/app.config + - ./ors/config.json:/ors-core/openrouteservice/src/main/resources/app.config - ./data/povo.osm.gz:/ors-core/data/osm_file.pbf - - ./graphs:/ors-core/data/graphs - - ./elevation_cache:/ors-core/data/elevation_cache + - ./graphs/:/ors-core/data/graphs + - ./elevation_cache/:/ors-core/data/elevation_cache - ./logs/:/var/log/ors/ - ./logs/:/usr/local/tomcat/logs vroom: - container_name: vroom-smartbin - image: vroom-ors:latest + container_name: smartbin-vroom + image: smartbin-vroom:latest build: - context: ./ - - ports: ["8083:3000"] + context: ./vroom/ + ports: ["3000:3000"] volumes: - - ./vroom-config.js:/vroom-express/src/config.js + - ./vroom/config.js:/vroom-express/src/config.js #vroom-test: # image: nginx diff --git a/elevation_cache/.gitkeep b/elevation_cache/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/optimization.ipynb b/example.ipynb similarity index 100% rename from optimization.ipynb rename to example.ipynb diff --git a/ors-config.json b/ors/config.json similarity index 100% rename from ors-config.json rename to ors/config.json diff --git a/vroom-start.sh b/vroom-start.sh deleted file mode 100755 index e5f687a..0000000 --- a/vroom-start.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -#-v /home/z4k/routing-engines/vroom/config.js:/vroom-express/src/config.js -docker run --name vroom -d -p 8083:3000 vroom-ors diff --git a/vroom-test.sh b/vroom-test.sh deleted file mode 100755 index b2b46d7..0000000 --- a/vroom-test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# - -curl -d @vroom-problem.json -X POST -H "Content-Type: application/json" http://localhost:8083 diff --git a/vroom/Dockerfile b/vroom/Dockerfile new file mode 100644 index 0000000..6ac3877 --- /dev/null +++ b/vroom/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:18.04 + +RUN apt-get update +RUN mkdir -p /src +RUN cd /src + +ENV VROOM_BRANCH master +RUN apt-get install -qq \ + build-essential \ + g++ \ + git-core \ + libboost-all-dev \ + make \ + pkg-config && \ + git clone https://github.com/GIScience/vroom.git /src/vroom && \ + mkdir -p /src/vroom/bin && \ + cd /src/vroom/src && \ + make && \ + cp /src/vroom/bin/vroom /usr/local/bin/ + +RUN cd / + +ENV VROOM_EXPRESS_BRANCH master +#RUN apt-get update && \ +RUN apt-get install -qq \ + npm \ + nodejs && \ + git clone https://github.com/VROOM-Project/vroom-express.git /vroom-express && \ + cd /vroom-express && \ + npm install + +#COPY config.js /vroom-express/src/config.js + +RUN apt-get clean && cd / + +EXPOSE 3000 +CMD ["npm", "start", "--prefix", "/vroom-express"] diff --git a/vroom-config.js b/vroom/config.js similarity index 97% rename from vroom-config.js rename to vroom/config.js index 2d1a06d..48b0617 100644 --- a/vroom-config.js +++ b/vroom/config.js @@ -38,8 +38,8 @@ const routingServers = { port: '8080' }, 'car': { - host: '0.0.0.0', - port: '5000' + host: 'ors', + port: '8080' } }; diff --git a/vroom-problem.json b/vroom/test.json similarity index 100% rename from vroom-problem.json rename to vroom/test.json diff --git a/vroom/test.sh b/vroom/test.sh new file mode 100755 index 0000000..0addfc2 --- /dev/null +++ b/vroom/test.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# + +curl -d @test.json -X POST -H "Content-Type: application/json" http://localhost:3000