# Graphs do not build at startup within GCR

**URL:** https://ask.openrouteservice.org/t/graphs-do-not-build-at-startup-within-gcr/6037
**Category:** openrouteservice
**Created:** [April 25, 2024, 9:56pm UTC](https://ask.openrouteservice.org/t/graphs-do-not-build-at-startup-within-gcr/6037 "2024-04-25T21:56:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Toba](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/toba/32/3016_2.png) [@Toba](https://ask.openrouteservice.org/u/Toba)
#### Post date: [April 25, 2024, 9:56pm UTC](https://ask.openrouteservice.org/t/graphs-do-not-build-at-startup-within-gcr/6037/1 "2024-04-25T21:56:51Z")

</div>

Hello,

I am currently attempting to deploy ORS on Google Cloud Run but am encountering issues with graph generation (guess). Currently, I am utilizing the `example-heidelberg.osm.gz` for testing purposes. Below is an outline of my setup:

I have configured a separate Cloud Storage bucket for each volume. These appear to be functioning correctly (but no graphs are being constructed in `home/ors/graphs`). I have set four environment variables to support this configuration.

 ![config- service](https://ask.openrouteservice.org/uploads/default/original/2X/4/4d8a4e2847c9872fd17944e0adff23a4fc5a86de.jpeg)

 ![Untitled 2](https://ask.openrouteservice.org/uploads/default/original/2X/6/6ec27896fb6fa28513e57139b234eb56eaec65ba.jpeg)

Additionally, I here’s the YAML configurations that were generated by the service.:

> **YAML FILE**
>
> ```auto
> apiVersion: serving.knative.dev/v1
> kind: Service
> metadata:
> name: ors
> namespace: '00000000000000000000000000'
> selfLink: /apis/serving.knative.dev/v1/namespaces/00000000000000000000000000/services/ors
> uid: 00000000000000000000000000
> resourceVersion: AAYW8fdvmr8
> generation: 24
> creationTimestamp: '2024-04-25T18:21:20.179090Z'
> labels:
> run.googleapis.com/satisfiesPzs: 'true'
> cloud.googleapis.com/location: europe-west9
> annotations:
> run.googleapis.com/client-name: cloud-console
> serving.knative.dev/creator: 00000000000000000000000000@gmail.com
> serving.knative.dev/lastModifier: 00000000000000000000000000@gmail.com
> run.googleapis.com/launch-stage: BETA
> run.googleapis.com/operation-id: 00000000000000000000000000
> run.googleapis.com/ingress: all
> run.googleapis.com/ingress-status: all
> run.googleapis.com/minScale: '0'
> run.googleapis.com/max-surge: '0'
> spec:
> template:
> metadata:
> labels:
> client.knative.dev/nonce: 00000000000000000000000000
> run.googleapis.com/startupProbeType: Default
> annotations:
> run.googleapis.com/client-name: cloud-console
> autoscaling.knative.dev/minScale: '1'
> run.googleapis.com/execution-environment: gen2
> autoscaling.knative.dev/maxScale: '1'
> run.googleapis.com/startup-cpu-boost: 'true'
> spec:
> containerConcurrency: 80
> timeoutSeconds: 300
> serviceAccountName: 00000000000000000000000000-compute@developer.gserviceaccount.com
> containers:
> - name: openrouteservice-1
> image: openrouteservice/openrouteservice
> ports:
> - name: http1
> containerPort: 8082
> env:
> - name: CONTAINER_LOG_LEVEL
> value: DEBUG
> - name: XMS
> value: 2g
> - name: XMX
> value: 4g
> - name: REBUILD_GRAPHS
> value: 'true'
> resources:
> limits:
> cpu: 2000m
> memory: 4Gi
> volumeMounts:
> - name: graphs
> mountPath: /home/ors/graphs
> - name: elevation_cache
> mountPath: /home/ors/elevation_cache
> - name: config
> mountPath: /home/ors/config
> - name: logs
> mountPath: /home/ors/logs
> - name: files
> mountPath: /home/ors/files
> startupProbe:
> timeoutSeconds: 240
> periodSeconds: 240
> failureThreshold: 1
> tcpSocket:
> port: 8082
> volumes:
> - name: graphs
> csi:
> driver: gcsfuse.run.googleapis.com
> volumeAttributes:
> bucketName: graphs-ors
> - name: elevation_cache
> csi:
> driver: gcsfuse.run.googleapis.com
> volumeAttributes:
> bucketName: elevation_cache
> - name: config
> csi:
> driver: gcsfuse.run.googleapis.com
> volumeAttributes:
> bucketName: config-ors
> - name: logs
> csi:
> driver: gcsfuse.run.googleapis.com
> volumeAttributes:
> bucketName: logs-ors
> - name: files
> csi:
> driver: gcsfuse.run.googleapis.com
> volumeAttributes:
> bucketName: files-ors
> traffic:
> - percent: 100
> latestRevision: true
> 
> ```

And the log from /home/ors/logs

> **LOG**
>
> ```auto
> 2024-04-25 20:46:02 INFO [o.h.o.a.s.l.ORSInitContextListener] - Initializing ORS...
> 2024-04-25 20:46:02 INFO [o.h.o.r.RoutingProfileManager] - Total - 1024 MB, Free - 965.46 MB, Max: 2 GB, Used - 59.04 MB
> 2024-04-25 20:46:02 INFO [o.h.o.r.RoutingProfileManager] - ====> Initializing profiles from '/home/ors/files/example-heidelberg.osm.gz' (1 threads) ...
> 2024-04-25 20:46:02 INFO [o.h.o.r.RoutingProfileManager] - 1 profile configurations submitted as tasks.
> 2024-04-25 20:46:02 INFO [o.h.o.r.RoutingProfile] - [1] Profiles: 'driving-car', location: '/home/ors/./graphs/car'.
> 2024-04-25 20:46:02 INFO [o.h.o.r.g.e.c.CoreLMPreparationHandler] - Loaded landmark splitting collection from 
> 2024-04-25 20:46:03 INFO [o.h.o.r.g.e.ORSGraphHopper] - version v4.9.1|2024-01-17T09:08:46Z (7,20,5,4,5,7)
> 2024-04-25 20:46:03 INFO [o.h.o.r.g.e.ORSGraphHopper] - graph CH|car_ors|RAM_STORE|3D|turn_cost|,,,,, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308, shortcuts:0 (0MB), nodesCH:-1 (0MB), shortcuts:0 (0MB), nodesCH:-1 (0MB), shortcuts:0 (0MB), nodesCH:-1 (0MB)
> 2024-04-25 20:46:03 INFO [o.h.o.r.g.e.ORSGraphHopper] - No custom areas are used, custom_areas.directory not given
> 2024-04-25 20:46:03 INFO [o.h.o.r.g.e.ORSGraphHopper] - start creating graph from /home/ors/files/example-heidelberg.osm.gz
> 2024-04-25 20:46:03 INFO [o.h.o.r.g.e.ORSGraphHopper] - using CH|car_ors|RAM_STORE|3D|turn_cost|,,,,, memory:totalMB:1024, usedMB:294
> 2024-04-25 20:46:03 INFO [o.h.o.a.Application] - Started Application in 5.915 seconds (process running for 7.848)
> 2024-04-25 20:46:03 INFO [o.h.o.a.Application] - openrouteservice {"build_date":"2024-03-21T13:55:54Z","version":"8.0.0"}
> 2024-04-25 20:51:00 INFO [o.h.o.a.s.l.ORSInitContextListener] - Shutting down openrouteservice {"build_date":"2024-03-21T13:55:54Z","version":"8.0.0"} and releasing resources.
> 2024-04-25 20:51:27 INFO [o.h.o.a.Application] - Starting Application v8.0.0 using Java 21.0.2 with PID 1 (/ors.jar started by root in /home/ors)
> 2024-04-25 20:51:27 INFO [o.h.o.a.Application] - The following 1 profile is active: "default"
> 2024-04-25 20:51:27 INFO [o.h.o.a.ORSEnvironmentPostProcessor] - 
> 2024-04-25 20:51:27 INFO [o.h.o.a.ORSEnvironmentPostProcessor] - Configuration lookup started.
> 2024-04-25 20:51:27 INFO [o.h.o.a.ORSEnvironmentPostProcessor] - Configuration file set by environment variable.
> 2024-04-25 20:51:27 INFO [o.h.o.a.ORSEnvironmentPostProcessor] - Loaded file '/home/ors/config/ors-config.yml'
> 2024-04-25 20:51:27 INFO [o.h.o.a.ORSEnvironmentPostProcessor] - Configuration lookup finished.
> 
> ```

Of course the health status is “not ready”.

I’m aware that using Docker Compose with a virtual machine might be simpler, but I’m trying to avoid this configuration since the demands of my use case are not very high.

Or maybe I might have misunderstood some fundamental aspects, but I’m not sure what.

Thanks you for your help

---

<div class="post-metadata">

### Author: ![Toba](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/toba/32/3016_2.png) [@Toba](https://ask.openrouteservice.org/u/Toba)
#### Post date: [April 26, 2024, 1:02pm UTC](https://ask.openrouteservice.org/t/graphs-do-not-build-at-startup-within-gcr/6037/2 "2024-04-26T13:02:49Z")

</div>

I’ve discovered a makeshift workaround and can now request isochrones. I manually import the graphs, which were previously generated locally, into my Cloud Storage Bucket and set REBUILD\_GRAPH to false (this prevents resetting the graph folder, which seems logical to me).

I am still investigating why the graphs do not build at startup.
