Files
triggerdotdev--trigger.dev/docker/docker-compose.yml
T
Eric Allam 65da20c225 feat: replicate task runs to clickhouse to power dashboard improvements (#2035)
* WIP clickhouse package with test containers setup

* More clickhouse client setup now with otel and real tests, and the v1 of raw run events

* Add some additional columns to raw_run_events_v1

* WIP runs dashboard service

* Create a new run engine event bus event for the runs dashboard to hook into

* Track run events in the run engine

* make sure engine v1 runs get synced to CH

* Update the attemptNumber of v3 task runs

* Restructure the run events to be more sparse

* emit more stuff

* Setup replication package

* scaffold the replication package

* replication wip

* resolve conflicts

* more replication stuff

* Add ability to drop the replication slot completely on teardown

* Use the new single replacingmergetree task events table for replication

* get it working

* insert payloads into their own table only on insert and then join

* prepare for using clickhouse cloud and now running ch migrations during boot in the entrypoint.sh

* Handover WIP and tests

* Testing the replication service

* Remove the runs dashboard stuff that we aren't using anymore

* Added a test for large payloads

* hacky typecheck fix

* Fix new internal package typecheck issues and start adding telemetry to the replication service

* tracing over spans, some other improvements

* Improvements to the runs replication service, now ready for testing

* Some fixes and cleanups

* Don't need this code anymore

* move transaction types into the runs replication service

* only send spans where there are transaction events

* A couple of suggested tweaks
2025-05-12 22:12:36 +01:00

132 lines
2.9 KiB
YAML

version: "3"
volumes:
database-data:
database-data-alt:
pgadmin-data:
redis-data:
clickhouse:
networks:
app_network:
external: false
services:
database:
container_name: database
build:
context: .
dockerfile: Dockerfile.postgres
restart: always
volumes:
- ${DB_VOLUME:-database-data}:/var/lib/postgresql/data/
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
networks:
- app_network
ports:
- 5432:5432
command:
- -c
- listen_addresses=*
- -c
- wal_level=logical
- -c
- shared_preload_libraries=pg_partman_bgw
redis:
container_name: redis
image: redis:7
restart: always
volumes:
- redis-data:/data
networks:
- app_network
ports:
- 6379:6379
electric:
container_name: electric
image: electricsql/electric:1.0.0-beta.15@sha256:4ae0f895753b82684aa31ea1c708e9e86d0a9bca355acb7270dcb24062520810
restart: always
environment:
DATABASE_URL: postgresql://postgres:postgres@database:5432/postgres?sslmode=disable
networks:
- app_network
ports:
- "3060:3000"
depends_on:
- database
clickhouse:
image: bitnami/clickhouse:latest
container_name: clickhouse
environment:
CLICKHOUSE_ADMIN_USER: default
CLICKHOUSE_ADMIN_PASSWORD: password
ports:
- "8123:8123"
- "9000:9000"
volumes:
- clickhouse:/bitnami/clickhouse
networks:
- app_network
healthcheck:
test:
[
"CMD",
"clickhouse-client",
"--host",
"localhost",
"--port",
"9000",
"--user",
"default",
"--password",
"password",
"--query",
"SELECT 1",
]
interval: 3s
timeout: 5s
retries: 5
start_period: 10s
clickhouse_migrator:
build:
context: ../internal-packages/clickhouse
dockerfile: ./Dockerfile
depends_on:
clickhouse:
condition: service_healthy
networks:
- app_network
command: ["goose", "${GOOSE_COMMAND:-up}"]
ch-ui:
image: ghcr.io/caioricciuti/ch-ui:latest
restart: always
ports:
- "5521:5521"
environment:
VITE_CLICKHOUSE_URL: "http://clickhouse:8123"
VITE_CLICKHOUSE_USER: "default"
VITE_CLICKHOUSE_PASS: "password"
networks:
- app_network
# otel-collector:
# container_name: otel-collector
# image: otel/opentelemetry-collector-contrib:latest
# restart: always
# command: ["--config", "/etc/otel-collector-config.yaml"]
# volumes:
# - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
# ports:
# - "55680:55680"
# - "55681:55681"
# - "4317:4317" # OTLP gRPC receiver
# - "4318:4318" # OTLP http receiver