Verifying successful graph preparation

Hello,

I’m working on getting openrouteservice running for a production install. I don’t want to build the graph each time a container starts, so I’m setting up an option to build the graphs that builds and then copies the built graph to a location the API container can read from. I’ve set ors.engine.preparation_mode to true. Even if the build fails, the entrypoint/java always returns an exit code of 0 (with preparation_mode set to false this would return 1)

What is a good test for confirming that the graph was completely built? Is checking for the stamp.txt in the profiles a reasonable check?

(I’m running v8.0.0)

Hi @ddunlop,

you could check against the /ors/v2/health endpoint which should be ready once graphs are built. and not ready otherwise.

Best regards

I’m running the build phase in preparation mode, so the process ends when the graph is built. So I don’t have a chance to check the status endpoint.

Ah right.

Normally it should be a case that once the instance shuts down with exit code 0, that the graphs are built.

It seems, the code for the preparation_mode check, doesn’t care if the RoutingProfileManagerStatus has failed.

I’ve made a PR that fixes this:

once this is merged, you can use the main branch as base (if you use docker, you need to build a local image until the next release)

Best regards

This is great! Thanks!