Repository navigation
Expand file tree
/
Copy pathsetup_postgres.sh
More file actions
executable file
·54 lines (44 loc) · 2.04 KB
/
Copy pathsetup_postgres.sh
File metadata and controls
executable file
·54 lines (44 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
set -e
# ==============================================================================
# SQL Frontier Eval - PostgreSQL Docker Compose Setup Script
# Builds and launches the latest PostgreSQL 19 container with pgvector, pg_trgm,
# fuzzystrmatch, btree_gist, and analytical compatibility extensions.
# ==============================================================================
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${PROJECT_ROOT}"
echo "================================================================================"
echo "SQL FRONTIER EVAL: POSTGRESQL 19 DOCKER COMPOSE INITIALIZATION"
echo "================================================================================"
# Verify Docker and Docker Compose availability
if ! command -v docker &> /dev/null; then
echo "[ERROR] 'docker' binary not found. Please install Docker."
exit 1
fi
if ! docker compose version &> /dev/null; then
echo "[ERROR] 'docker compose' is not available."
exit 1
fi
echo ">>> Building and starting PostgreSQL 19 container..."
docker compose up -d --build
echo ">>> Waiting for PostgreSQL service to become healthy..."
RETRIES=30
until docker compose ps postgres | grep -q "healthy" || [ $RETRIES -eq 0 ]; do
echo " Waiting for postgres container healthcheck... ($RETRIES left)"
sleep 2
RETRIES=$((RETRIES - 1))
done
if [ $RETRIES -eq 0 ]; then
echo "[WARNING] Healthcheck timed out. Inspecting container logs:"
docker compose logs postgres
exit 1
fi
echo ">>> Verifying PostgreSQL extensions..."
docker compose exec postgres psql -U postgres -d sql_frontier_eval -c "
SELECT extname, extversion FROM pg_extension ORDER BY extname;
"
echo ""
echo "================================================================================"
echo "✔ PostgreSQL 19.0 instance is healthy and ready for benchmark evaluations!"
echo "Connection String: postgresql://postgres:postgrespassword@localhost:5432/sql_frontier_eval"
echo "================================================================================"