-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add healthchecks, switch from Docker Compose V1 to V2 #133
Conversation
As per Docker: "From July 2023 Docker Compose V1 stopped receiving updates. It’s also no longer available in new releases of Docker Desktop." This patch replaces all uses of "docker-compose" command (Docker Compose V1) with "docker compose" command (Docker Compose V2). This change will also allow for using new functionality introduced in Docker Compose V2, such as "--wait" flag.
@@ -21,6 +21,11 @@ services: | |||
- type: bind | |||
source: ./testdata/pki/cassandra.key | |||
target: /etc/scylla/db.key | |||
healthcheck: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means it would take 5 minutes for Docker to claim Scylla unhealthy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the healthchecks in the Rust driver (https://github.com/scylladb/scylla-rust-driver/blob/main/test/cluster/docker-compose.yml#L25), do you suggest other values in the healthcheck?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I agree that the healthcheck timeout could be lowered (to 1 minute/1.5 minutes?)
Manually checking the health of a container with use of "cqlsh" replaced with healthcheck in docker-compose.yml file. Healthcheck uses "cqlsh" as well so it checks if all nodes of the cluster are fully bootstrapped and their CQL port ready. When using "--wait" flag (introduced in Docker Compose V2)in "docker compose up", Docker waits for all healthchecks to be in "healthy" state.
059e8b3
to
282d587
Compare
Done |
As per Docker documentation:
Therefore, the first patch replaces all uses of Docker Compose V1 (
docker-compose
command) with Docker Compose V2 (docker compose
command) and changes installed version of Docker Compose in main.yml.This gives a possibility to replace manual checking the health of the containers with healthchecks and using
--wait
flag indocker compose
.--wait flag
makes Docker wait for all healthchecks to be in "healthy" state. Since docker-compose.yml files in this repository usecqlsh
to determine the health of a container, this means that Docker will wait for all nodes of the cluster to be fully bootstrapped and their CQL port ready.All of this makes adding new nodes and making them boot in order easier, it is just adding new healthchecks and dependencies.