Skip to content

Commit

Permalink
devnet healthchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
containerman17 authored Aug 20, 2024
1 parent a9c2805 commit 873a47a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
5 changes: 4 additions & 1 deletion deploy/Dockerfile.devnet
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
ENTRYPOINT ["/bin/bash", "-c", "./scripts/stop.sh; ./scripts/run.sh && echo 'Devnet started' && tail -f /dev/null"]
30 changes: 18 additions & 12 deletions deploy/compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
devnet:
container_name: devnet
build:
dockerfile: ./Dockerfile.devnet
restart: always
Expand All @@ -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: ../
Expand All @@ -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:
Expand All @@ -51,6 +54,9 @@ services:
- caddy_config:/config
environment:
- SERVE_DOMAIN
depends_on:
- devnet
- faucet

volumes:
caddy_data:
Expand Down

0 comments on commit 873a47a

Please sign in to comment.