Skip to content

Commit

Permalink
have compose return when healthy
Browse files Browse the repository at this point in the history
Signed-off-by: DanRoscigno <[email protected]>
  • Loading branch information
DanRoscigno committed Feb 2, 2024
1 parent a5c83d0 commit 9b4670c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/test_the_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
compose-file: "./docker-compose.yml"

- name: Set up Golang
uses: actions/setup-go@v5
with:
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 9b4670c

Please sign in to comment.