openinframap / openinframap

Open Infrastructure Map
https://openinframap.org
BSD 3-Clause "New" or "Revised" License
186 stars 34 forks source link

No cache seed for tegola at startup #161

Closed flacombe closed 1 year ago

flacombe commented 1 year ago

In the current docker implementation, Tegola starts with serve command in the CMD step.

How do you manage it currently?

russss commented 1 year ago

I don't really want to re-seed every time Tegola starts - in most cases this isn't necessary and in future I may run multiple instances of the Tegola container to reduce downtime on restarts.

I'm now running the re-seed job every 6 hours and I've adjusted the caching so I rarely have to manually run the seed process. The low-zoom tiles never get deleted from my tile cache so there's very little chance of them not being present.

FWIW this is how the reseed task is run from Kubernetes:

```yaml apiVersion: batch/v1 kind: CronJob metadata: name: oim-tileserver-seed namespace: default spec: schedule: "21 */6 * * *" failedJobsHistoryLimit: 3 successfulJobsHistoryLimit: 1 jobTemplate: spec: template: spec: containers: - name: oim-tileserver-seed image: ghcr.io/openinframap/tileserver:c0a6b966d3baf2aea8d1b0e234137f37e482d289-16 # {"$imagepolicy": "default:oim-tileserver"} args: - cache - seed - --config - /etc/tegola/config.toml - --bounds - "-180,-85.0511,180,85.0511" - --min-zoom=2 - --max-zoom=6 - --overwrite volumeMounts: - mountPath: /tmp/tegola name: tegola-cache restartPolicy: OnFailure volumes: - name: tegola-cache hostPath: path: /srv/tegola-cache ```
flacombe commented 1 year ago

Understood, thank you for details.

I'll manage to do the same with a cron job on the host.