From 873a47aa6cc975c86392e8ee429591e94cf18e7a Mon Sep 17 00:00:00 2001 From: containerman17 <8990432+containerman17@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:06:14 +0000 Subject: [PATCH] devnet healthchecks --- deploy/Dockerfile.devnet | 5 ++++- deploy/compose.yml | 30 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/deploy/Dockerfile.devnet b/deploy/Dockerfile.devnet index f1c9454..a2f490d 100644 --- a/deploy/Dockerfile.devnet +++ b/deploy/Dockerfile.devnet @@ -24,7 +24,10 @@ WORKDIR /hypersdk/examples/morpheusvm # Final layer with faucet, VM and avalanchego ##### FROM hypersdk-downloader + +RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y curl && apt clean && rm -rf /var/lib/apt/lists/* + ARG INSTALL_AVALANCHEGO_VERSION=d729e5c7ef9f008c3e89cd7131148ad3acda2e34 COPY --from=avalanchego /avalanchego/build/avalanchego /tmp/hypersdk/avalanchego-${INSTALL_AVALANCHEGO_VERSION}/avalanchego -ENTRYPOINT ["/bin/bash", "-c", "./scripts/stop.sh; ./scripts/run.sh && echo 'Subnet RPC started' && tail -f /dev/null"] \ No newline at end of file +ENTRYPOINT ["/bin/bash", "-c", "./scripts/stop.sh; ./scripts/run.sh && echo 'Devnet started' && tail -f /dev/null"] \ No newline at end of file diff --git a/deploy/compose.yml b/deploy/compose.yml index fb60876..723716d 100644 --- a/deploy/compose.yml +++ b/deploy/compose.yml @@ -1,5 +1,6 @@ services: devnet: + container_name: devnet build: dockerfile: ./Dockerfile.devnet restart: always @@ -10,15 +11,15 @@ services: target: /go/pkg/mod - type: volume target: /root/.cache/go-build - # TODO: restore healthcheck - # healthcheck: - # test: ["CMD", "nc", "-z", "localhost", "9650"] - # interval: 10s - # timeout: 5s - # retries: 5 - # start_period: 300s + healthcheck: + test: ["CMD", "curl", "-X", "POST", "http://localhost:9650/ext/bc/morpheusvm/coreapi", "-H", "Content-Type: application/json", "-d", "{\"jsonrpc\":\"2.0\",\"method\":\"hypersdk.network\",\"params\":{},\"id\":1}"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 300s faucet: + container_name: faucet build: dockerfile: ./deploy/Dockerfile.faucet context: ../ @@ -28,19 +29,21 @@ services: restart: always ports: - "127.0.0.1:8765:8765" - - # TODO: restore healthcheck + depends_on: + devnet: + condition: service_healthy + # TODO: rewrite healthcheck # healthcheck: # test: ["CMD", "nc", "-z", "localhost", "8765"] # interval: 10s # timeout: 5s # retries: 5 # start_period: 300s - # depends_on: - # - devnet - caddy: + proxy: + container_name: proxy restart: always + profiles: ["prod"] # this prevents the proxy from being built by default build: dockerfile: ./Dockerfile.proxy ports: @@ -51,6 +54,9 @@ services: - caddy_config:/config environment: - SERVE_DOMAIN + depends_on: + - devnet + - faucet volumes: caddy_data: