diff --git a/application/ingestr/kafka-compose.yml b/application/ingestr/kafka-compose.yml index 794ab8cf..ee6e2a93 100644 --- a/application/ingestr/kafka-compose.yml +++ b/application/ingestr/kafka-compose.yml @@ -66,21 +66,6 @@ services: retries: 60 - # ------- - # Bundler - # ------- - # Wait for all defined services to be fully available by probing their health - # status, even when using `docker compose up --detach`. - # https://marcopeg.com/2019/docker-compose-healthcheck/ - start-dependencies: - image: docker.io/dadarek/wait-for-dependencies - depends_on: - kafka: - condition: service_healthy - cratedb: - condition: service_healthy - - # --------------- # Tasks for Kafka # --------------- diff --git a/application/ingestr/kafka-demo.xsh b/application/ingestr/kafka-demo.xsh index d0d6901f..4fa22950 100755 --- a/application/ingestr/kafka-demo.xsh +++ b/application/ingestr/kafka-demo.xsh @@ -33,7 +33,7 @@ class Infrastructure: def start(self): title "Starting services" - result = ![ docker compose --file $COMPOSE_FILE up --detach ] + result = ![ docker compose --file $COMPOSE_FILE up --detach --wait ] if result.returncode != 0: echo "ERROR: Failed to start services" exit 1 diff --git a/application/metabase/docker-compose.yml b/application/metabase/docker-compose.yml index 542a6d63..7cf1e6d8 100644 --- a/application/metabase/docker-compose.yml +++ b/application/metabase/docker-compose.yml @@ -42,6 +42,9 @@ services: # Wait for all defined services to be fully available by probing their health # status, even when using `docker compose up --detach`. # https://marcopeg.com/2019/docker-compose-healthcheck/ + # This is needed because `pytest-docker-compose-v2` does not support + # `docker compose up --detach` yet. + # https://github.com/radusuciu/pytest-docker-compose-v2/issues/6 wait: image: dadarek/wait-for-dependencies depends_on: diff --git a/application/roapi/compose.yml b/application/roapi/compose.yml index a94e4d66..e0ab6fb9 100644 --- a/application/roapi/compose.yml +++ b/application/roapi/compose.yml @@ -42,6 +42,12 @@ services: - 8080:8080 - 5434:5432 - 32010:32010 + healthcheck: + test: ["CMD", "curl", "--fail", "http://localhost:8080/health"] + start_period: 3s + interval: 1.5s + retries: 30 + timeout: 30s # ---------------- # Utility programs @@ -126,17 +132,3 @@ services: depends_on: cratedb-register-data: condition: service_completed_successfully - - # ------- - # Bundler - # ------- - # Wait for all defined services to be fully available by probing their health - # status, even when using `docker compose up --detach`. - # https://marcopeg.com/2019/docker-compose-healthcheck/ - start-dependencies: - image: docker.io/dadarek/wait-for-dependencies - depends_on: - cratedb: - condition: service_healthy - roapi: - condition: service_started diff --git a/application/roapi/roapi.Dockerfile b/application/roapi/roapi.Dockerfile index c7745f91..98839c5f 100644 --- a/application/roapi/roapi.Dockerfile +++ b/application/roapi/roapi.Dockerfile @@ -28,7 +28,7 @@ FROM debian:bookworm-slim LABEL org.opencontainers.image.source=https://github.com/roapi/roapi RUN apt-get update \ - && apt-get install -y libssl-dev ca-certificates \ + && apt-get install -y libssl-dev ca-certificates curl \ && rm -rf /var/lib/apt/lists/* # Use `roapi` program from custom build. diff --git a/application/roapi/test.sh b/application/roapi/test.sh index 3649872d..cb15a7e2 100644 --- a/application/roapi/test.sh +++ b/application/roapi/test.sh @@ -9,7 +9,7 @@ # JDBC foreign data wrapper, then queries them. # Start services: CrateDB and ROAPI. -docker compose up --build --detach +docker compose up --build --detach --wait # Register data files with ROAPI. docker compose run --rm roapi-register-data diff --git a/framework/flink/kafka-jdbcsink-java/Makefile b/framework/flink/kafka-jdbcsink-java/Makefile index 9f3aac50..08adadfe 100644 --- a/framework/flink/kafka-jdbcsink-java/Makefile +++ b/framework/flink/kafka-jdbcsink-java/Makefile @@ -4,7 +4,7 @@ # Start foundation infrastructure. start: - docker compose up + docker compose up --detach --wait # Publish a message to the Kafka broker. test-publish: diff --git a/framework/flink/kafka-jdbcsink-java/docker-compose.yml b/framework/flink/kafka-jdbcsink-java/docker-compose.yml index df19e4dc..7b627ed7 100644 --- a/framework/flink/kafka-jdbcsink-java/docker-compose.yml +++ b/framework/flink/kafka-jdbcsink-java/docker-compose.yml @@ -99,6 +99,12 @@ services: taskmanager.numberOfTaskSlots: 2 networks: - scada-demo + healthcheck: + test: ["CMD-SHELL", "ps -ef | grep org.apache.flink.runtime.taskexecutor.TaskManagerRunner | grep -q -v grep || exit 1"] + start_period: 3s + interval: 1s + timeout: 10s + retries: 60 # ------- @@ -128,23 +134,6 @@ services: retries: 60 - # ------- - # Bundler - # ------- - # Wait for all defined services to be fully available by probing their health - # status, even when using `docker compose up --detach`. - # https://marcopeg.com/2019/docker-compose-healthcheck/ - start-dependencies: - image: dadarek/wait-for-dependencies - depends_on: - kafka-broker: - condition: service_healthy - flink-jobmanager: - condition: service_healthy - cratedb: - condition: service_healthy - - # ----- # Tasks # ----- diff --git a/framework/flink/kafka-jdbcsink-java/test.sh b/framework/flink/kafka-jdbcsink-java/test.sh index fda3b954..a1c0536a 100755 --- a/framework/flink/kafka-jdbcsink-java/test.sh +++ b/framework/flink/kafka-jdbcsink-java/test.sh @@ -23,7 +23,7 @@ set -e function start-services() { title "Starting services" - docker compose up --detach + docker compose up --detach --wait } function stop-services() { diff --git a/operation/compose/ssl/Makefile b/operation/compose/ssl/Makefile index ee2ccfa7..fa024fe0 100644 --- a/operation/compose/ssl/Makefile +++ b/operation/compose/ssl/Makefile @@ -3,7 +3,7 @@ .PHONY: test test: ## Run the integration tests. @\ - docker compose up --detach + docker compose up --detach --wait sh client_crash.sh sh client_pgsql.sh uv run client_dbapi.py diff --git a/operation/compose/ssl/compose.yml b/operation/compose/ssl/compose.yml index e957fbad..3c3da205 100644 --- a/operation/compose/ssl/compose.yml +++ b/operation/compose/ssl/compose.yml @@ -20,12 +20,3 @@ services: interval: 1.5s retries: 30 timeout: 30s - - # Wait for the service being available, even when - # invoked through `docker compose up --detach`. - # https://marcopeg.com/2019/docker-compose-healthcheck/ - wait-for-cratedb: - image: dadarek/wait-for-dependencies - depends_on: - cratedb: - condition: service_healthy diff --git a/topic/machine-learning/open-webui/compose.yml b/topic/machine-learning/open-webui/compose.yml index 0d395cc0..036c357b 100644 --- a/topic/machine-learning/open-webui/compose.yml +++ b/topic/machine-learning/open-webui/compose.yml @@ -165,15 +165,3 @@ services: condition: service_completed_successfully deploy: replicas: 0 - - # ------- - # Bundler - # ------- - # Wait for all defined services to be fully available by probing their health - # status, even when using `docker compose up --detach`. - # https://marcopeg.com/2019/docker-compose-healthcheck/ - start-dependencies: - image: docker.io/dadarek/wait-for-dependencies - depends_on: - setup: - condition: service_completed_successfully