gis-ops / docker-valhalla

This is our flexible Docker repository for the Valhalla routing engine
MIT License
233 stars 69 forks source link

Crash in configure_valhalla.sh #46

Closed flodaniel closed 2 years ago

flodaniel commented 2 years ago

I pulled your image today and use the template docker-compose.yml. However I get the following error:

image

It seems to wrongly build the path, as the pbf file is not located in custom_files/graphs but directly in custom_files.

This is my docker-compose.yml

version: "3.0"
services:
  valhalla:
    image: gisops/valhalla:latest
    container_name: valhalla_latest
    ports:
      - 8002:8002
    #build:
    #  context: .
    #  args:
    #    - VALHALLA_UID=1000
    #    - VALHALLA_GID=1000
    volumes:
      - ./custom_files:/custom_files
    environment:
      # Auto-download PBFs from Geofabrik
      # - "tile_urls=https://download.geofabrik.de/north-america/us/california-latest.osm.pbf https://download.geofabrik.de/europe/austria-latest.osm.pbf"
      - tile_urls=https://download.geofabrik.de/europe/austria-latest.osm.pbf
      - server_threads=2 # determines how many threads will be used to run the valhalla server
      - use_tiles_ignore_pbf=True # load existing valhalla_tiles.tar directly
      - build_elevation=False # build elevation with "True" or "Force": will download only the elevation for areas covered by the graph tiles
      - build_admins=False # build admins db with "True" or "Force"
      - build_time_zones=False # build timezone db with "True" or "Force"
      - build_tar=True # build an indexed tar file from the tile_dir for faster graph loading times
      - force_rebuild=False # forces a rebuild of the routing tiles with "True"
      - path_extension=graphs # this path will be internally appended to /custom_files; no leading or trailing path separator!
nilsnolde commented 2 years ago

huh curious. CI passed. will take a quick look myself

nilsnolde commented 2 years ago

ah right, so the path_extension env var was fairly recently introduced since we had a need for multi-container deployments on the same host referencing the same parent directory on the host so we needed subdirectories. seems there was a subtle bug there where curl didn't respect the output location properly and the only reason why it works in CI is bcs we don't actually download pbfs there but use a local one. shows again it's important to test all scenarios..

you don't have to wait for the docker image to build though @flodaniel . you can just nuke the custom_files folder on your host and start a fresh container, this time don't include path_reference as env var, then it should work. I amended the docker-compose.yml.template, it's really an advanced thing, shouldn't be in there.

flodaniel commented 2 years ago

awesome! thanks a lot for that quick and helpful reply :)