Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update env var - tiler cache production and update readme #399

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading