1616
1717 services :
1818 # Database service containers
19+ mariadb-vector :
20+ image : mariadb:11.7.2
21+ env :
22+ MYSQL_ROOT_PASSWORD : password
23+ MYSQL_DATABASE : perfkit_db_ci
24+ MYSQL_USER : user
25+ MYSQL_PASSWORD : password
26+ # Disable features that cause warnings in GitHub Actions
27+ MARIADB_INNODB_USE_NATIVE_AIO : " 0"
28+ ports :
29+ - 3306:3306
30+ # Additional options to handle GitHub Actions environment limitations
31+ options : >-
32+ --health-cmd "mysqladmin ping -h localhost -u root -ppassword"
33+ --health-interval 10s
34+ --health-timeout 5s
35+ --health-retries 10
36+ --health-start-period 40s
37+ --tmpfs /tmp:rw
38+ --tmpfs /run/mysqld:rw
39+
1940 postgres :
2041 image : ankane/pgvector:v0.5.1
2142 env :
3152 --health-timeout 5s
3253 --health-retries 5
3354
34- cassandra :
35- image : cassandra:4.0
36- env :
37- CASSANDRA_USER : admin
38- CASSANDRA_PASSWORD : password
39- ports :
40- - 9042:9042
41- # Health check for Cassandra
42- options : >-
43- --health-cmd "cqlsh --debug -e 'select * from system.local' || exit 1"
44- --health-interval 30s
45- --health-timeout 10s
46- --health-retries 5
47-
48- clickhouse :
49- image : clickhouse/clickhouse-server:23.9.1.1854-alpine
50- env :
51- CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT : 1
52- CLICKHOUSE_DB : perfkit_db_ci
53- CLICKHOUSE_USER : username
54- CLICKHOUSE_PASSWORD : password
55- ports :
56- - 8123:8123
57- - 9000:9000
58- # Health check for ClickHouse
59- options : >-
60- --health-cmd "wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1"
61- --health-interval 10s
62- --health-timeout 5s
63- --health-retries 5
64-
6555 elasticsearch :
6656 image : docker.elastic.co/elasticsearch/elasticsearch:8.15.1
6757 env :
8272 --health-timeout 10s
8373 --health-retries 5
8474
85- mariadb-vector :
86- image : mariadb:11.7.2
87- env :
88- MYSQL_ROOT_PASSWORD : password
89- MYSQL_DATABASE : perfkit_db_ci
90- MYSQL_USER : user
91- MYSQL_PASSWORD : password
92- # Disable features that cause warnings in GitHub Actions
93- MARIADB_INNODB_USE_NATIVE_AIO : " 0"
94- ports :
95- - 3306:3306
96- # Additional options to handle GitHub Actions environment limitations
97- options : >-
98- --health-cmd "mysqladmin ping -h localhost -u root -ppassword"
99- --health-interval 10s
100- --health-timeout 5s
101- --health-retries 10
102- --health-start-period 40s
103- --tmpfs /tmp:rw
104- --tmpfs /run/mysqld:rw
105-
106- opensearch :
107- image : opensearchproject/opensearch:2.17.0
108- env :
109- node.name : os-test
110- discovery.type : single-node
111- OPENSEARCH_JAVA_OPTS : -Xms512m -Xmx512m
112- OPENSEARCH_INITIAL_ADMIN_PASSWORD : ScoRpi0n$
113- ports :
114- - 9201:9200
115- - 9600:9600
116- # Health check for OpenSearch
117- options : >-
118- --health-cmd "curl -s http://localhost:9200/_cluster/health || exit 1"
119- --health-interval 20s
120- --health-timeout 10s
121- --health-retries 5
122-
12375 steps :
12476 - uses : actions/checkout@v4
12577
@@ -133,52 +85,10 @@ jobs:
13385 # Install PostgreSQL client
13486 sudo apt-get update
13587 sudo apt-get install -y postgresql-client
136-
137- # Install MySQL client for MariaDB
138- sudo apt-get install -y mysql-client
139-
140- # Install curl for Elasticsearch/OpenSearch health checks
141- sudo apt-get install -y curl
14288
14389 - name : Create vector extension
14490 run : PGPASSWORD=password psql -h localhost -U root -d perfkit_pg_vector_db_ci -c "CREATE EXTENSION vector;"
14591
146- - name : Wait for MariaDB
147- run : |
148- # Wait for MariaDB to be fully ready
149- for i in {1..45}; do
150- if mysqladmin ping -h 127.0.0.1 -u root -ppassword --silent; then
151- echo "MariaDB is ready"
152- break
153- fi
154- echo "Waiting for MariaDB to be ready... ($i/45)"
155- sleep 2
156- done
157- # Verify connection
158- if ! mysqladmin ping -h 127.0.0.1 -u root -ppassword --silent; then
159- echo "MariaDB failed to start properly"
160- exit 1
161- fi
162-
163- - name : Verify all database services
164- run : |
165- echo "Verifying PostgreSQL connection..."
166- PGPASSWORD=password psql -h localhost -U root -d perfkit_pg_vector_db_ci -c "SELECT 1" || exit 1
167-
168- echo "Verifying MariaDB connection..."
169- mysql -h 127.0.0.1 -u root -ppassword -e "SHOW DATABASES;" || exit 1
170-
171- echo "Verifying Elasticsearch health..."
172- curl -s http://localhost:9200/_cluster/health | grep -q '"status":"green\|yellow"' || exit 1
173-
174- echo "Verifying OpenSearch health..."
175- curl -s http://localhost:9201/_cluster/health | grep -q '"status":"green\|yellow"' || exit 1
176-
177- echo "Verifying ClickHouse connection..."
178- curl -s http://localhost:8123/ping | grep -q "Ok" || exit 1
179-
180- echo "All database services are operational!"
181-
18292 - name : Test with Coverage
18393 run : go test -v -coverprofile=coverage.txt -covermode=atomic ./db/sql/...
18494
0 commit comments