Skip to content

Commit

Permalink
use healthchecks to wait for containers to be up
Browse files Browse the repository at this point in the history
Issue: BB-496
  • Loading branch information
Kerkesni committed Feb 10, 2025
1 parent f1276c8 commit c65da35
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 34 deletions.
7 changes: 7 additions & 0 deletions .github/dockerfiles/cloudserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG CLOUDSERVER_IMAGE=ghcr.io/scality/cloudserver:7.70.47

FROM ${CLOUDSERVER_IMAGE}

ADD ./config.json /conf/config.json

RUN apt update && apt install -y curl
File renamed without changes.
24 changes: 20 additions & 4 deletions .github/dockerfiles/e2e/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ services:
- 8181
user: 0:0
privileged: true
healthcheck:
test: curl http://localhost:8181 || exit 1
interval: 10s
timeout: 30s
retries: 12
start_period: 10s
metadata:
profiles: ['s3c']
image: ${METADATA_IMAGE}
Expand All @@ -17,10 +23,16 @@ services:
SPROXYD: sproxyd:8181
volumes:
- ./metadata-config.json:/mnt/standalone_workdir/config.json:ro
healthcheck:
test: curl http://localhost:9000 || exit 1
interval: 10s
timeout: 30s
retries: 12
start_period: 10s
cloudserver:
profiles: ['s3c']
image: ${CLOUDSERVER_IMAGE}
network_mode: host
build:
context: ../cloudserver
depends_on:
- metadata
environment:
Expand All @@ -31,8 +43,12 @@ services:
S3_CONFIG_FILE: /conf/config.json
REMOTE_MANAGEMENT_DISABLE: 1
command: yarn start
volumes:
- ./cloudserver-config.json:/conf/config.json:ro
healthcheck:
test: curl http://localhost:8000 || exit 1
interval: 10s
timeout: 30s
retries: 12
start_period: 10s
redis:
profiles: ['s3c']
image: ${REDIS_IMAGE}
Expand Down
28 changes: 0 additions & 28 deletions .github/scripts/wait_for_local_port.bash

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ jobs:
CLOUDSERVER_IMAGE: ghcr.io/scality/cloudserver:${{ matrix.cloudserver_tag }}
run: |-
set -e -o pipefail;
docker compose --profile ${{ matrix.profile }} up -d --quiet-pull
bash ../../scripts/wait_for_local_port.bash 8000 120
docker compose --profile ${{ matrix.profile }} up -d --quiet-pull --wait
working-directory: .github/dockerfiles/e2e
- name: Create Zookeeper paths for tests with metadata
run: |-
Expand Down

0 comments on commit c65da35

Please sign in to comment.