Skip to content

Commit 3314a13

Browse files
committed
Cassandra
1 parent 356a9ce commit 3314a13

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

.github/workflows/go.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,8 @@ jobs:
3535
cassandra:
3636
image: cassandra:4.0
3737
env:
38-
CASSANDRA_USER: cassandra
39-
CASSANDRA_PASSWORD: cassandra
40-
CASSANDRA_CLUSTER_NAME: test_cluster
41-
CASSANDRA_DC: datacenter1
42-
CASSANDRA_RACK: rack1
43-
CASSANDRA_ENDPOINT_SNITCH: SimpleSnitch
44-
CASSANDRA_NUM_TOKENS: 1
38+
CASSANDRA_USER: admin
39+
CASSANDRA_PASSWORD: password # example value of a secret
4540
ports:
4641
- "9042:9042"
4742
options: >-
@@ -121,18 +116,19 @@ jobs:
121116
122117
- name: Create Cassandra keyspace
123118
run: |
124-
# Wait for Cassandra to be ready with increased timeout
119+
# Wait for Cassandra to be ready (max 30 attempts)
125120
for i in {1..30}; do
126-
if cqlsh -u cassandra -p cassandra 127.0.0.1 9042 --execute='describe keyspaces' > /dev/null 2>&1; then
121+
if printf "" 2>>/dev/null >>/dev/tcp/127.0.0.1/9042; then
127122
echo "Cassandra is ready!"
128123
break
129124
fi
130-
echo "Waiting for Cassandra to be ready... (attempt $i/30)"
131-
sleep 10
125+
echo "Waiting for cassandra... (attempt $i/30)";
126+
sleep 5;
132127
done
133-
134-
echo "Creating Cassandra keyspace..."
135-
cqlsh -u cassandra -p cassandra 127.0.0.1 9042 --execute="CREATE KEYSPACE IF NOT EXISTS perfkit_db_ci WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};"
128+
129+
echo "Creating keyspace..."
130+
cqlsh 127.0.0.1 9042 -u cassandra -p cassandra -e "CREATE KEYSPACE IF NOT EXISTS perfkit_db_ci WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};"
131+
echo "Keyspace created"
136132
137133
- name: Create vector extension
138134
run: PGPASSWORD=password psql -h localhost -U root -d perfkit_pg_vector_db_ci -c "CREATE EXTENSION vector;"

0 commit comments

Comments
 (0)