Skip to content
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

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

sylwiaszunejko
Copy link
Collaborator

As per Docker documentation:

From July 2023 Docker Compose V1 stopped receiving updates. It’s also no longer available in new releases of Docker Desktop.

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 in docker compose. --wait flag makes Docker wait for all healthchecks to be in "healthy" state. Since docker-compose.yml files in this repository use cqlsh 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.

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:

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.

Copy link
Collaborator Author

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?

@sylwiaszunejko sylwiaszunejko requested a review from mmatczuk July 17, 2023 08:10
avelanarius
avelanarius previously approved these changes Jul 17, 2023
Copy link

@avelanarius avelanarius left a 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.
@sylwiaszunejko
Copy link
Collaborator Author

LGTM, I agree that the healthcheck timeout could be lowered (to 1 minute/1.5 minutes?)

Done

@avelanarius avelanarius merged commit 5807e6b into scylladb:master Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants