Skip to content

Commit d1037f1

Browse files
committed
Attempt to fix cassandra healthcheck
1 parent 2f9f39d commit d1037f1

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

.github/workflows/go.yml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ jobs:
3737
env:
3838
CASSANDRA_USER: cassandra
3939
CASSANDRA_PASSWORD: cassandra
40-
CASSANDRA_CLUSTER_NAME: test_cluster
41-
CASSANDRA_DC: datacenter1
42-
CASSANDRA_RACK: rack1
4340
ports:
4441
- "9042:9042"
45-
# Health check to wait until Cassandra is ready
4642
options: >-
47-
--health-cmd="cqlsh -u cassandra -p cassandra -e 'describe keyspaces' localhost 9042"
43+
--health-cmd="cqlsh localhost 9042 --execute='describe keyspaces'"
4844
--health-interval=10s
4945
--health-timeout=5s
5046
--health-retries=10
@@ -110,30 +106,17 @@ jobs:
110106
# Install PostgreSQL client
111107
sudo apt-get update
112108
sudo apt-get install -y postgresql-client
113-
114-
# Install Cassandra client and netcat
115-
sudo apt-get install -y curl netcat
116-
curl -fsSL https://www.apache.org/dist/cassandra/KEYS | sudo gpg --dearmor -o /usr/share/keyrings/cassandra-archive-keyring.gpg
117-
echo "deb [signed-by=/usr/share/keyrings/cassandra-archive-keyring.gpg] https://apache.jfrog.io/artifactory/cassandra-deb/ 40x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
118-
sudo apt-get update
119-
sudo apt-get install -y cassandra-tools
120109
121110
- name: Create Cassandra keyspace
122111
run: |
123-
# First wait for the port to be open
124-
until nc -z localhost 9042; do
125-
echo "Waiting for Cassandra port to be ready..."
126-
sleep 5
127-
done
128-
129-
# Then wait for Cassandra to be fully initialized
130-
until cqlsh -u cassandra -p cassandra -e 'describe keyspaces' localhost 9042 > /dev/null 2>&1; do
112+
# Wait for Cassandra to be ready
113+
until cqlsh localhost 9042 --execute='describe keyspaces' > /dev/null 2>&1; do
131114
echo "Waiting for Cassandra to be ready..."
132115
sleep 5
133116
done
134117
135118
echo "Creating Cassandra keyspace..."
136-
cqlsh -u cassandra -p cassandra -e "CREATE KEYSPACE IF NOT EXISTS perfkit_db_ci WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};" localhost 9042
119+
cqlsh localhost 9042 --execute="CREATE KEYSPACE IF NOT EXISTS perfkit_db_ci WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};"
137120
138121
- name: Create vector extension
139122
run: PGPASSWORD=password psql -h localhost -U root -d perfkit_pg_vector_db_ci -c "CREATE EXTENSION vector;"

0 commit comments

Comments
 (0)