diff --git a/images/tiler-cache/README.md b/images/tiler-cache/README.md index f171f8b9..08c5eb81 100644 --- a/images/tiler-cache/README.md +++ b/images/tiler-cache/README.md @@ -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 +``` + diff --git a/values.production.template.yaml b/values.production.template.yaml index 6b9e29ba..b4fa9abb 100644 --- a/values.production.template.yaml +++ b/values.production.template.yaml @@ -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