Skip to content

Commit 624fea6

Browse files
Add smoke test for Docker image (#6313)
* Add smoke test for Docker image
1 parent 9688e48 commit 624fea6

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,31 @@ jobs:
5555
steps:
5656
- name: Check out the repo
5757
uses: actions/checkout@v3
58+
- name: Enable osm.pbf cache
59+
uses: actions/cache@v2
60+
with:
61+
path: berlin-latest.osm.pbf
62+
key: v1-berlin-osm-pbf
63+
restore-keys: |
64+
v1-berlin-osm-pbf
5865
- name: Docker build
5966
run: |
60-
docker build -f docker/Dockerfile .
67+
docker build -t osrm-backend-local -f docker/Dockerfile .
68+
- name: Test Docker image
69+
run: |
70+
if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then
71+
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
72+
fi
73+
TAG=osrm-backend-local
74+
# when `--memory-swap` value equals `--memory` it means container won't use swap
75+
# see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details
76+
MEMORY_ARGS="--memory=1g --memory-swap=1g"
77+
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
78+
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm
79+
docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm
80+
docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm &
81+
curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
82+
docker stop osrm-container
6183
6284
build-test-publish:
6385
needs: format-taginfo-docs
@@ -422,9 +444,9 @@ jobs:
422444
uses: actions/cache@v2
423445
with:
424446
path: ~/.conan
425-
key: conan-${{ matrix.name }}-${{ github.sha }}
447+
key: v2-conan-${{ matrix.name }}-${{ github.sha }}
426448
restore-keys: |
427-
conan-${{ matrix.name }}-
449+
v2-conan-${{ matrix.name }}-
428450
- name: Enable test cache
429451
uses: actions/cache@v2
430452
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- FIXED: Fix bug with reading Set values from Lua scripts. [#6285](https://github.com/Project-OSRM/osrm-backend/pull/6285)
1010
- FIXED: Bug in bicycle profile that caused exceptions if there is a highway=bicycle in the data. [#6296](https://github.com/Project-OSRM/osrm-backend/pull/6296)
1111
- Build:
12+
- ADDED: Add smoke test for Docker image. [#6313](https://github.com/Project-OSRM/osrm-backend/pull/6313)
1213
- CHANGED: Update libosmium to version 2.18.0. [#6303](https://github.com/Project-OSRM/osrm-backend/pull/6303)
1314
- CHANGED: Remove EXACT from find_package if using Conan. [#6299](https://github.com/Project-OSRM/osrm-backend/pull/6299)
1415
- CHANGED: Configure Undefined Behaviour Sanitizer. [#6290](https://github.com/Project-OSRM/osrm-backend/pull/6290)

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ if(ENABLE_CONAN)
474474
GENERATORS cmake_find_package
475475
KEEP_RPATHS
476476
NO_OUTPUT_DIRS
477+
OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake
477478
)
478479

479480
add_dependency_includes(${CONAN_INCLUDE_DIRS_BOOST})

0 commit comments

Comments
 (0)