From e3d64e743794f37e3626f19b7e808bdea78247d2 Mon Sep 17 00:00:00 2001 From: Joe Caputo Date: Fri, 25 Oct 2024 14:26:07 -0400 Subject: [PATCH] fix: healthcheck specification in docker-compose file (#665) # Problem Healthcheck was specified in docker-compose.yaml using incorrect syntax. Also fixes an error in the CI pipeline that was not running E2E tests when the set of "common" files changed (which would have caught this bug in the original PR) --- .github/workflows/e2e-tests.yml | 2 +- docker-compose-e2e.account.yaml | 3 +++ docker-compose.yaml | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 44bcfdfe..6854dd39 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -18,7 +18,7 @@ jobs: services: >- ["account"] # Resolves to true if it should run everything, aka when common files change - run-all: ${{ steps.determine-matrix.outputs.changes.common }} + run-all: ${{ contains(fromJson(steps.determine-matrix.outputs.changes), 'common') }} steps: - name: Check Out Repo uses: actions/checkout@v4 diff --git a/docker-compose-e2e.account.yaml b/docker-compose-e2e.account.yaml index 36bae93b..434c0aea 100644 --- a/docker-compose-e2e.account.yaml +++ b/docker-compose-e2e.account.yaml @@ -42,6 +42,9 @@ services: ipfs: profiles: - skip + gateway-base: + profiles: + - account content-publishing-service-worker: profiles: - skip diff --git a/docker-compose.yaml b/docker-compose.yaml index 1266b9a1..cc99d3d4 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -74,11 +74,11 @@ services: # such as: # --state-pruning=archive command: --offchain-worker=always --enable-offchain-indexing=true - options: >- - --health-cmd "bash -c '(echo >\"/dev/tcp/127.0.0.1/9944\") &>/dev/null'" - --health-interval 10s - --health-timeout 5s - --health-retries 5 + healthcheck: + test: ["CMD", "bash", "-c", "curl -X POST -H \"Content-Type: application/json\" -d '{\"jsonrpc\":\"2.0\",\"method\":\"system_health\",\"params\":[],\"id\":1}' http://127.0.0.1:9944 > /dev/null 2>&1"] + interval: 10s + timeout: 5s + retries: 5 ports: - 9944:9944 networks: