Skip to content

Commit

Permalink
Merge pull request #133 from sylwiaszunejko/healthchecks
Browse files Browse the repository at this point in the history
Add healthchecks, switch from Docker Compose V1 to V2
  • Loading branch information
avelanarius authored Jul 17, 2023
2 parents 8bf4a23 + 282d587 commit 5807e6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Install Docker compose
env:
DOCKER_COMPOSE_VERSION: 1.27.4
DOCKER_COMPOSE_VERSION: 2.20.0
run: sudo curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

- run: ./integration.sh cassandra scylla
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ services:
- type: bind
source: ./testdata/pki/cassandra.key
target: /etc/scylla/db.key
healthcheck:
test: [ "CMD", "cqlsh", "-e", "select * from system.local" ]
interval: 5s
timeout: 5s
retries: 18
networks:
public:
driver: bridge
Expand Down
16 changes: 3 additions & 13 deletions integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,16 @@ readonly SCYLLA_IMAGE=${SCYLLA_IMAGE}
set -eu -o pipefail

function scylla_up() {
local -r exec="docker-compose exec -T"
local -r exec="docker compose exec -T"

echo "==> Running Scylla ${SCYLLA_IMAGE}"
docker pull ${SCYLLA_IMAGE}
docker-compose up -d

echo "==> Waiting for CQL port"
for s in $(docker-compose ps --services); do
until v=$(${exec} ${s} cqlsh -e "DESCRIBE SCHEMA"); do
echo ${v}
docker-compose logs --tail 10 ${s}
sleep 5
done
done
echo "==> Waiting for CQL port done"
docker compose up -d --wait
}

function scylla_down() {
echo "==> Stopping Scylla"
docker-compose down
docker compose down
}

function scylla_restart() {
Expand Down

0 comments on commit 5807e6b

Please sign in to comment.