diff --git a/.github/workflows/ci-e2e-no-metrics-tests.yml b/.github/workflows/ci-e2e-no-metrics-tests.yml index 0f3675d..7f03b23 100644 --- a/.github/workflows/ci-e2e-no-metrics-tests.yml +++ b/.github/workflows/ci-e2e-no-metrics-tests.yml @@ -14,14 +14,10 @@ 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: @@ -29,7 +25,7 @@ jobs: - 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/action-docker-layer-caching@v0.1.1", diff --git a/.github/workflows/ci-e2e-tests.yml b/.github/workflows/ci-e2e-tests.yml index 54bf211..ab045dc 100644 --- a/.github/workflows/ci-e2e-tests.yml +++ b/.github/workflows/ci-e2e-tests.yml @@ -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. @@ -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: @@ -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/action-docker-layer-caching@v0.1.1", diff --git a/ci.docker-compose-no-metrics-proxy.yml b/ci.docker-compose-no-metrics-proxy.yml new file mode 100644 index 0000000..c7429db --- /dev/null +++ b/ci.docker-compose-no-metrics-proxy.yml @@ -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}" diff --git a/ci.docker-compose-proxy.yml b/ci.docker-compose-proxy.yml new file mode 100644 index 0000000..fccb31b --- /dev/null +++ b/ci.docker-compose-proxy.yml @@ -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}" diff --git a/ci.docker-compose.yml b/ci.docker-compose.yml index afdee1d..4199164 100644 --- a/ci.docker-compose.yml +++ b/ci.docker-compose.yml @@ -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}"