From 9b4670c54cd626adb0d4be8d0decc0b2cb7f4c4b Mon Sep 17 00:00:00 2001 From: DanRoscigno Date: Thu, 1 Feb 2024 21:29:08 -0500 Subject: [PATCH] have compose return when healthy Signed-off-by: DanRoscigno --- .github/workflows/test_the_docs.yml | 15 ++++++++------- docker-compose.yml | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test_the_docs.yml b/.github/workflows/test_the_docs.yml index 55a5a71..7bd2c3f 100644 --- a/.github/workflows/test_the_docs.yml +++ b/.github/workflows/test_the_docs.yml @@ -18,13 +18,6 @@ jobs: # - the Ginkgo/Gomega test system - uses: actions/checkout@v3 - # This compose action will deploy StarRocks - # in Docker using the compose file in this repo - - name: Start StarRocks - uses: isbang/compose-action@v1.4.1 - with: - compose-file: "./docker-compose.yml" - - name: Set up Golang uses: actions/setup-go@v5 with: @@ -38,6 +31,14 @@ jobs: - name: Build run: go build -v ./... + # This compose step will deploy StarRocks + # in Docker using the compose file in this repo + # docker compose will return when both services + # are healthy. The max time docker compose will + # wait is 60 seconds. + - name: Start StarRocks + run: docker compose up --detach --wait --wait-timeout 60 + - name: Test run: ginkgo -vv env: diff --git a/docker-compose.yml b/docker-compose.yml index c8ee9d1..639b7c9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: - 9020:9020 - 9030:9030 healthcheck: - test: 'mysql -u root -h localhost -P 9030 -e "show frontends\G" |grep "Alive: true"' + test: 'mysql -u root -h fe -P 9030 -e "show frontends\G" |grep "Alive: true"' interval: 10s timeout: 5s retries: 3 @@ -26,7 +26,7 @@ services: - /bin/bash - -c - | - sleep 45s; mysql --connect-timeout 2 -h localhost -P 9030 -u root -e "alter system add backend \"localhost:9050\";" + sleep 30s; mysql --connect-timeout 2 -h fe -P 9030 -u root -e "alter system add backend \"be:9050\";" /opt/starrocks/be/bin/start_be.sh hostname: be container_name: be @@ -36,7 +36,7 @@ services: ports: - 8040:8040 healthcheck: - test: 'mysql -u root -h localhost -P 9030 -e "show backends\G" |grep "Alive: true"' + test: 'mysql -u root -h fe -P 9030 -e "show backends\G" |grep "Alive: true"' interval: 10s timeout: 5s - retries: 3 + retries: 5