Skip to content

Commit

Permalink
Merge pull request #399 from OpenHistoricalMap/staging
Browse files Browse the repository at this point in the history
Update env var  - tiler cache production and update readme
  • Loading branch information
Rub21 authored Nov 25, 2024
2 parents c9951c5 + 39b84e2 commit 54acbba
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
50 changes: 48 additions & 2 deletions images/tiler-cache/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,54 @@
# Tiler seed script
# Tiler Cache purging and seeding

This is a container that includes scripts to perform purge and seed operations. Each script must run on a different instance.

- Tiler seed script

Tiler seeding is a group of scripts aimed at generating tile cache for a specific zoom level, for example, from 1 to 7. The script will receive a GeoJSON of all the areas where tile cache generation is required for OHM tiles. This approach aims to reduce latency when a user starts interacting with OHM tiles.


# Tiler purge script
- Tiler purge script

Script that reads an AWS SQS queue and creates a container to purge and seed the tiler cache for specific imposm expired files.


**Note**
To run these instances, a service account must be set up for the node that will execute them, as this container needs access to the AWS SQS service to function.


```sh
# Create a ServiceAccount for managing Jobs and associated Pods
apiVersion: v1
kind: ServiceAccount
metadata:
name: job-service-account
namespace: default
---
# Create a ClusterRole with permissions for Jobs and Pods
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: job-manager-role
rules:
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["create", "list", "delete"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["list", "get"]
---
# Bind the ClusterRole to the ServiceAccount
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: job-manager-role-binding
subjects:
- kind: ServiceAccount
name: job-service-account
namespace: default
roleRef:
kind: ClusterRole
name: job-manager-role
apiGroup: rbac.authorization.k8s.io
```

2 changes: 1 addition & 1 deletion values.production.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ ohm:
REGION_NAME: us-east-1
NAMESPACE: default # Namespace to run the job
DOCKER_IMAGE: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.1741.h7dadda7 # TODO, this should be automatically updated from tiler server image
SQS_QUEUE_URL: {{RODUCTION_SQS_QUEUE_URL}}
SQS_QUEUE_URL: {{PRODUCTION_SQS_QUEUE_URL}}
NODEGROUP_TYPE: tiler_medium # Nodegroup type to run the job
MAX_ACTIVE_JOBS: 10 # Maximum number of active jobs in high concurrency queue
DELETE_OLD_JOBS_AGE: 14400 # 4 hours
Expand Down

0 comments on commit 54acbba

Please sign in to comment.