Build graphs without starting server

Hello!

Is there any way to build graphs from OSM file without starting OpenRouteService as a server?

e.g. something like a standalone graph-builder or a build-only mode on ORS

Hey,

yes, that is possible. Have a look here - you can set the ors.services.routing.mode parameter in the ors-config.json to preparation, and the service will shut-down after building the graphs.

Best regards

Thanks @jschnell

Given this case, we are thinking of building the graphs as part of our CI pipeline and creating a final docker image with the graphs pre-copied inside.
This way it will not need to depend on shared volumes for graphs and also start-up time will be greatly improved.
Also when auto-releasing on envs new images with latest graphs, we will avoid the startup delay for new graphs building.
Do I miss something?

The trade-off will be the image size of course.

Nice to find this thread today, I’m doing this exact project @rolkool. I have the US map data in an image based from the community ORS image and that results in a ~40GB image. Biggest issue for me now is pulling this image and dealing with the layer cache bloat this adds to our k8s environment; we’ve gone the dedicated nodegroup route.

@jschnell, I’ve tried this parameter to prepare the graphs but unfortunately the tomcat server doesn’t shut down when the graphs are complete. The route module does seem to shut itself down and I’ve resorted to a backgrounded script to poll the health endpoint to know when it’s complete, then use tomcat’s shutdown script. Is there an another mechanism to get the docker-based configuration to shut itself down in preparation mode?

Hello @rolkool
I’m having the same problem, trying to integrate openrouteservice into a pipeline to generate a complete image with the graphs generated, were you able to discover anything else?

I finally workarounded it with the following approach.
I build the graphs during CI pipeline, by starting ORS in build mode and killing the container, when it is marked as ready. I keep the built graphs in a volume.

Then I upload the graphs as a tarball on a S3 bucket and download them before starting my openroute container on k8s (using a modified entrypoint script).

The result is a small container to pull (just ORS and aws cli), a short graphs download time from S3, and a startup time of 1sec!! (it was 4minutes previously)

Everytime I want to build fresh graphs, I replace the old tarball and restart my pods, so that they download the latest from S3.