cojedzie: Add Redis and run three workers in production

This commit is contained in:
Kacper Donat 2026-11-08 12:29:02 +01:00
parent 3624478d83
commit 103af41568
2 changed files with 21 additions and 0 deletions

View File

@ -44,8 +44,25 @@ services:
COJEDZIE_WORKER_OPTS: '-vv'
COJEDZIE_WORKER_QUEUES: 'scheduler_default scheduler_hub scheduler_recorder'
# import jobs run in parallel on every worker (cojedzie ADR 0026)
worker:
<<: *worker
deploy:
mode: replicated
replicas: {{ cojedzie_worker_replicas|default(3) }}
# state the workers share, e.g. the Sentry check-ins of running imports; reached only inside the stack
redis:
image: redis:{{ cojedzie_redis_version|default('7.4-alpine') }}
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis_data:/data
deploy:
mode: replicated
replicas: 1
resources:
limits:
memory: 128M
# departure history (cojedzie ADR 0020); reached only inside the stack
clickhouse:
@ -128,3 +145,4 @@ volumes:
clickhouse_data: ~
mercure_data: ~
mercure_config: ~
redis_data: ~

View File

@ -12,3 +12,6 @@ SENTRY_SAMPLE_RATE={{ sentry_sample_rate_api }}
# departure history; see cojedzie's contrib/agents/wiki/api/departure-history.md
COJEDZIE_CLICKHOUSE_URL=http://cojedzie:{{ cojedzie_clickhouse_password | urlencode }}@clickhouse:8123/cojedzie
COJEDZIE_DEPARTURE_HISTORY_RETENTION_DAYS={{ cojedzie_departure_history_retention_days }}
# state shared by workers, e.g. Sentry check-ins of running imports
COJEDZIE_REDIS_URL=redis://redis:6379