Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: ensure clickhouse is healthy before migrating (#3128)

Max Deichmann911021ac5dcd
diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml
index a7dc880909..1fff5ccade 100644
--- a/.github/workflows/pipeline.yml
+++ b/.github/workflows/pipeline.yml
@@ -136,6 +136,7 @@ jobs:
- uses: pnpm/action-setup@v3
with:
version: 9.5.0
+
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
@@ -165,6 +166,15 @@ jobs:
sleep 5 # Wait for PostgreSQL to accept connections
docker compose ps
+ - name: Ensure no unhealthy status
+ run: |
+ if docker compose ps | grep "(unhealthy)"; then
+ echo "One or more services are unhealthy"
+ exit 1
+ else
+ echo "All services are healthy"
+ fi
+
- name: Seed DB
run: |
pnpm run --filter=shared ch:up
diff --git a/packages/shared/clickhouse/scripts/up.sh b/packages/shared/clickhouse/scripts/up.sh
index 0dc9e5a260..608504d7ec 100644
--- a/packages/shared/clickhouse/scripts/up.sh
+++ b/packages/shared/clickhouse/scripts/up.sh
@@ -18,5 +18,6 @@ if [ "$CLICKHOUSE_MIGRATION_SSL" = true ] ; then
else
DATABASE_URL="${CLICKHOUSE_MIGRATION_URL}?username=${CLICKHOUSE_USER}&password=${CLICKHOUSE_PASSWORD}&database=default&x-multi-statement=true&x-migrations-table-engine=MergeTree"
fi
+
# Execute the up command
migrate -source file://clickhouse/migrations -database "$DATABASE_URL" up