From 62a8c5ef6240b9f4b425ff00e40a832beef06963 Mon Sep 17 00:00:00 2001 From: sweexordious Date: Wed, 3 Jan 2024 13:09:45 +0100 Subject: [PATCH] chore: use env variables for e2e scripts --- e2e/docker-compose.yml | 5 +++++ .../start_orchestrator_after_validator_created.sh | 14 ++++++++------ e2e/scripts/start_relayer.sh | 8 +++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 875ef3a7..b24500e4 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -50,6 +50,7 @@ services: - P2P_BOOTSTRAPPERS= - P2P_IDENTITY=f7fd2be6b2abaa8519b0570d3a12e684a397456b0cc721198ebdd7e343cdd8f41813ef8aa857426c4e909c4fe19120a0f3f8c505286ca9d9249b5681475ec459 - P2P_LISTEN=/ip4/0.0.0.0/tcp/30000 + - METRICS_ENDPOINT=otel-collector:4318 entrypoint: [ "/bin/bash" ] @@ -108,6 +109,7 @@ services: - CORE_GRPC_PORT=9090 - P2P_BOOTSTRAPPERS=/dns/core0-orch/tcp/30000/p2p/12D3KooWBSMasWzRSRKXREhediFUwABNZwzJbkZcYz5rYr9Zdmfn - P2P_LISTEN=/ip4/0.0.0.0/tcp/30000 + - METRICS_ENDPOINT=otel-collector:4318 entrypoint: [ "/bin/bash" ] @@ -166,6 +168,7 @@ services: - CORE_GRPC_PORT=9090 - P2P_BOOTSTRAPPERS=/dns/core0-orch/tcp/30000/p2p/12D3KooWBSMasWzRSRKXREhediFUwABNZwzJbkZcYz5rYr9Zdmfn - P2P_LISTEN=/ip4/0.0.0.0/tcp/30000 + - METRICS_ENDPOINT=otel-collector:4318 entrypoint: [ "/bin/bash" ] @@ -224,6 +227,7 @@ services: - CORE_GRPC_PORT=9090 - P2P_BOOTSTRAPPERS=/dns/core0-orch/tcp/30000/p2p/12D3KooWBSMasWzRSRKXREhediFUwABNZwzJbkZcYz5rYr9Zdmfn - P2P_LISTEN=/ip4/0.0.0.0/tcp/30000 + - METRICS_ENDPOINT=otel-collector:4318 entrypoint: [ "/bin/bash" ] @@ -302,6 +306,7 @@ services: - STARTING_NONCE=latest - P2P_BOOTSTRAPPERS=/dns/core0-orch/tcp/30000/p2p/12D3KooWBSMasWzRSRKXREhediFUwABNZwzJbkZcYz5rYr9Zdmfn - P2P_LISTEN=/ip4/0.0.0.0/tcp/30000 + - METRICS_ENDPOINT=otel-collector:4318 # set the following environment variable to some value # if you want to relay to an existing Blobstream contract # - BLOBSTREAM_CONTRACT=0x123 diff --git a/e2e/scripts/start_orchestrator_after_validator_created.sh b/e2e/scripts/start_orchestrator_after_validator_created.sh index e4cd3c27..7eef12ec 100644 --- a/e2e/scripts/start_orchestrator_after_validator_created.sh +++ b/e2e/scripts/start_orchestrator_after_validator_created.sh @@ -6,10 +6,10 @@ if [[ -z "${MONIKER}" || -z "${PRIVATE_KEY}" ]] || \ [[ -z "${CORE_GRPC_HOST}" || -z "${CORE_GRPC_PORT}" ]] || \ [[ -z "${CORE_RPC_HOST}" || -z "${CORE_RPC_PORT}" ]] || \ - [[ -z "${P2P_LISTEN}" ]] + [[ -z "${P2P_LISTEN}" || -z "${METRICS_ENDPOINT}" ]] then echo "Environment not setup correctly. Please set:" - echo "MONIKER, PRIVATE_KEY, CORE_GRPC_HOST, CORE_GRPC_PORT, CORE_RPC_HOST, CORE_RPC_PORT, P2P_LISTEN variables" + echo "MONIKER, PRIVATE_KEY, CORE_GRPC_HOST, CORE_GRPC_PORT, CORE_RPC_HOST, CORE_RPC_PORT, P2P_LISTEN, METRICS_ENDPOINT variables" exit 1 fi @@ -55,8 +55,9 @@ then --p2p.nickname=key \ --p2p.listen-addr="${P2P_LISTEN}" \ --evm.passphrase=123 \ - --log.level debug \ - --metrics --metrics.endpoint otel-collector:4318 #TODO use env vars + --log.level=debug \ + --metrics \ + --metrics.endpoint="${METRICS_ENDPOINT}" else # to give time for the bootstrappers to be up sleep 5s @@ -69,6 +70,7 @@ else --p2p.listen-addr="${P2P_LISTEN}" \ --p2p.bootstrappers="${P2P_BOOTSTRAPPERS}" \ --evm.passphrase=123 \ - --log.level debug \ - --metrics --metrics.endpoint otel-collector:4318 #TODO use env vars + --log.level=debug \ + --metrics \ + --metrics.endpoint="${METRICS_ENDPOINT}" fi diff --git a/e2e/scripts/start_relayer.sh b/e2e/scripts/start_relayer.sh index d6d2c657..4aa05fe4 100644 --- a/e2e/scripts/start_relayer.sh +++ b/e2e/scripts/start_relayer.sh @@ -8,10 +8,10 @@ if [[ -z "${EVM_CHAIN_ID}" || -z "${PRIVATE_KEY}" ]] || \ [[ -z "${CORE_GRPC_HOST}" || -z "${CORE_GRPC_PORT}" ]] || \ [[ -z "${CORE_RPC_HOST}" || -z "${CORE_RPC_PORT}" ]] || \ [[ -z "${EVM_ENDPOINT}" || -z "${P2P_BOOTSTRAPPERS}" ]] || \ - [[ -z "${P2P_LISTEN}" ]] + [[ -z "${P2P_LISTEN}" || -z "${METRICS_ENDPOINT}" ]] then echo "Environment not setup correctly. Please set:" - echo "EVM_CHAIN_ID, PRIVATE_KEY, CORE_GRPC_HOST, CORE_GRPC_PORT, CORE_RPC_HOST, CORE_RPC_PORT, EVM_ENDPOINT, P2P_BOOTSTRAPPERS, P2P_LISTEN variables" + echo "EVM_CHAIN_ID, PRIVATE_KEY, CORE_GRPC_HOST, CORE_GRPC_PORT, CORE_RPC_HOST, CORE_RPC_PORT, EVM_ENDPOINT, P2P_BOOTSTRAPPERS, P2P_LISTEN, METRICS_ENDPOINT variables" exit 1 fi @@ -64,4 +64,6 @@ sleep 5s --p2p.bootstrappers="${P2P_BOOTSTRAPPERS}" \ --p2p.listen-addr="${P2P_LISTEN}" \ --evm.passphrase=123 \ - --metrics --metrics.endpoint otel-collector:4318 --log.level debug #TODO add env vars + --metrics \ + --metrics.endpoint="${METRICS_ENDPOINT}" \ + --log.level=debug