Browse Source

Update valhalla image to use Ubuntu 16.04

pull/28/head
John Wileczek 6 years ago
parent
commit
905a1dc373
  1. 11
      cmd/prepare.sh
  2. 54
      images/valhalla/Dockerfile
  3. 9
      projects/france/docker-compose.yml
  4. 9
      projects/los-angeles-metro/docker-compose.yml
  5. 9
      projects/portland-metro/docker-compose.yml
  6. 9
      projects/south-africa/docker-compose.yml

11
cmd/prepare.sh

@ -3,6 +3,8 @@ set -e;
# per-source prepares
function prepare_polylines(){ compose_run 'polylines' bash ./docker_extract.sh; }
# alternative creation method for polyline data using valhalla
function prepare_valhalla(){ compose_run 'valhalla' bash ./docker_build.sh; }
function prepare_interpolation(){ compose_run 'interpolation' bash ./docker_build.sh; }
function prepare_placeholder(){
compose_run 'placeholder' ./cmd/extract.sh;
@ -10,6 +12,7 @@ function prepare_placeholder(){
}
register 'prepare' 'polylines' 'export road network from openstreetmap into polylines format' prepare_polylines
register 'prepare' 'valhalla' 'export road network from openstreetmap into polylines format using valhalla' prepare_valhalla
register 'prepare' 'interpolation' 'build interpolation sqlite databases' prepare_interpolation
register 'prepare' 'placeholder' 'build placeholder sqlite databases' prepare_placeholder
@ -21,4 +24,12 @@ function prepare_all(){
prepare_interpolation
}
function prepare_all_valhalla(){
prepare_valhalla &
prepare_placeholder &
wait
prepare_interpolation
}
register 'prepare' 'all' 'build all services which have a prepare step' prepare_all
register 'prepare' 'all_valhalla' 'build all services which have a prepare step using valhalla for polylines' prepare_all_valhalla

54
images/valhalla/Dockerfile

@ -1,25 +1,35 @@
# base image
FROM pelias/baseimage
# grab all of the valhalla software from ppa
RUN apt-get update && \
apt-get install -y software-properties-common python-software-properties && \
add-apt-repository -y ppa:kevinkreiser/prime-server && \
add-apt-repository -y ppa:valhalla-routing/valhalla && \
apt-get update && \
apt-get install -y valhalla-bin && \
rm -rf /var/lib/apt/lists/*;
# change working dir
RUN mkdir -p /code/valhalla
WORKDIR /code/valhalla
# generate config
FROM ubuntu:16.04
# configure env
ENV DEBIAN_FRONTEND 'noninteractive'
RUN apt-get update && apt-get install -y locales apt-utils iputils-ping curl wget git-core autoconf automake libtool pkg-config python
RUN apt-get install -y software-properties-common && \
apt-get update
RUN add-apt-repository -y ppa:valhalla-core/valhalla && \
apt-get update
RUN apt-get install -y valhalla-bin
# configure volumes
VOLUME "/data"
# generate valhalla config
RUN valhalla_build_config \
--mjolnir-tile-dir '/data/valhalla' \
--mjolnir-tile-extract '/data/valhalla.tar' \
--mjolnir-timezone '/data/valhalla/timezones.sqlite' \
--mjolnir-admin '/data/valhalla/admins.sqlite' > valhalla.json
--mjolnir-tile-dir '/data/valhalla/valhalla_tiles' \
--mjolnir-tile-extract '/data/valhalla/valhalla_tiles.tar' \
--mjolnir-timezone '/data/valhalla/valhalla_tiles/timezones.sqlite' \
--mjolnir-admin '/data/valhalla/valhalla_tiles/admins.sqlite' > valhalla.json
# build script
RUN echo 'valhalla_build_tiles -c valhalla.json /data/openstreetmap/*.osm.pbf; valhalla_export_edges --config valhalla.json > /data/polylines/pbf_extract.polyline;' > ./docker_build.sh
# build script to build tiles and export polyline data.
RUN echo 'mkdir -p /data/valhalla/valhalla_tiles\n' \
'touch /data/valhalla/valhalla_tiles/timezones.sqlite\n' \
'touch /data/valhalla/valhalla_tiles/admins.sqlite\n' \
'mkdir -p /data/polylines\n' \
'valhalla_build_tiles -c valhalla.json /data/openstreetmap/*.osm.pbf;\n' \
'find /data/valhalla/valhalla_tiles | sort -n | tar cf /data/valhalla/valhalla_tiles.tar --no-recursion -T - \n' \
'valhalla_export_edges --config valhalla.json >> /data/polylines/extract.0sv;' > ./docker_build.sh

9
projects/france/docker-compose.yml

@ -10,7 +10,7 @@ services:
restart: always
ports: [ "4400:4400" ]
schema:
image: pelias/schema:portland-synonyms
image: pelias/schema:support_both_es2_and_es5_plus_portland_synonyms
container_name: pelias_schema
user: "${DOCKER_USER}"
volumes:
@ -100,3 +100,10 @@ services:
cap_add: [ "IPC_LOCK" ]
security_opt:
- seccomp=unconfined
valhalla:
container_name: pelias_valhalla
build: ../../images/valhalla
restart: "no"
volumes:
- "./pelias.json:/code/pelias.json"
- "${DATA_DIR}:/data"

9
projects/los-angeles-metro/docker-compose.yml

@ -10,7 +10,7 @@ services:
restart: always
ports: [ "4400:4400" ]
schema:
image: pelias/schema:portland-synonyms
image: pelias/schema:support_both_es2_and_es5_plus_portland_synonyms
container_name: pelias_schema
user: "${DOCKER_USER}"
volumes:
@ -115,3 +115,10 @@ services:
volumes:
- "./pelias.json:/code/pelias.json"
- "./test_cases:/code/pelias/fuzzy-tester/test_cases"
valhalla:
container_name: pelias_valhalla
build: ../../images/valhalla
restart: "no"
volumes:
- "./pelias.json:/code/pelias.json"
- "${DATA_DIR}:/data"

9
projects/portland-metro/docker-compose.yml

@ -10,7 +10,7 @@ services:
restart: always
ports: [ "4400:4400" ]
schema:
image: pelias/schema:portland-synonyms
image: pelias/schema:support_both_es2_and_es5_plus_portland_synonyms
container_name: pelias_schema
user: "${DOCKER_USER}"
volumes:
@ -118,3 +118,10 @@ services:
volumes:
- "./pelias.json:/code/pelias.json"
- "./test_cases:/code/pelias/fuzzy-tester/test_cases"
valhalla:
container_name: pelias_valhalla
build: ../../images/valhalla
restart: "no"
volumes:
- "./pelias.json:/code/pelias.json"
- "${DATA_DIR}:/data"

9
projects/south-africa/docker-compose.yml

@ -10,7 +10,7 @@ services:
restart: always
ports: [ "4400:4400" ]
schema:
image: pelias/schema:master
image: pelias/schema:support_both_es2_and_es5
container_name: pelias_schema
user: "${DOCKER_USER}"
volumes:
@ -123,3 +123,10 @@ services:
volumes:
- "./pelias.json:/code/pelias.json"
- "./test_cases:/code/pelias/fuzzy-tester/test_cases"
valhalla:
container_name: pelias_valhalla
build: ../../images/valhalla
restart: "no"
volumes:
- "./pelias.json:/code/pelias.json"
- "${DATA_DIR}:/data"

Loading…
Cancel
Save