Skip to content

Commit

Permalink
feat: test metrics for proxy passing env
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Sep 12, 2024
1 parent 7ffbc0e commit 5d429f0
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 32 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/ci-e2e-no-metrics-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@ jobs:
go-version: "1.21"
check-latest: true
cache: false
- name: Set environment variable
run: echo "METRIC_DATABASE_ENABLED=false" >> $GITHUB_ENV
- name: pull pre-built images
run: sudo docker compose -f ci.docker-compose.yml pull
- name: check env vars
run: sudo echo "METRIC_DATABASE_ENABLED=$METRIC_DATABASE_ENABLED"
run: sudo docker compose -f ci.docker-compose.yml -f ci.docker-compose-no-metrics-proxy.yml pull
- name: build and start proxy service and it's dependencies
run: sudo docker compose -f ci.docker-compose.yml up -d --build proxy redis
run: sudo docker compose -f ci.docker-compose.yml -f ci.docker-compose-no-metrics-proxy.yml up -d --build proxy redis
- name: wait for proxy service to be running
run: bash ${GITHUB_WORKSPACE}/scripts/wait-for-proxy-service-running.sh
env:
PROXY_CONTAINER_PORT: 7777
- name: run e2e tests
run: SKIP_METRICS=true make e2e-test
- name: print proxy service logs
run: sudo docker compose -f ci.docker-compose.yml logs proxy
run: sudo docker compose -f ci.docker-compose-no-metrics-proxy.yml logs proxy
# because we especially want the logs if the test(s) fail 😅
if: always()
# Finally, "Post Run jpribyl/[email protected]",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
check-latest: true
cache: true
- name: pull pre-built images
run: sudo docker compose -f ci.docker-compose.yml pull
run: sudo docker compose -f ci.docker-compose.yml -f ci.docker-compose-proxy.yml pull
# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
Expand All @@ -25,7 +25,7 @@ jobs:
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
- name: build and start proxy service and it's dependencies
run: sudo docker compose -f ci.docker-compose.yml up -d --build
run: sudo docker compose -f ci.docker-compose.yml -f ci.docker-compose-proxy.yml up -d --build
- name: wait for proxy service to be running
run: bash ${GITHUB_WORKSPACE}/scripts/wait-for-proxy-service-running.sh
env:
Expand All @@ -39,7 +39,7 @@ jobs:
- name: run e2e tests
run: make e2e-test
- name: print proxy service logs
run: sudo docker compose -f ci.docker-compose.yml logs proxy
run: sudo docker compose -f ci.docker-compose-proxy.yml logs proxy
# because we especially want the logs if the test(s) fail 😅
if: always()
# Finally, "Post Run jpribyl/[email protected]",
Expand Down
24 changes: 24 additions & 0 deletions ci.docker-compose-no-metrics-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
services:
# run proxy service to observe, route, and scale requests to kava api endpoints
proxy:
build:
dockerfile: ci.Dockerfile
env_file: .env
environment:
METRIC_DATABASE_ENABLED: "false"
PROXY_HEIGHT_BASED_ROUTING_ENABLED: "true"
PROXY_SHARDED_ROUTING_ENABLED: "true"
# use public testnet as backend origin server to avoid having
# to self-host a beefy Github Action runner
# to build and run a kava node each execution
PROXY_BACKEND_HOST_URL_MAP: localhost:7777>https://evmrpcdata.internal.testnet.proxy.kava.io,localhost:7778>https://evmrpc.internal.testnet.proxy.kava.io
PROXY_PRUNING_BACKEND_HOST_URL_MAP: localhost:7777>https://evmrpc.internal.testnet.proxy.kava.io
# fake the shards by defining shards with existing backends
PROXY_SHARD_BACKEND_HOST_URL_MAP: localhost:7777>10|https://evmrpcdata.internal.testnet.proxy.kava.io|20|https://evmrpcdata.internal.testnet.proxy.kava.io
EVM_QUERY_SERVICE_URL: https://evmrpc.internal.testnet.proxy.kava.io
ports:
- "${PROXY_HOST_PORT}:${PROXY_CONTAINER_PORT}"
- "${TEST_UNCONFIGURED_PROXY_PORT}:${PROXY_CONTAINER_PORT}"
- "${PROXY_CONTAINER_EVM_RPC_PRUNING_PORT}:${PROXY_CONTAINER_PORT}"
- "${PROXY_HOST_DEBUG_PORT}:${PROXY_CONTAINER_DEBUG_PORT}"
23 changes: 23 additions & 0 deletions ci.docker-compose-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
services:
# run proxy service to observe, route, and scale requests to kava api endpoints
proxy:
build:
dockerfile: ci.Dockerfile
env_file: .env
environment:
PROXY_HEIGHT_BASED_ROUTING_ENABLED: "true"
PROXY_SHARDED_ROUTING_ENABLED: "true"
# use public testnet as backend origin server to avoid having
# to self-host a beefy Github Action runner
# to build and run a kava node each execution
PROXY_BACKEND_HOST_URL_MAP: localhost:7777>https://evmrpcdata.internal.testnet.proxy.kava.io,localhost:7778>https://evmrpc.internal.testnet.proxy.kava.io
PROXY_PRUNING_BACKEND_HOST_URL_MAP: localhost:7777>https://evmrpc.internal.testnet.proxy.kava.io
# fake the shards by defining shards with existing backends
PROXY_SHARD_BACKEND_HOST_URL_MAP: localhost:7777>10|https://evmrpcdata.internal.testnet.proxy.kava.io|20|https://evmrpcdata.internal.testnet.proxy.kava.io
EVM_QUERY_SERVICE_URL: https://evmrpc.internal.testnet.proxy.kava.io
ports:
- "${PROXY_HOST_PORT}:${PROXY_CONTAINER_PORT}"
- "${TEST_UNCONFIGURED_PROXY_PORT}:${PROXY_CONTAINER_PORT}"
- "${PROXY_CONTAINER_EVM_RPC_PRUNING_PORT}:${PROXY_CONTAINER_PORT}"
- "${PROXY_HOST_DEBUG_PORT}:${PROXY_CONTAINER_DEBUG_PORT}"
22 changes: 0 additions & 22 deletions ci.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,3 @@ services:
- "${REDIS_HOST_PORT}:${REDIS_CONTAINER_PORT}"
expose:
- "${REDIS_CONTAINER_PORT}"
# run proxy service to observe, route, and scale requests to kava api endpoints
proxy:
build:
dockerfile: ci.Dockerfile
env_file: .env
environment:
METRIC_DATABASE_ENABLED: "${METRIC_DATABASE_ENABLED:-true}"
PROXY_HEIGHT_BASED_ROUTING_ENABLED: "true"
PROXY_SHARDED_ROUTING_ENABLED: "true"
# use public testnet as backend origin server to avoid having
# to self-host a beefy Github Action runner
# to build and run a kava node each execution
PROXY_BACKEND_HOST_URL_MAP: localhost:7777>https://evmrpcdata.internal.testnet.proxy.kava.io,localhost:7778>https://evmrpc.internal.testnet.proxy.kava.io
PROXY_PRUNING_BACKEND_HOST_URL_MAP: localhost:7777>https://evmrpc.internal.testnet.proxy.kava.io
# fake the shards by defining shards with existing backends
PROXY_SHARD_BACKEND_HOST_URL_MAP: localhost:7777>10|https://evmrpcdata.internal.testnet.proxy.kava.io|20|https://evmrpcdata.internal.testnet.proxy.kava.io
EVM_QUERY_SERVICE_URL: https://evmrpc.internal.testnet.proxy.kava.io
ports:
- "${PROXY_HOST_PORT}:${PROXY_CONTAINER_PORT}"
- "${TEST_UNCONFIGURED_PROXY_PORT}:${PROXY_CONTAINER_PORT}"
- "${PROXY_CONTAINER_EVM_RPC_PRUNING_PORT}:${PROXY_CONTAINER_PORT}"
- "${PROXY_HOST_DEBUG_PORT}:${PROXY_CONTAINER_DEBUG_PORT}"

0 comments on commit 5d429f0

Please sign in to comment.