From 2a01eda564bef06bf7142d062b7e5b57559774e3 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 2 Dec 2020 13:53:29 +0100 Subject: [PATCH 1/4] add Dockerfile & .dockerignore --- .dockerignore | 3 +++ Dockerfile | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7904451 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/build + +/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5012f35 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM debian:buster-slim AS builder + +WORKDIR /app + +RUN apt-get update && \ + apt-get install -y g++ cmake git + +ADD . /app +RUN mkdir build && \ + cd build && \ + cmake .. && \ + make -j && \ + pwd && \ + make install + +FROM debian:buster-slim + +RUN apt-get update && \ + apt-get install -y libgomp1 && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=builder /usr/local/etc/pfaedle /usr/local/etc/pfaedle +COPY --from=builder /usr/local/bin/pfaedle /usr/local/bin/pfaedle + +ENTRYPOINT ["/usr/local/bin/pfaedle"] From 4aa500b867b75d846b5861600f4293646c4fb138 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 2 Dec 2020 13:53:50 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Travis=20CI:=20build=20&=20publish=20Docker?= =?UTF-8?q?=20image=20=F0=9F=92=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 1 + .travis.yml | 7 +++++++ push-docker-image.sh | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 push-docker-image.sh diff --git a/.dockerignore b/.dockerignore index 7904451..9ea4a81 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ /build /Dockerfile +/push-docker-image.sh diff --git a/.travis.yml b/.travis.yml index 81a0719..85eb9f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,13 @@ before_script: script: - make -j4 - ctest --verbose + - docker build -t ad-freiburg/pfaedle . + +deploy: + on: + branch: master + provider: script + script: bash push-docker-image.sh notifications: email: diff --git a/push-docker-image.sh b/push-docker-image.sh new file mode 100644 index 0000000..902bf39 --- /dev/null +++ b/push-docker-image.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -ex +set -o pipefail + +echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +docker push ad-freiburg/pfaedle \ No newline at end of file From 9a8a64d38ee075641d64be742f28fc433bb6181b Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 2 Dec 2020 17:53:31 +0100 Subject: [PATCH 3/4] =?UTF-8?q?readme:=20explain=20docker=20usage=20?= =?UTF-8?q?=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index c21c924..a860d35 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,20 @@ input GTFS feed and the input configuration. This can be used to avoid parsing (for example) the entire `planet.osm` on each run. +## via Docker + +You can use the [`ad-freiburg/pfaedle` Docker image](https://hub.docker.com/repository/docker/ad-freiburg/pfaedle) by mounting the OSM & GTFS data into the container: + +```shell +docker run -i --rm \ + # mount OSM data + --volume /path/to/osm/data:/osm \ + # mount GTFS data + --volume /path/to/gtfs/data:/gtfs \ + # tell pfaedle where to find the data + pfaedle -x /osm/osm-data.xml -i /gtfs +``` + ## Debugging The following flags may be useful for debugging: From b9897bdd97a103d2960e3505c512b7c1751f6ae7 Mon Sep 17 00:00:00 2001 From: Patrick Brosi Date: Wed, 2 Dec 2020 19:26:40 +0100 Subject: [PATCH 4/4] add docker pw and uname --- .travis.yml | 39 ++++++++++++++++++--------------------- push-docker-image.sh | 2 +- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 85eb9f0..9087d87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,40 +1,37 @@ language: cpp - os: - - linux - - osx - +- linux +- osx compiler: - - gcc - - clang - +- gcc +- clang addons: apt: sources: - - ubuntu-toolchain-r-test + - ubuntu-toolchain-r-test packages: - - cmake - + - cmake before_install: - - export LD_LIBRARY_PATH=$(if [[ $CXX == "clang++" ]]; then echo -n '/usr/local/clang/lib'; fi) - +- export LD_LIBRARY_PATH=$(if [[ $CXX == "clang++" ]]; then echo -n '/usr/local/clang/lib'; + fi) before_script: - - mkdir build - - cd build - - cmake .. - +- mkdir build +- cd build +- cmake .. script: - - make -j4 - - ctest --verbose - - docker build -t ad-freiburg/pfaedle . - +- make -j4 +- ctest --verbose +- docker build -t ad-freiburg/pfaedle . deploy: on: branch: master provider: script script: bash push-docker-image.sh - notifications: email: on_success: never on_failure: always +env: + global: + - secure: W60bRWv9u28UFjmt1iO5ELtPBvUNkAPqiwwxd+boy7BazAJ0fUUBZoEpnsgv8pqKWJV6VMUvknP4taU5a6NM+3aRHuCZOjVC42Rs8oDGJoXrhmH9ZzOOp2nDnHy9hqrtRKJrYQUww+s7UjBpWcaorqHvo5iWNrt9OulKM+V2u6IQI3xI1bPoaVhK/EnHHFAWe52v0KOkaSjguL5zj7xZqCeaZKmX9PsiQdqQJVtX2zsdF/aDkDvhkAl4SxeVKrFEVDV4gPx7yqGC/uQ6YJrQXigqpWWL6oZ1cxsg2HWqLZyAYN8tIWcnaAW8+PVYLfH1iTDb6fnokD4DPpVfULz4dzqOnTuG+Qd97U2BVDJN+LdxK2d8RZ1KLAWNbFGBlkY/8zpMAtV/xhGk2vHg/pj6ZPUPncNlOzUepASw5yCY7H6SOH1NgzNNSn+Fg3Q+6eUoYWp5jrpejBcwO/tikRCfGOSNyEKTC+1joRNwySeLjTcLDcaO3+EJL64YjIKW1+YwVFopq5DKRhzjSyO+dUryA5+l+nT499BC9dxA7SvQ/tLwMs3uPlVhSDUvkH6DxiWIJQEYmTZIEA4JmLjdBFDB9FaApubvn5wRIlL07Dbq+t3XxMciWeLU3H2IQzlGPQpIbqB93L8yc6eH5Fq2Gu4HN5lmpJC3ZLpZOEqNk1kcFzo= + - secure: b10JKrMacKD+C8yGHPiOYP84ykXqBFiwm2wkcKn9SkGO6bDCtRIM+/eYMN64wQVD54Vwc/rfxqCRN6ckdAgw1zrtBdlRLz1krdwsdb7RuXJvTTTu3bd8CrtlsvcVh40vcItcFAQQKhKrPF/iDajbXm4GaVcoiqV8i8inhhfg063guC22o3D76J3xFmwyhNGv0QZuK7xG0O2h+mflU/LE8FuXrVO4+1QmvwJ9JRgBnz5F8jrEuZWipp3gJBVnpYHv4ZAy5r52zQ3iPEkji7Y6/GjvxYnjc08QM998I3SSlUuW4quiEPJFTGxK9w/UV34c0DJhzluJ3TGTz+RkhejIDUcNiKqFKWZCzCwzcx5f96RmTh7MTHulB7zTkK0hzSSPFjrYrRrkN/FCwMrHaLs1H3SQbXiB2Ga2pnfaOVfCbM5KraZHlk2xHUIqVHkhyetETBW76d4g6vxjNoe++siyx+eUW2VMj7Y+6c1HQPceGi+jpl9pJK6ZXKfVpfWjFj29qqnv7lNjoI3PXGllswDV4KxP/A5A4MBqHAcVOFEdTro5EReUhepyNYM7lUaS//Wa6DzE6US13bVpIr4fC+bKUf8XizfGp+f9TSc+Shl0J6asejxIbgQRCopTJd805xAFoCsoK1yt/sZIplBO/mjaBjLc9Y1+A04VH5FQWl92rHQ= diff --git a/push-docker-image.sh b/push-docker-image.sh index 902bf39..af6f3fb 100644 --- a/push-docker-image.sh +++ b/push-docker-image.sh @@ -3,4 +3,4 @@ set -ex set -o pipefail echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -docker push ad-freiburg/pfaedle \ No newline at end of file +docker push adfreiburg/pfaedle