From b418f2490e5898a50d149d6c67ff6d16528ebf42 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 15:27:04 +0000 Subject: [PATCH 01/31] show ethereum node logs --- spartan/aztec-network/templates/boot-node.yaml | 2 +- spartan/aztec-network/templates/prover-node.yaml | 2 +- spartan/aztec-network/templates/validator.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index f0ee82aabe0..662358aaa0a 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -36,7 +36,7 @@ spec: until curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ ${ETHEREUM_HOST} | grep -q reth; do - echo "Waiting for Ethereum node..." + echo "Waiting for Ethereum node ${ETHEREUM_HOST}..." sleep 5 done echo "Ethereum node is ready!" diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index bf13dad1821..b29bd052085 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -35,7 +35,7 @@ spec: until curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ ${ETHEREUM_HOST} | grep -q reth; do - echo "Waiting for Ethereum node..." + echo "Waiting for Ethereum node ${ETHEREUM_HOST}..." sleep 5 done echo "Ethereum node is ready!" diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 6f8aba191b2..7a6e1d13502 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -37,7 +37,7 @@ spec: until curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ $ETHEREUM_HOST | grep -q reth; do - echo "Waiting for Ethereum node..." + echo "Waiting for Ethereum node ${ETHEREUM_HOST}..." sleep 5 done echo "Ethereum node is ready!" From 19bf3677838f1735cbb56ea407ff37cab93d3fe0 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 16:53:46 +0000 Subject: [PATCH 02/31] fix --- spartan/aztec-network/templates/boot-node.yaml | 6 ++++-- spartan/aztec-network/templates/deploy-l1-verifier.yaml | 1 + spartan/aztec-network/templates/prover-agent.yaml | 6 ++++-- spartan/aztec-network/templates/prover-broker.yaml | 4 +++- spartan/aztec-network/templates/prover-node.yaml | 3 ++- spartan/aztec-network/templates/pxe.yaml | 2 ++ spartan/aztec-network/templates/setup-l2-contracts.yaml | 1 + spartan/aztec-network/templates/transaction-bot.yaml | 2 ++ spartan/aztec-network/templates/validator.yaml | 4 +++- 9 files changed, 22 insertions(+), 7 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 662358aaa0a..677c238b174 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -32,6 +32,7 @@ spec: - -c - | source /shared/config/service-addresses + cat /shared/config/service-addresses echo "Awaiting ethereum node at ${ETHEREUM_HOST}" until curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ @@ -41,8 +42,9 @@ spec: done echo "Ethereum node is ready!" {{- if .Values.telemetry.enabled }} - until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do - echo "Waiting for OpenTelemetry collector..." + OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" + until curl --head --silent $OTEL_COLLECTOR > /dev/null; do + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done echo "OpenTelemetry collector is ready!" diff --git a/spartan/aztec-network/templates/deploy-l1-verifier.yaml b/spartan/aztec-network/templates/deploy-l1-verifier.yaml index 8866dd1ca09..ef003adfb42 100644 --- a/spartan/aztec-network/templates/deploy-l1-verifier.yaml +++ b/spartan/aztec-network/templates/deploy-l1-verifier.yaml @@ -44,6 +44,7 @@ spec: chmod +x /tmp/setup-service-addresses.sh /tmp/setup-service-addresses.sh source /shared/config/service-addresses + cat /shared/config/service-addresses until curl -s -X GET "$BOOT_NODE_HOST/status"; do echo "Waiting for Aztec node $BOOT_NODE_HOST..." diff --git a/spartan/aztec-network/templates/prover-agent.yaml b/spartan/aztec-network/templates/prover-agent.yaml index ef080501868..6bdf76cf826 100644 --- a/spartan/aztec-network/templates/prover-agent.yaml +++ b/spartan/aztec-network/templates/prover-agent.yaml @@ -50,14 +50,16 @@ spec: - -c - | source /shared/config/service-addresses + cat /shared/config/service-addresses until curl -s -X POST ${PROVER_BROKER_HOST}/status; do echo "Waiting for broker ${PROVER_BROKER_HOST} ..." sleep 5 done echo "Broker is ready!" {{- if .Values.telemetry.enabled }} - until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do - echo "Waiting for OpenTelemetry collector..." + OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" + until curl --head --silent $OTEL_COLLECTOR > /dev/null; do + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done echo "OpenTelemetry collector is ready!" diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index 214b6720fce..feabd706d39 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -36,9 +36,11 @@ spec: - -c - | source /shared/config/service-addresses + cat /shared/config/service-addresses {{- if .Values.telemetry.enabled }} + OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do - echo "Waiting for OpenTelemetry collector..." + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done echo "OpenTelemetry collector is ready!" diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index b29bd052085..c849796d52f 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -51,8 +51,9 @@ spec: fi {{- if .Values.telemetry.enabled }} + OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do - echo "Waiting for OpenTelemetry collector..." + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done echo "OpenTelemetry collector is ready!" diff --git a/spartan/aztec-network/templates/pxe.yaml b/spartan/aztec-network/templates/pxe.yaml index 94a8a87886c..e65aed1b21c 100644 --- a/spartan/aztec-network/templates/pxe.yaml +++ b/spartan/aztec-network/templates/pxe.yaml @@ -37,6 +37,7 @@ spec: - -c - | source /shared/config/service-addresses + cat /shared/config/service-addresses until curl --head --silent ${BOOT_NODE_HOST}/status; do echo "Waiting for boot node..." sleep 5 @@ -68,6 +69,7 @@ spec: - "-c" - | source /shared/config/service-addresses + cat /shared/config/service-addresses {{- if .Values.network.public }} # If the network is public, we need to use the boot node URL export AZTEC_NODE_URL=${BOOT_NODE_HOST} diff --git a/spartan/aztec-network/templates/setup-l2-contracts.yaml b/spartan/aztec-network/templates/setup-l2-contracts.yaml index 56cf8fc57f2..594bc1480e5 100644 --- a/spartan/aztec-network/templates/setup-l2-contracts.yaml +++ b/spartan/aztec-network/templates/setup-l2-contracts.yaml @@ -48,6 +48,7 @@ spec: chmod +x /tmp/setup-service-addresses.sh /tmp/setup-service-addresses.sh source /shared/config/service-addresses + cat /shared/config/service-addresses export AZTEC_NODE_URL=$BOOT_NODE_HOST export PXE_URL=$BOOT_NODE_HOST until curl -s -X POST -H 'content-type: application/json' \ diff --git a/spartan/aztec-network/templates/transaction-bot.yaml b/spartan/aztec-network/templates/transaction-bot.yaml index cd5b88a13bd..e579b1491fc 100644 --- a/spartan/aztec-network/templates/transaction-bot.yaml +++ b/spartan/aztec-network/templates/transaction-bot.yaml @@ -38,6 +38,7 @@ spec: - -c - | source /shared/config/service-addresses + cat /shared/config/service-addresses {{- if .Values.bot.nodeUrl }} export AZTEC_NODE_URL={{ .Values.bot.nodeUrl }} {{- else if .Values.network.public }} @@ -63,6 +64,7 @@ spec: - "-c" - | source /shared/config/service-addresses + cat /shared/config/service-addresses {{- if .Values.bot.nodeUrl }} export AZTEC_NODE_URL={{ .Values.bot.nodeUrl }} {{- else if .Values.network.public }} diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 7a6e1d13502..3bd57b3b2ab 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -33,6 +33,7 @@ spec: - -c - | source /shared/config/service-addresses + cat /shared/config/service-addresses # First check ethereum node until curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ @@ -43,8 +44,9 @@ spec: echo "Ethereum node is ready!" {{- if .Values.telemetry.enabled }} + OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do - echo "Waiting for OpenTelemetry collector..." + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done echo "OpenTelemetry collector is ready!" From be93a1e2a17575621079f73e22769088d5c91a20 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 18:17:19 +0000 Subject: [PATCH 03/31] remove gotcha from deploy spartan script --- spartan/scripts/deploy_spartan.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index 96a8ef2c68d..d699e32c736 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -5,11 +5,6 @@ set -o pipefail TAG=$1 VALUES=$2 NAMESPACE=${3:-spartan} -PROD=${4:-true} -PROD_ARGS="" -if [ "$PROD" = "true" ] ; then - PROD_ARGS="--set network.public=true --set telemetry.enabled=true --set telemetry.otelCollectorEndpoint=http://metrics-opentelemetry-collector.metrics:4318" -fi SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ -z "$TAG" ]; then @@ -51,13 +46,13 @@ function upgrade() { helm template $NAMESPACE $SCRIPT_DIR/../aztec-network \ --namespace $NAMESPACE \ --create-namespace \ - --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml $PROD_ARGS \ + --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ --set images.aztec.image="$IMAGE" else helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ --namespace $NAMESPACE \ --create-namespace \ - --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml $PROD_ARGS \ + --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ --set images.aztec.image="$IMAGE" \ --wait \ --wait-for-jobs=true \ From e55f7058edd1fd93956df8c0a15c759e31d58a31 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 18:40:46 +0000 Subject: [PATCH 04/31] fix --- spartan/scripts/deploy_spartan.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index d699e32c736..1b646ea1745 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -5,6 +5,11 @@ set -o pipefail TAG=$1 VALUES=$2 NAMESPACE=${3:-spartan} +PROD=${4:-true} +PROD_ARGS="" +if [ "$PROD" = "true" ] ; then + PROD_ARGS="--set network.public=true" +fi SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ -z "$TAG" ]; then @@ -46,13 +51,13 @@ function upgrade() { helm template $NAMESPACE $SCRIPT_DIR/../aztec-network \ --namespace $NAMESPACE \ --create-namespace \ - --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ + --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml $PROD_ARGS \ --set images.aztec.image="$IMAGE" else helm upgrade --install $NAMESPACE $SCRIPT_DIR/../aztec-network \ --namespace $NAMESPACE \ --create-namespace \ - --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml \ + --values $SCRIPT_DIR/../aztec-network/values/$VALUES.yaml $PROD_ARGS \ --set images.aztec.image="$IMAGE" \ --wait \ --wait-for-jobs=true \ From 19923b2b7601f958e648d0a8eee9195dd37f318e Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 20:37:33 +0000 Subject: [PATCH 05/31] try to fix OTEL_COLLECTOR_ENDPOINT --- .../files/config/setup-service-addresses.sh | 15 +++++++++++ spartan/aztec-network/templates/_helpers.tpl | 26 ++----------------- .../aztec-network/templates/boot-node.yaml | 7 ----- .../aztec-network/templates/prover-agent.yaml | 7 ----- .../templates/prover-broker.yaml | 11 +++----- .../aztec-network/templates/prover-node.yaml | 7 ----- .../aztec-network/templates/validator.yaml | 7 ----- .../1-validator-with-proving-and-metrics.yaml | 3 +-- .../values/16-validators-with-metrics.yaml | 1 - .../values/3-validators-with-metrics.yaml | 1 - .../values/4-validators-with-metrics.yaml | 1 - .../aztec-network/values/48-validators.yaml | 1 - .../values/gcp-proving-test.yaml | 1 - .../aztec-network/values/multicloud-demo.yaml | 1 - .../values/prover-node-with-agents.yaml | 1 - 15 files changed, 21 insertions(+), 69 deletions(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 5ca3bb5a248..9f1b15236b7 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -87,11 +87,26 @@ else PROVER_BROKER_ADDR="http://${SERVICE_NAME}-prover-broker.${NAMESPACE}:${PROVER_BROKER_PORT}" fi +# Configure OTEL_COLLECTOR_ENDPOINT if not set in values file +if [ "${OTEL_COLLECTOR_ENDPOINT}" != "" ]; then + OTEL_COLLECTOR_PORT=${OTEL_COLLECTOR_PORT:-4318} + if [ "${OTEL_COLLECTOR_EXTERNAL_HOST}" != "" ]; then + OTEL_COLLECTOR_ENDPOINT="${OTEL_COLLECTOR_EXTERNAL_HOST}" + elif [ "${NETWORK_PUBLIC}" = "true" ]; then + OTEL_COLLECTOR_ENDPOINT=$(NAMESPACE=metrics get_service_address "metrics-opentelemetry-collector" $OTEL_COLLECTOR_PORT) + else + OTEL_COLLECTOR_ENDPOINT="http://metrics-opentelemetry-collector.metrics:$OTEL_COLLECTOR_PORT" + fi +fi # Write addresses to file for sourcing echo "export ETHEREUM_HOST=${ETHEREUM_ADDR}" >> /shared/config/service-addresses echo "export BOOT_NODE_HOST=${BOOT_NODE_ADDR}" >> /shared/config/service-addresses echo "export PROVER_NODE_HOST=${PROVER_NODE_ADDR}" >> /shared/config/service-addresses echo "export PROVER_BROKER_HOST=${PROVER_BROKER_ADDR}" >> /shared/config/service-addresses +echo "export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/logs" >> /shared/config/service-addresses +echo "export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/metrics" >> /shared/config/service-addresses +echo "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/traces" >> /shared/config/service-addresses + echo "Addresses configured:" cat /shared/config/service-addresses diff --git a/spartan/aztec-network/templates/_helpers.tpl b/spartan/aztec-network/templates/_helpers.tpl index 3db484690a0..355ce8f3ad2 100644 --- a/spartan/aztec-network/templates/_helpers.tpl +++ b/spartan/aztec-network/templates/_helpers.tpl @@ -68,30 +68,6 @@ http://{{ include "aztec-network.fullname" . }}-validator.{{ .Release.Namespace http://{{ include "aztec-network.fullname" . }}-metrics.{{ .Release.Namespace }} {{- end -}} -{{- define "aztec-network.otelCollectorMetricsEndpoint" -}} -{{- if .Values.telemetry.enabled -}} -{{- if .Values.telemetry.otelCollectorEndpoint -}} -{{- .Values.telemetry.otelCollectorEndpoint -}}/v1/metrics -{{- end -}} -{{- end -}} -{{- end -}} - -{{- define "aztec-network.otelCollectorTracesEndpoint" -}} -{{- if .Values.telemetry.enabled -}} -{{- if .Values.telemetry.otelCollectorEndpoint -}} -{{- .Values.telemetry.otelCollectorEndpoint -}}/v1/traces -{{- end -}} -{{- end -}} -{{- end -}} - -{{- define "aztec-network.otelCollectorLogsEndpoint" -}} -{{- if .Values.telemetry.enabled -}} -{{- if .Values.telemetry.otelCollectorEndpoint -}} -{{- .Values.telemetry.otelCollectorEndpoint -}}/v1/logs -{{- end -}} -{{- end -}} -{{- end -}} - {{- define "helpers.flag" -}} {{- $name := index . 0 -}} {{- $value := index . 1 -}} @@ -153,6 +129,8 @@ Service Address Setup Container value: "{{ .Values.network.public }}" - name: NAMESPACE value: {{ .Release.Namespace }} + - name: OTEL_COLLECTOR_ENDPOINT + values: {{- .Values.telemetry.otelCollectorEndpoint -}} - name: EXTERNAL_ETHEREUM_HOST value: "{{ .Values.ethereum.externalHost }}" - name: ETHEREUM_PORT diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 677c238b174..aa6f89ddda8 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -42,7 +42,6 @@ spec: done echo "Ethereum node is ready!" {{- if .Values.telemetry.enabled }} - OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" until curl --head --silent $OTEL_COLLECTOR > /dev/null; do echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 @@ -152,12 +151,6 @@ spec: value: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - - name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - value: {{ include "aztec-network.otelCollectorMetricsEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: {{ include "aztec-network.otelCollectorTracesEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT - value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} - name: PROVER_REAL_PROOFS value: "{{ .Values.bootNode.realProofs }}" - name: PXE_PROVER_ENABLED diff --git a/spartan/aztec-network/templates/prover-agent.yaml b/spartan/aztec-network/templates/prover-agent.yaml index 6bdf76cf826..9ddd6f24fdc 100644 --- a/spartan/aztec-network/templates/prover-agent.yaml +++ b/spartan/aztec-network/templates/prover-agent.yaml @@ -57,7 +57,6 @@ spec: done echo "Broker is ready!" {{- if .Values.telemetry.enabled }} - OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" until curl --head --silent $OTEL_COLLECTOR > /dev/null; do echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 @@ -99,12 +98,6 @@ spec: value: {{ join "," .Values.proverAgent.proofTypes | quote }} - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - - name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - value: {{ include "aztec-network.otelCollectorMetricsEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: {{ include "aztec-network.otelCollectorTracesEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT - value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} resources: {{- toYaml .Values.proverAgent.resources | nindent 12 }} {{- end }} diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index feabd706d39..cbd7ff4166e 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -38,8 +38,7 @@ spec: source /shared/config/service-addresses cat /shared/config/service-addresses {{- if .Values.telemetry.enabled }} - OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" - until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do + until curl --head --silent $OTEL_COLLECTOR > /dev/null; do echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done @@ -80,12 +79,8 @@ spec: value: "{{ .Values.proverBroker.dataDirectory }}" - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - - name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - value: {{ include "aztec-network.otelCollectorMetricsEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: {{ include "aztec-network.otelCollectorTracesEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT - value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} + - name: OTEL_COLLECTOR_ENDPOINT + value: {{ include "aztec-network.otelCollectorEndpoint" . | quote }} resources: {{- toYaml .Values.proverBroker.resources | nindent 12 }} --- diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index c849796d52f..177306bc3ba 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -51,7 +51,6 @@ spec: fi {{- if .Values.telemetry.enabled }} - OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 @@ -143,12 +142,6 @@ spec: value: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - - name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - value: {{ include "aztec-network.otelCollectorMetricsEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: {{ include "aztec-network.otelCollectorTracesEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT - value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} - name: L1_CHAIN_ID value: "{{ .Values.ethereum.chainId }}" - name: P2P_ENABLED diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 3bd57b3b2ab..a883d489704 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -44,7 +44,6 @@ spec: echo "Ethereum node is ready!" {{- if .Values.telemetry.enabled }} - OTEL_COLLECTOR="{{ include "aztec-network.otelCollectorMetricsEndpoint" . }}" until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 @@ -167,12 +166,6 @@ spec: value: "{{ .Values.ethereum.chainId }}" - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - - name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT - value: {{ include "aztec-network.otelCollectorMetricsEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: {{ include "aztec-network.otelCollectorTracesEndpoint" . | quote }} - - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT - value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} - name: ETHEREUM_SLOT_DURATION value: "{{ .Values.ethereum.blockTime }}" - name: AZTEC_SLOT_DURATION diff --git a/spartan/aztec-network/values/1-validator-with-proving-and-metrics.yaml b/spartan/aztec-network/values/1-validator-with-proving-and-metrics.yaml index 2a10cd3473f..29e812e2995 100644 --- a/spartan/aztec-network/values/1-validator-with-proving-and-metrics.yaml +++ b/spartan/aztec-network/values/1-validator-with-proving-and-metrics.yaml @@ -44,5 +44,4 @@ aztec: epochDuration: 32 telemetry: - enabled: true - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 + enabled: true \ No newline at end of file diff --git a/spartan/aztec-network/values/16-validators-with-metrics.yaml b/spartan/aztec-network/values/16-validators-with-metrics.yaml index 8bc8f2c115c..454ec8c2839 100644 --- a/spartan/aztec-network/values/16-validators-with-metrics.yaml +++ b/spartan/aztec-network/values/16-validators-with-metrics.yaml @@ -6,7 +6,6 @@ # (then `./forward.sh` if you want to see it) telemetry: enabled: true - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 validator: replicas: 16 diff --git a/spartan/aztec-network/values/3-validators-with-metrics.yaml b/spartan/aztec-network/values/3-validators-with-metrics.yaml index b20b34b5194..c3a57e25228 100644 --- a/spartan/aztec-network/values/3-validators-with-metrics.yaml +++ b/spartan/aztec-network/values/3-validators-with-metrics.yaml @@ -6,7 +6,6 @@ # (then `./forward.sh` if you want to see it) telemetry: enabled: true - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 validator: replicas: 3 diff --git a/spartan/aztec-network/values/4-validators-with-metrics.yaml b/spartan/aztec-network/values/4-validators-with-metrics.yaml index 47387cd89c1..6f59aa62708 100644 --- a/spartan/aztec-network/values/4-validators-with-metrics.yaml +++ b/spartan/aztec-network/values/4-validators-with-metrics.yaml @@ -6,7 +6,6 @@ # (then `./forward.sh` if you want to see it) telemetry: enabled: true - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 validator: replicas: 4 diff --git a/spartan/aztec-network/values/48-validators.yaml b/spartan/aztec-network/values/48-validators.yaml index 31d48095681..4659655e4d2 100644 --- a/spartan/aztec-network/values/48-validators.yaml +++ b/spartan/aztec-network/values/48-validators.yaml @@ -6,7 +6,6 @@ # (then `./forward.sh` if you want to see it) telemetry: enabled: true - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 validator: replicas: 48 diff --git a/spartan/aztec-network/values/gcp-proving-test.yaml b/spartan/aztec-network/values/gcp-proving-test.yaml index 6a361ecd025..d08156bb8eb 100644 --- a/spartan/aztec-network/values/gcp-proving-test.yaml +++ b/spartan/aztec-network/values/gcp-proving-test.yaml @@ -1,6 +1,5 @@ telemetry: enabled: true - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 validator: replicas: 1 diff --git a/spartan/aztec-network/values/multicloud-demo.yaml b/spartan/aztec-network/values/multicloud-demo.yaml index 6ba49557253..9bdccb129f2 100644 --- a/spartan/aztec-network/values/multicloud-demo.yaml +++ b/spartan/aztec-network/values/multicloud-demo.yaml @@ -2,7 +2,6 @@ telemetry: enabled: false - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 validator: replicas: 1 diff --git a/spartan/aztec-network/values/prover-node-with-agents.yaml b/spartan/aztec-network/values/prover-node-with-agents.yaml index 4a58f419958..fd484baa9d6 100644 --- a/spartan/aztec-network/values/prover-node-with-agents.yaml +++ b/spartan/aztec-network/values/prover-node-with-agents.yaml @@ -6,7 +6,6 @@ # (then `./forward.sh` if you want to see it) telemetry: enabled: true - otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 validator: external: true From b1f5fcd1c40f78dcd054fbf2409152cceadf785e Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 20:40:32 +0000 Subject: [PATCH 06/31] try to fix OTEL_COLLECTOR_ENDPOINT --- spartan/aztec-network/templates/prover-node.yaml | 2 +- spartan/aztec-network/templates/validator.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index 177306bc3ba..c043908139b 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -51,7 +51,7 @@ spec: fi {{- if .Values.telemetry.enabled }} - until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do + until curl --head --silent $OTEL_COLLECTOR > /dev/null; do echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index a883d489704..6404a53ba2d 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -44,7 +44,7 @@ spec: echo "Ethereum node is ready!" {{- if .Values.telemetry.enabled }} - until curl --head --silent {{ include "aztec-network.otelCollectorMetricsEndpoint" . }} > /dev/null; do + until curl --head --silent $OTEL_COLLECTOR > /dev/null; do echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." sleep 5 done From 432d9b8ebd65daf3bce3f6ecfe112561747b7ab7 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 20:43:20 +0000 Subject: [PATCH 07/31] try to fix OTEL_COLLECTOR_ENDPOINT --- spartan/aztec-network/templates/boot-node.yaml | 4 ++-- spartan/aztec-network/templates/prover-agent.yaml | 4 ++-- spartan/aztec-network/templates/prover-broker.yaml | 6 ++---- spartan/aztec-network/templates/prover-node.yaml | 4 ++-- spartan/aztec-network/templates/validator.yaml | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index aa6f89ddda8..d2fdaf10578 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -42,8 +42,8 @@ spec: done echo "Ethereum node is ready!" {{- if .Values.telemetry.enabled }} - until curl --head --silent $OTEL_COLLECTOR > /dev/null; do - echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." + until curl --head --silent $OTEL_COLLECTOR_ENDPOINT > /dev/null; do + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR_ENDPOINT..." sleep 5 done echo "OpenTelemetry collector is ready!" diff --git a/spartan/aztec-network/templates/prover-agent.yaml b/spartan/aztec-network/templates/prover-agent.yaml index 9ddd6f24fdc..23fd2d85a0d 100644 --- a/spartan/aztec-network/templates/prover-agent.yaml +++ b/spartan/aztec-network/templates/prover-agent.yaml @@ -57,8 +57,8 @@ spec: done echo "Broker is ready!" {{- if .Values.telemetry.enabled }} - until curl --head --silent $OTEL_COLLECTOR > /dev/null; do - echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." + until curl --head --silent $OTEL_COLLECTOR_ENDPOINT > /dev/null; do + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR_ENDPOINT..." sleep 5 done echo "OpenTelemetry collector is ready!" diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index cbd7ff4166e..87829de7ce3 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -38,8 +38,8 @@ spec: source /shared/config/service-addresses cat /shared/config/service-addresses {{- if .Values.telemetry.enabled }} - until curl --head --silent $OTEL_COLLECTOR > /dev/null; do - echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." + until curl --head --silent $OTEL_COLLECTOR_ENDPOINT > /dev/null; do + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR_ENDPOINT..." sleep 5 done echo "OpenTelemetry collector is ready!" @@ -79,8 +79,6 @@ spec: value: "{{ .Values.proverBroker.dataDirectory }}" - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - - name: OTEL_COLLECTOR_ENDPOINT - value: {{ include "aztec-network.otelCollectorEndpoint" . | quote }} resources: {{- toYaml .Values.proverBroker.resources | nindent 12 }} --- diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index c043908139b..4301f6187e8 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -51,8 +51,8 @@ spec: fi {{- if .Values.telemetry.enabled }} - until curl --head --silent $OTEL_COLLECTOR > /dev/null; do - echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." + until curl --head --silent $OTEL_COLLECTOR_ENDPOINT > /dev/null; do + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR_ENDPOINT..." sleep 5 done echo "OpenTelemetry collector is ready!" diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 6404a53ba2d..319dd8bf015 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -44,8 +44,8 @@ spec: echo "Ethereum node is ready!" {{- if .Values.telemetry.enabled }} - until curl --head --silent $OTEL_COLLECTOR > /dev/null; do - echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR..." + until curl --head --silent $OTEL_COLLECTOR_ENDPOINT > /dev/null; do + echo "Waiting for OpenTelemetry collector $OTEL_COLLECTOR_ENDPOINT..." sleep 5 done echo "OpenTelemetry collector is ready!" From 978a0b672bf8d10fcdc5ba20c8b0294cc5ea5be9 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 21:00:48 +0000 Subject: [PATCH 08/31] perms --- spartan/aztec-network/files/config/setup-service-addresses.sh | 2 +- spartan/aztec-network/templates/rbac.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 9f1b15236b7..4cc287d2d6d 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -88,7 +88,7 @@ else fi # Configure OTEL_COLLECTOR_ENDPOINT if not set in values file -if [ "${OTEL_COLLECTOR_ENDPOINT}" != "" ]; then +if [ "${OTEL_COLLECTOR_ENDPOINT}" = "" ]; then OTEL_COLLECTOR_PORT=${OTEL_COLLECTOR_PORT:-4318} if [ "${OTEL_COLLECTOR_EXTERNAL_HOST}" != "" ]; then OTEL_COLLECTOR_ENDPOINT="${OTEL_COLLECTOR_EXTERNAL_HOST}" diff --git a/spartan/aztec-network/templates/rbac.yaml b/spartan/aztec-network/templates/rbac.yaml index a0e8e68cd11..f5f1b6f24e5 100644 --- a/spartan/aztec-network/templates/rbac.yaml +++ b/spartan/aztec-network/templates/rbac.yaml @@ -56,3 +56,6 @@ subjects: - kind: ServiceAccount name: {{ include "aztec-network.fullname" . }}-node namespace: {{ .Release.Namespace }} +- kind: ServiceAccount + name: {{ include "aztec-network.fullname" . }}-node + namespace: metrics From 7e2ec05f220a1c069705833496a3d5247d7219fa Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 21:11:29 +0000 Subject: [PATCH 09/31] validator set --- .../aztec-network/files/config/setup-service-addresses.sh | 8 +------- spartan/aztec-network/templates/rbac.yaml | 5 +---- spartan/aztec-network/values/release.yaml | 4 ++-- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 4cc287d2d6d..cc7062b3dda 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -90,13 +90,7 @@ fi # Configure OTEL_COLLECTOR_ENDPOINT if not set in values file if [ "${OTEL_COLLECTOR_ENDPOINT}" = "" ]; then OTEL_COLLECTOR_PORT=${OTEL_COLLECTOR_PORT:-4318} - if [ "${OTEL_COLLECTOR_EXTERNAL_HOST}" != "" ]; then - OTEL_COLLECTOR_ENDPOINT="${OTEL_COLLECTOR_EXTERNAL_HOST}" - elif [ "${NETWORK_PUBLIC}" = "true" ]; then - OTEL_COLLECTOR_ENDPOINT=$(NAMESPACE=metrics get_service_address "metrics-opentelemetry-collector" $OTEL_COLLECTOR_PORT) - else - OTEL_COLLECTOR_ENDPOINT="http://metrics-opentelemetry-collector.metrics:$OTEL_COLLECTOR_PORT" - fi + OTEL_COLLECTOR_ENDPOINT="http://metrics-opentelemetry-collector.metrics:$OTEL_COLLECTOR_PORT" fi # Write addresses to file for sourcing diff --git a/spartan/aztec-network/templates/rbac.yaml b/spartan/aztec-network/templates/rbac.yaml index f5f1b6f24e5..94f143f619e 100644 --- a/spartan/aztec-network/templates/rbac.yaml +++ b/spartan/aztec-network/templates/rbac.yaml @@ -55,7 +55,4 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "aztec-network.fullname" . }}-node - namespace: {{ .Release.Namespace }} -- kind: ServiceAccount - name: {{ include "aztec-network.fullname" . }}-node - namespace: metrics + namespace: {{ .Release.Namespace }} \ No newline at end of file diff --git a/spartan/aztec-network/values/release.yaml b/spartan/aztec-network/values/release.yaml index e3e34dac3b8..4de8686e226 100644 --- a/spartan/aztec-network/values/release.yaml +++ b/spartan/aztec-network/values/release.yaml @@ -6,8 +6,8 @@ images: pullPolicy: Always telemetry: - enabled: true - otelCollectorEndpoint: http://34.150.160.154:4318 + enabled: trueA + otelCollectorEndpoint: http://34.150.160.154:4318A validator: realProofs: true From 556590aa4621692e11461b701dfdc48df4b46ff9 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 21:19:50 +0000 Subject: [PATCH 10/31] fix --- spartan/aztec-network/files/config/setup-service-addresses.sh | 1 + spartan/aztec-network/templates/_helpers.tpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index cc7062b3dda..7fd9e5c9193 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -98,6 +98,7 @@ echo "export ETHEREUM_HOST=${ETHEREUM_ADDR}" >> /shared/config/service-addresses echo "export BOOT_NODE_HOST=${BOOT_NODE_ADDR}" >> /shared/config/service-addresses echo "export PROVER_NODE_HOST=${PROVER_NODE_ADDR}" >> /shared/config/service-addresses echo "export PROVER_BROKER_HOST=${PROVER_BROKER_ADDR}" >> /shared/config/service-addresses +echo "export OTEL_COLLECTOR_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT" >> /shared/config/service-addresses echo "export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/logs" >> /shared/config/service-addresses echo "export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/metrics" >> /shared/config/service-addresses echo "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/traces" >> /shared/config/service-addresses diff --git a/spartan/aztec-network/templates/_helpers.tpl b/spartan/aztec-network/templates/_helpers.tpl index 355ce8f3ad2..26bcf088c70 100644 --- a/spartan/aztec-network/templates/_helpers.tpl +++ b/spartan/aztec-network/templates/_helpers.tpl @@ -130,7 +130,7 @@ Service Address Setup Container - name: NAMESPACE value: {{ .Release.Namespace }} - name: OTEL_COLLECTOR_ENDPOINT - values: {{- .Values.telemetry.otelCollectorEndpoint -}} + value: "{{ .Values.telemetry.otelCollectorEndpoint }}" - name: EXTERNAL_ETHEREUM_HOST value: "{{ .Values.ethereum.externalHost }}" - name: ETHEREUM_PORT From 04499745f3fc4db070bd589cb014446c37f7d66d Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 21:49:46 +0000 Subject: [PATCH 11/31] retry on l1 contract depoy --- .../files/config/deploy-l1-contracts.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spartan/aztec-network/files/config/deploy-l1-contracts.sh b/spartan/aztec-network/files/config/deploy-l1-contracts.sh index 4d976821f04..f748ab17975 100644 --- a/spartan/aztec-network/files/config/deploy-l1-contracts.sh +++ b/spartan/aztec-network/files/config/deploy-l1-contracts.sh @@ -9,12 +9,18 @@ export PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4 # Run the deploy-l1-contracts command and capture the output output="" -# if INIT_VALIDATORS is true, then we need to pass the validators flag to the deploy-l1-contracts command -if [ "$INIT_VALIDATORS" = "true" ]; then - output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --validators $2 --l1-chain-id $CHAIN_ID) -else - output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --l1-chain-id $CHAIN_ID) -fi +MAX_RETRIES=5 +RETRY_DELAY=60 +for attempt in $(seq 1 $MAX_RETRIES); do + # if INIT_VALIDATORS is true, then we need to pass the validators flag to the deploy-l1-contracts command + if [ "${INIT_VALIDATORS:-false}" = "true" ]; then + output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --validators "$2" --l1-chain-id "$CHAIN_ID") && break + else + output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --l1-chain-id "$CHAIN_ID") && break + fi + echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." >&2 + sleep "$RETRY_DELAY" +done || { echo "All l1 contract deploy attempts failed." >&2; exit 1; } echo "$output" From 1538531456f0f45b033852b19b3879e86ac31194 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 22:00:38 +0000 Subject: [PATCH 12/31] verifier deploy fix --- spartan/aztec-network/files/config/deploy-l1-contracts.sh | 4 ++-- spartan/aztec-network/templates/deploy-l1-verifier.yaml | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/spartan/aztec-network/files/config/deploy-l1-contracts.sh b/spartan/aztec-network/files/config/deploy-l1-contracts.sh index f748ab17975..2684b36c35e 100644 --- a/spartan/aztec-network/files/config/deploy-l1-contracts.sh +++ b/spartan/aztec-network/files/config/deploy-l1-contracts.sh @@ -18,9 +18,9 @@ for attempt in $(seq 1 $MAX_RETRIES); do else output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --l1-chain-id "$CHAIN_ID") && break fi - echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." >&2 + echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." sleep "$RETRY_DELAY" -done || { echo "All l1 contract deploy attempts failed." >&2; exit 1; } +done || { echo "All l1 contract deploy attempts failed."; exit 1; } echo "$output" diff --git a/spartan/aztec-network/templates/deploy-l1-verifier.yaml b/spartan/aztec-network/templates/deploy-l1-verifier.yaml index ef003adfb42..7f749a55326 100644 --- a/spartan/aztec-network/templates/deploy-l1-verifier.yaml +++ b/spartan/aztec-network/templates/deploy-l1-verifier.yaml @@ -58,7 +58,13 @@ spec: | jq -r '.result.rollupAddress.value') echo "Rollup contract address: $ROLLUP_CONTRACT_ADDRESS" - node /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-verifier --verifier real + MAX_RETRIES=5 + RETRY_DELAY=60 + for attempt in $(seq 1 $MAX_RETRIES); do + node /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-verifier --verifier real + echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." + sleep "$RETRY_DELAY" + done || { echo "All L1 verifier deploy attempts failed." >&2; exit 1; } echo "L1 verifier deployed" env: - name: NODE_NO_WARNINGS From 2059d4b39695ecfde6ad1f2b28c5a21f4a156d70 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 22:13:18 +0000 Subject: [PATCH 13/31] verifier deploy fix --- .../templates/deploy-l1-verifier.yaml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/spartan/aztec-network/templates/deploy-l1-verifier.yaml b/spartan/aztec-network/templates/deploy-l1-verifier.yaml index 7f749a55326..2b62060dbf4 100644 --- a/spartan/aztec-network/templates/deploy-l1-verifier.yaml +++ b/spartan/aztec-network/templates/deploy-l1-verifier.yaml @@ -51,19 +51,20 @@ spec: sleep 5 done echo "Boot node is ready!" - - export ROLLUP_CONTRACT_ADDRESS=$(curl -X POST -H 'Content-Type: application/json' \ - -d '{"jsonrpc":"2.0","method":"node_getL1ContractAddresses","params":[],"id":1}' \ - "$BOOT_NODE_HOST" \ - | jq -r '.result.rollupAddress.value') - - echo "Rollup contract address: $ROLLUP_CONTRACT_ADDRESS" MAX_RETRIES=5 RETRY_DELAY=60 for attempt in $(seq 1 $MAX_RETRIES); do - node /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-verifier --verifier real - echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." - sleep "$RETRY_DELAY" + export ROLLUP_CONTRACT_ADDRESS=$(curl -X POST -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getL1ContractAddresses","params":[],"id":1}' \ + "$BOOT_NODE_HOST" \ + | jq -r '.result.rollupAddress.value' || true) + + if [ -n "$ROLLUP_CONTRACT_ADDRESS" ]; then + echo "Rollup contract address: $ROLLUP_CONTRACT_ADDRESS" + node /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-verifier --verifier real + echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." + sleep "$RETRY_DELAY" + fi done || { echo "All L1 verifier deploy attempts failed." >&2; exit 1; } echo "L1 verifier deployed" env: From c8684e4cf06f57a892862b26e34a7c7fd2bed205 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 22:20:26 +0000 Subject: [PATCH 14/31] fix --- .../templates/deploy-l1-verifier.yaml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/spartan/aztec-network/templates/deploy-l1-verifier.yaml b/spartan/aztec-network/templates/deploy-l1-verifier.yaml index 2b62060dbf4..b60b4fefd39 100644 --- a/spartan/aztec-network/templates/deploy-l1-verifier.yaml +++ b/spartan/aztec-network/templates/deploy-l1-verifier.yaml @@ -51,20 +51,21 @@ spec: sleep 5 done echo "Boot node is ready!" + + l1_contracts=$(curl -X POST -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"node_getL1ContractAddresses","params":[],"id":1}' \ + "$BOOT_NODE_HOST") + echo "L1 Contracts" + echo $l1_contracts + export ROLLUP_CONTRACT_ADDRESS=$(cat $l1_contracts | jq -r '.result.rollupAddress') + [ -z "$ROLLUP_CONTRACT_ADDRESS" ] && echo "Could not retrieve rollup address!" exit 1 + echo "Rollup contract address: $ROLLUP_CONTRACT_ADDRESS" MAX_RETRIES=5 RETRY_DELAY=60 for attempt in $(seq 1 $MAX_RETRIES); do - export ROLLUP_CONTRACT_ADDRESS=$(curl -X POST -H 'Content-Type: application/json' \ - -d '{"jsonrpc":"2.0","method":"node_getL1ContractAddresses","params":[],"id":1}' \ - "$BOOT_NODE_HOST" \ - | jq -r '.result.rollupAddress.value' || true) - - if [ -n "$ROLLUP_CONTRACT_ADDRESS" ]; then - echo "Rollup contract address: $ROLLUP_CONTRACT_ADDRESS" - node /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-verifier --verifier real - echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." - sleep "$RETRY_DELAY" - fi + node /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-verifier --verifier real + echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." + sleep "$RETRY_DELAY" done || { echo "All L1 verifier deploy attempts failed." >&2; exit 1; } echo "L1 verifier deployed" env: From e0263a95dd1b9bbcb54fb315fdcc023743be4f47 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 22:29:22 +0000 Subject: [PATCH 15/31] retries --- spartan/aztec-network/templates/deploy-l1-verifier.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spartan/aztec-network/templates/deploy-l1-verifier.yaml b/spartan/aztec-network/templates/deploy-l1-verifier.yaml index b60b4fefd39..f38f96b5800 100644 --- a/spartan/aztec-network/templates/deploy-l1-verifier.yaml +++ b/spartan/aztec-network/templates/deploy-l1-verifier.yaml @@ -57,8 +57,8 @@ spec: "$BOOT_NODE_HOST") echo "L1 Contracts" echo $l1_contracts - export ROLLUP_CONTRACT_ADDRESS=$(cat $l1_contracts | jq -r '.result.rollupAddress') - [ -z "$ROLLUP_CONTRACT_ADDRESS" ] && echo "Could not retrieve rollup address!" exit 1 + export ROLLUP_CONTRACT_ADDRESS=$(echo $l1_contracts | jq -r '.result.rollupAddress') + [ -z "$ROLLUP_CONTRACT_ADDRESS" ] && echo "Could not retrieve rollup address!" && exit 1 echo "Rollup contract address: $ROLLUP_CONTRACT_ADDRESS" MAX_RETRIES=5 RETRY_DELAY=60 From e7bf83195cfa98a922e98b973ccdff23f94c2a81 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 22:37:05 +0000 Subject: [PATCH 16/31] values file --- .../aztec-network/values/release-devnet.yaml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 spartan/aztec-network/values/release-devnet.yaml diff --git a/spartan/aztec-network/values/release-devnet.yaml b/spartan/aztec-network/values/release-devnet.yaml new file mode 100644 index 00000000000..cf4f8d995a8 --- /dev/null +++ b/spartan/aztec-network/values/release-devnet.yaml @@ -0,0 +1,29 @@ +########## +# BEWARE # +########## +# You need to deploy the metrics helm chart before using this values file. +# head to spartan/metrics and run `./install.sh` +# (then `./forward.sh` if you want to see it) +telemetry: + enabled: true + otelCollectorEndpoint: http://34.150.160.154:4318 + +validator: + replicas: 1 + validatorKeys: + - 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 + validatorAddresses: + - 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + validator: + disabled: false + +bootNode: + validator: + disabled: true + +network: + public: true + +images: + aztec: + pullPolicy: Always From 550ce539f018e3de03c70db1d9c089e136f806f6 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 29 Nov 2024 23:34:24 +0000 Subject: [PATCH 17/31] one more try... --- spartan/aztec-network/files/config/setup-service-addresses.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 7fd9e5c9193..f0cbbd7ecaa 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -49,7 +49,7 @@ get_service_address() { # Get the node's external IP NODE_IP=$(kubectl get node ${NODE_NAME} -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}') echo "Node IP: ${NODE_IP}" >&2 - echo "http://${NODE_IP}:${PORT}" + echo "http://${NODE_IP}:8080" } # Configure Ethereum address From 6be01488be42616eac6b0db7ba4ad97fa2c0f77d Mon Sep 17 00:00:00 2001 From: ludamad Date: Sat, 30 Nov 2024 00:04:14 +0000 Subject: [PATCH 18/31] paranoia --- .../files/config/setup-service-addresses.sh | 2 +- spartan/aztec-network/values/release-devnet.yaml | 16 ++++++++++++++++ spartan/aztec-network/values/release.yaml | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index f0cbbd7ecaa..7fd9e5c9193 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -49,7 +49,7 @@ get_service_address() { # Get the node's external IP NODE_IP=$(kubectl get node ${NODE_NAME} -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}') echo "Node IP: ${NODE_IP}" >&2 - echo "http://${NODE_IP}:8080" + echo "http://${NODE_IP}:${PORT}" } # Configure Ethereum address diff --git a/spartan/aztec-network/values/release-devnet.yaml b/spartan/aztec-network/values/release-devnet.yaml index cf4f8d995a8..8967f030daf 100644 --- a/spartan/aztec-network/values/release-devnet.yaml +++ b/spartan/aztec-network/values/release-devnet.yaml @@ -27,3 +27,19 @@ network: images: aztec: pullPolicy: Always + +proverNode: + service: + portNode: 8080 + +proverAgent: + service: + portNode: 8080 + +pxe: + service: + portNode: 8080 + +bot: + service: + portNode: 8080 diff --git a/spartan/aztec-network/values/release.yaml b/spartan/aztec-network/values/release.yaml index 4de8686e226..e3e34dac3b8 100644 --- a/spartan/aztec-network/values/release.yaml +++ b/spartan/aztec-network/values/release.yaml @@ -6,8 +6,8 @@ images: pullPolicy: Always telemetry: - enabled: trueA - otelCollectorEndpoint: http://34.150.160.154:4318A + enabled: true + otelCollectorEndpoint: http://34.150.160.154:4318 validator: realProofs: true From 576ac0f0f97caa4f165f41dc0e8277fa31249be4 Mon Sep 17 00:00:00 2001 From: ludamad Date: Sat, 30 Nov 2024 01:21:59 +0000 Subject: [PATCH 19/31] try with service disabled? --- .../aztec-network/templates/prover-broker.yaml | 2 ++ .../aztec-network/values/release-devnet.yaml | 18 +----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index 87829de7ce3..c9b738be1bd 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -81,7 +81,9 @@ spec: value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} resources: {{- toYaml .Values.proverBroker.resources | nindent 12 }} +{{if not .Values.network.public }} --- +# Headless service for StatefulSet DNS entries apiVersion: v1 kind: Service metadata: diff --git a/spartan/aztec-network/values/release-devnet.yaml b/spartan/aztec-network/values/release-devnet.yaml index 8967f030daf..751d05f9055 100644 --- a/spartan/aztec-network/values/release-devnet.yaml +++ b/spartan/aztec-network/values/release-devnet.yaml @@ -26,20 +26,4 @@ network: images: aztec: - pullPolicy: Always - -proverNode: - service: - portNode: 8080 - -proverAgent: - service: - portNode: 8080 - -pxe: - service: - portNode: 8080 - -bot: - service: - portNode: 8080 + pullPolicy: Always \ No newline at end of file From 2367cbf135686035b2945a5f11e3478384f34346 Mon Sep 17 00:00:00 2001 From: ludamad Date: Sat, 30 Nov 2024 01:49:21 +0000 Subject: [PATCH 20/31] - --- spartan/aztec-network/templates/prover-broker.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index c9b738be1bd..02aff3104c3 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -81,6 +81,7 @@ spec: value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} resources: {{- toYaml .Values.proverBroker.resources | nindent 12 }} +{{- end }} {{if not .Values.network.public }} --- # Headless service for StatefulSet DNS entries From 398cceee73cf77f984fc9c0d73ead82294f39260 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 2 Dec 2024 15:51:23 +0000 Subject: [PATCH 21/31] fix broker being external --- spartan/aztec-network/files/config/setup-service-addresses.sh | 2 -- spartan/aztec-network/templates/prover-broker.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 7fd9e5c9193..3d2e3ce175b 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -81,8 +81,6 @@ fi if [ "${PROVER_BROKER_EXTERNAL_HOST}" != "" ]; then PROVER_BROKER_ADDR="${PROVER_BROKER_EXTERNAL_HOST}" -elif [ "${NETWORK_PUBLIC}" = "true" ]; then - PROVER_BROKER_ADDR=$(get_service_address "prover-broker" "${PROVER_BROKER_PORT}") else PROVER_BROKER_ADDR="http://${SERVICE_NAME}-prover-broker.${NAMESPACE}:${PROVER_BROKER_PORT}" fi diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index 02aff3104c3..bf30539e552 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -82,7 +82,6 @@ spec: resources: {{- toYaml .Values.proverBroker.resources | nindent 12 }} {{- end }} -{{if not .Values.network.public }} --- # Headless service for StatefulSet DNS entries apiVersion: v1 @@ -99,4 +98,3 @@ spec: ports: - port: {{ .Values.proverBroker.service.nodePort }} name: node -{{ end }} From d8044f4d105a14177c08a8b165200af1238b2e54 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 2 Dec 2024 16:47:23 +0000 Subject: [PATCH 22/31] dns policy --- spartan/aztec-network/files/config/setup-service-addresses.sh | 2 ++ spartan/aztec-network/templates/boot-node.yaml | 1 + spartan/aztec-network/templates/prover-agent.yaml | 1 + spartan/aztec-network/templates/prover-broker.yaml | 1 + spartan/aztec-network/templates/prover-node.yaml | 1 + spartan/aztec-network/templates/pxe.yaml | 3 ++- spartan/aztec-network/templates/validator.yaml | 1 + 7 files changed, 9 insertions(+), 1 deletion(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 3d2e3ce175b..7fd9e5c9193 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -81,6 +81,8 @@ fi if [ "${PROVER_BROKER_EXTERNAL_HOST}" != "" ]; then PROVER_BROKER_ADDR="${PROVER_BROKER_EXTERNAL_HOST}" +elif [ "${NETWORK_PUBLIC}" = "true" ]; then + PROVER_BROKER_ADDR=$(get_service_address "prover-broker" "${PROVER_BROKER_PORT}") else PROVER_BROKER_ADDR="http://${SERVICE_NAME}-prover-broker.${NAMESPACE}:${PROVER_BROKER_PORT}" fi diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index d2fdaf10578..f721b40c13a 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -17,6 +17,7 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: boot-node spec: + dnsPolicy: ClusterFirstWithHostNet {{- if .Values.network.public }} hostNetwork: true {{- include "aztec-network.publicAntiAffinity" . | nindent 6 }} diff --git a/spartan/aztec-network/templates/prover-agent.yaml b/spartan/aztec-network/templates/prover-agent.yaml index 23fd2d85a0d..d7dd451666b 100644 --- a/spartan/aztec-network/templates/prover-agent.yaml +++ b/spartan/aztec-network/templates/prover-agent.yaml @@ -17,6 +17,7 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: prover-agent spec: + dnsPolicy: ClusterFirstWithHostNet {{- if .Values.proverAgent.gke.spotEnabled }} affinity: nodeAffinity: diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index bf30539e552..bdbf885833d 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -17,6 +17,7 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: prover-broker spec: + dnsPolicy: ClusterFirstWithHostNet serviceAccountName: {{ include "aztec-network.fullname" . }}-node {{- if .Values.network.public }} hostNetwork: true diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index 4301f6187e8..258f45ea8ed 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -17,6 +17,7 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: prover-node spec: + dnsPolicy: ClusterFirstWithHostNet {{- if .Values.network.public }} hostNetwork: true {{- include "aztec-network.publicAntiAffinity" . | nindent 6 }} diff --git a/spartan/aztec-network/templates/pxe.yaml b/spartan/aztec-network/templates/pxe.yaml index e65aed1b21c..d2ea85a1846 100644 --- a/spartan/aztec-network/templates/pxe.yaml +++ b/spartan/aztec-network/templates/pxe.yaml @@ -16,6 +16,7 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: pxe spec: + dnsPolicy: ClusterFirstWithHostNet serviceAccountName: {{ include "aztec-network.fullname" . }}-node {{- if .Values.network.public }} hostNetwork: true @@ -138,7 +139,7 @@ metadata: annotations: service.beta.kubernetes.io/aws-load-balancer-type: "nlb" service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip" - service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing" + service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing": labels: {{- include "aztec-network.labels" . | nindent 4 }} spec: diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 319dd8bf015..7477dccf44d 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -18,6 +18,7 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: validator spec: + dnsPolicy: ClusterFirstWithHostNet {{- if .Values.network.public }} hostNetwork: true {{- include "aztec-network.publicAntiAffinity" . | nindent 6 }} From b88c328e461e5f9dbb57158d6df537d254d6230d Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 2 Dec 2024 16:57:45 +0000 Subject: [PATCH 23/31] fixes --- spartan/aztec-network/files/config/setup-service-addresses.sh | 2 -- spartan/aztec-network/templates/pxe.yaml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 7fd9e5c9193..3d2e3ce175b 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -81,8 +81,6 @@ fi if [ "${PROVER_BROKER_EXTERNAL_HOST}" != "" ]; then PROVER_BROKER_ADDR="${PROVER_BROKER_EXTERNAL_HOST}" -elif [ "${NETWORK_PUBLIC}" = "true" ]; then - PROVER_BROKER_ADDR=$(get_service_address "prover-broker" "${PROVER_BROKER_PORT}") else PROVER_BROKER_ADDR="http://${SERVICE_NAME}-prover-broker.${NAMESPACE}:${PROVER_BROKER_PORT}" fi diff --git a/spartan/aztec-network/templates/pxe.yaml b/spartan/aztec-network/templates/pxe.yaml index d2ea85a1846..1a7c2d42939 100644 --- a/spartan/aztec-network/templates/pxe.yaml +++ b/spartan/aztec-network/templates/pxe.yaml @@ -139,7 +139,7 @@ metadata: annotations: service.beta.kubernetes.io/aws-load-balancer-type: "nlb" service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip" - service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing": + service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing" labels: {{- include "aztec-network.labels" . | nindent 4 }} spec: From d1fb96ee0afde8200efc1bf54956b896509225a8 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 2 Dec 2024 17:09:45 +0000 Subject: [PATCH 24/31] helper --- spartan/scripts/get_service_address | 47 ++++++++++++++++++++++++++ spartan/scripts/post_deploy_spartan.sh | 9 ++--- 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100755 spartan/scripts/get_service_address diff --git a/spartan/scripts/get_service_address b/spartan/scripts/get_service_address new file mode 100755 index 00000000000..c7b2dc7872a --- /dev/null +++ b/spartan/scripts/get_service_address @@ -0,0 +1,47 @@ +set -eu +local SERVICE_LABEL=$1 +local PORT=$2 +local MAX_RETRIES=30 +local RETRY_INTERVAL=2 +local attempt=1 + +# Get pod name +while [ $attempt -le $MAX_RETRIES ]; do + POD_NAME=$(kubectl get pods -n ${NAMESPACE} -l app=${SERVICE_LABEL} -o jsonpath='{.items[0].metadata.name}') + if [ -n "$POD_NAME" ]; then + break + fi + echo "Attempt $attempt: Waiting for ${SERVICE_LABEL} pod to be available..." >&2 + sleep $RETRY_INTERVAL + attempt=$((attempt + 1)) +done + +if [ -z "$POD_NAME" ]; then + echo "Error: Failed to get ${SERVICE_LABEL} pod name after $MAX_RETRIES attempts" >&2 + return 1 +fi +echo "Pod name: [${POD_NAME}]" >&2 + +# Get node name +attempt=1 +NODE_NAME="" +while [ $attempt -le $MAX_RETRIES ]; do + NODE_NAME=$(kubectl get pod ${POD_NAME} -n ${NAMESPACE} -o jsonpath='{.spec.nodeName}') + if [ -n "$NODE_NAME" ]; then + break + fi + echo "Attempt $attempt: Waiting for node name to be available..." >&2 + sleep $RETRY_INTERVAL + attempt=$((attempt + 1)) +done + +if [ -z "$NODE_NAME" ]; then + echo "Error: Failed to get node name after $MAX_RETRIES attempts" >&2 + return 1 +fi +echo "Node name: ${NODE_NAME}" >&2 + +# Get the node's external IP +NODE_IP=$(kubectl get node ${NODE_NAME} -o jsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}') +echo "Node IP: ${NODE_IP}" >&2 +echo "http://${NODE_IP}:${PORT}" \ No newline at end of file diff --git a/spartan/scripts/post_deploy_spartan.sh b/spartan/scripts/post_deploy_spartan.sh index bcf66bff49b..917605677f0 100755 --- a/spartan/scripts/post_deploy_spartan.sh +++ b/spartan/scripts/post_deploy_spartan.sh @@ -5,7 +5,7 @@ set -o pipefail echo "Bootstrapping network with test contracts" -NAMESPACE=${1:-spartan} +export NAMESPACE=${1:-spartan} TAG=${2:-latest} SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -22,10 +22,11 @@ function get_load_balancer_url() { kubectl get svc -n $namespace -o jsonpath="{.items[?(@.metadata.name=='$service_name')].status.loadBalancer.ingress[0].hostname}" } + # Fetch the service URLs based on the namespace for injection in the test-transfer.sh -export BOOTNODE_URL=http://$(get_load_balancer_url $NAMESPACE "$NAMESPACE-aztec-network-boot-node-lb-tcp"):8080 -export PXE_URL=http://$(get_load_balancer_url $NAMESPACE "$NAMESPACE-aztec-network-pxe-lb"):8080 -export ETHEREUM_HOST=http://$(get_load_balancer_url $NAMESPACE "$NAMESPACE-aztec-network-ethereum-lb"):8545 +export BOOTNODE_URL=http://$($(dirname $0)/get_service_address boot-node 8080) +export PXE_URL=http://$($(dirname $0)/get_service_address pxe 8080) +export ETHEREUM_HOST=http://$($(dirname $0)/get_service_address ethereum 8545) echo "BOOTNODE_URL: $BOOTNODE_URL" echo "PXE_URL: $PXE_URL" From 1ec367923a34c460f9bf349f9dd6810dd8ab0772 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 2 Dec 2024 17:58:48 +0000 Subject: [PATCH 25/31] detect telemetry and dont set endpoint --- .../files/config/setup-service-addresses.sh | 2 +- spartan/aztec-network/templates/_helpers.tpl | 2 ++ spartan/scripts/get_service_address | 10 +++++----- spartan/scripts/post_deploy_spartan.sh | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 3d2e3ce175b..2eed798016d 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -86,7 +86,7 @@ else fi # Configure OTEL_COLLECTOR_ENDPOINT if not set in values file -if [ "${OTEL_COLLECTOR_ENDPOINT}" = "" ]; then +if [ "${TELEMETRY:-false}" = "true" ] && [ "${OTEL_COLLECTOR_ENDPOINT}" = "" ]; then OTEL_COLLECTOR_PORT=${OTEL_COLLECTOR_PORT:-4318} OTEL_COLLECTOR_ENDPOINT="http://metrics-opentelemetry-collector.metrics:$OTEL_COLLECTOR_PORT" fi diff --git a/spartan/aztec-network/templates/_helpers.tpl b/spartan/aztec-network/templates/_helpers.tpl index 26bcf088c70..8581bda2d4f 100644 --- a/spartan/aztec-network/templates/_helpers.tpl +++ b/spartan/aztec-network/templates/_helpers.tpl @@ -129,6 +129,8 @@ Service Address Setup Container value: "{{ .Values.network.public }}" - name: NAMESPACE value: {{ .Release.Namespace }} + - name: TELEMETRY + value: "{{ .Values.telemetry.enabled }}" - name: OTEL_COLLECTOR_ENDPOINT value: "{{ .Values.telemetry.otelCollectorEndpoint }}" - name: EXTERNAL_ETHEREUM_HOST diff --git a/spartan/scripts/get_service_address b/spartan/scripts/get_service_address index c7b2dc7872a..3f3634faaef 100755 --- a/spartan/scripts/get_service_address +++ b/spartan/scripts/get_service_address @@ -1,9 +1,9 @@ set -eu -local SERVICE_LABEL=$1 -local PORT=$2 -local MAX_RETRIES=30 -local RETRY_INTERVAL=2 -local attempt=1 +SERVICE_LABEL=$1 +PORT=$2 +MAX_RETRIES=30 +RETRY_INTERVAL=2 +attempt=1 # Get pod name while [ $attempt -le $MAX_RETRIES ]; do diff --git a/spartan/scripts/post_deploy_spartan.sh b/spartan/scripts/post_deploy_spartan.sh index 917605677f0..88719ef7306 100755 --- a/spartan/scripts/post_deploy_spartan.sh +++ b/spartan/scripts/post_deploy_spartan.sh @@ -24,9 +24,9 @@ function get_load_balancer_url() { # Fetch the service URLs based on the namespace for injection in the test-transfer.sh -export BOOTNODE_URL=http://$($(dirname $0)/get_service_address boot-node 8080) -export PXE_URL=http://$($(dirname $0)/get_service_address pxe 8080) -export ETHEREUM_HOST=http://$($(dirname $0)/get_service_address ethereum 8545) +export BOOTNODE_URL=$($(dirname $0)/get_service_address boot-node 8080) +export PXE_URL=$($(dirname $0)/get_service_address pxe 8080) +export ETHEREUM_HOST=$($(dirname $0)/get_service_address ethereum 8545) echo "BOOTNODE_URL: $BOOTNODE_URL" echo "PXE_URL: $PXE_URL" From f0b774bce8243b7e7bacc257d6215fa8a4ee582c Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 2 Dec 2024 18:01:41 +0000 Subject: [PATCH 26/31] devnet fix --- spartan/scripts/post_deploy_spartan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spartan/scripts/post_deploy_spartan.sh b/spartan/scripts/post_deploy_spartan.sh index 88719ef7306..e268174f49c 100755 --- a/spartan/scripts/post_deploy_spartan.sh +++ b/spartan/scripts/post_deploy_spartan.sh @@ -37,6 +37,6 @@ echo "Bootstrapping contracts for test network. NOTE: This took one hour last ru docker run aztecprotocol/aztec:$TAG bootstrap-network \ --rpc-url $BOOTNODE_URL \ --l1-rpc-url $ETHEREUM_HOST \ - --l1-chain-id 31337 \ + --l1-chain-id 1337 \ --l1-private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ --json | tee ./basic_contracts.json From 2d4dcd4adc25f45bfc7aaab10d77dc4d6582636a Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 2 Dec 2024 19:16:13 +0000 Subject: [PATCH 27/31] bot settings --- spartan/aztec-network/values/release-devnet.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spartan/aztec-network/values/release-devnet.yaml b/spartan/aztec-network/values/release-devnet.yaml index 751d05f9055..4717ed0cdc9 100644 --- a/spartan/aztec-network/values/release-devnet.yaml +++ b/spartan/aztec-network/values/release-devnet.yaml @@ -21,6 +21,11 @@ bootNode: validator: disabled: true +bot: + followChain: "PENDING" + enabled: true + txIntervalSeconds: 200 + network: public: true From 0614f4a16407762fc48d3a1c9fc8d101c505cd0d Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Thu, 5 Dec 2024 12:04:49 +0000 Subject: [PATCH 28/31] chore: devnet extras (#10414) Please read [contributing guidelines](CONTRIBUTING.md) and remove this line. --- .../templates/setup-l2-contracts.yaml | 2 ++ .../aztec-network/values/release-devnet.yaml | 19 ++++++++++++++++++- spartan/scripts/deploy_spartan.sh | 6 ++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/spartan/aztec-network/templates/setup-l2-contracts.yaml b/spartan/aztec-network/templates/setup-l2-contracts.yaml index 594bc1480e5..a1840a1be43 100644 --- a/spartan/aztec-network/templates/setup-l2-contracts.yaml +++ b/spartan/aztec-network/templates/setup-l2-contracts.yaml @@ -62,6 +62,8 @@ spec: node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js setup-protocol-contracts --skipProofWait --l1-chain-id {{ .Values.ethereum.chainId }} echo "L2 contracts initialized" env: + - name: TELEMETRY + value: "{{ .Values.telemetry.enabled }}" - name: DEBUG value: "aztec:*" - name: LOG_LEVEL diff --git a/spartan/aztec-network/values/release-devnet.yaml b/spartan/aztec-network/values/release-devnet.yaml index 4717ed0cdc9..2fb6d1d1e4f 100644 --- a/spartan/aztec-network/values/release-devnet.yaml +++ b/spartan/aztec-network/values/release-devnet.yaml @@ -21,6 +21,14 @@ bootNode: validator: disabled: true +# use small provers to produce fake proofs +proverAgent: + replicas: 1 + resources: + requests: + memory: "4Gi" + cpu: "1" + bot: followChain: "PENDING" enabled: true @@ -31,4 +39,13 @@ network: images: aztec: - pullPolicy: Always \ No newline at end of file + pullPolicy: Always + +aztec: + slotDuration: 36 + epochDuration: 32 + realProofs: false # devnet does not use real proofs + +jobs: + deployL1Verifier: + enable: false diff --git a/spartan/scripts/deploy_spartan.sh b/spartan/scripts/deploy_spartan.sh index 1b646ea1745..16bb8c76628 100755 --- a/spartan/scripts/deploy_spartan.sh +++ b/spartan/scripts/deploy_spartan.sh @@ -69,14 +69,12 @@ function upgrade() { if ! upgrade | tee "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then if grep 'cannot patch "'$NAMESPACE'-aztec-network-setup-l2-contracts"' "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then kubectl delete job $NAMESPACE-aztec-network-setup-l2-contracts -n $NAMESPACE - upgrade fi -fi -if ! upgrade | tee "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then if grep 'cannot patch "'$NAMESPACE'-aztec-network-deploy-l1-verifier"' "$SCRIPT_DIR/logs/$NAMESPACE-helm.log" ; then kubectl delete job $NAMESPACE-aztec-network-deploy-l1-verifier -n $NAMESPACE - upgrade fi + + upgrade fi From e3ddd72a0fee3dd6eefb65391c8ec65aa95c9351 Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Thu, 5 Dec 2024 17:25:10 +0000 Subject: [PATCH 29/31] Fixes --- spartan/aztec-network/templates/boot-node.yaml | 2 ++ spartan/aztec-network/templates/prover-agent.yaml | 2 +- spartan/aztec-network/templates/prover-broker.yaml | 2 +- spartan/aztec-network/templates/prover-node.yaml | 2 +- spartan/aztec-network/templates/pxe.yaml | 2 +- spartan/aztec-network/templates/setup-l2-contracts.yaml | 2 +- spartan/aztec-network/templates/validator.yaml | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 73b87685d0e..30193be7bc8 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -72,6 +72,8 @@ spec: - name: scripts mountPath: /scripts env: + - name: TELEMETRY + value: "{{ .Values.telemetry.enabled }}" - name: INIT_VALIDATORS value: "true" - name: ETHEREUM_SLOT_DURATION diff --git a/spartan/aztec-network/templates/prover-agent.yaml b/spartan/aztec-network/templates/prover-agent.yaml index 334f4a667b9..d5ff38c7905 100644 --- a/spartan/aztec-network/templates/prover-agent.yaml +++ b/spartan/aztec-network/templates/prover-agent.yaml @@ -17,7 +17,6 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: prover-agent spec: - dnsPolicy: ClusterFirstWithHostNet {{- if .Values.proverAgent.gke.spotEnabled }} affinity: nodeAffinity: @@ -35,6 +34,7 @@ spec: serviceAccountName: {{ include "aztec-network.fullname" . }}-node {{- if .Values.network.public }} hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet {{- end }} volumes: - name: config diff --git a/spartan/aztec-network/templates/prover-broker.yaml b/spartan/aztec-network/templates/prover-broker.yaml index bdbf885833d..01c2da49e21 100644 --- a/spartan/aztec-network/templates/prover-broker.yaml +++ b/spartan/aztec-network/templates/prover-broker.yaml @@ -17,10 +17,10 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: prover-broker spec: - dnsPolicy: ClusterFirstWithHostNet serviceAccountName: {{ include "aztec-network.fullname" . }}-node {{- if .Values.network.public }} hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet {{- end }} volumes: - name: config diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index 7ea7d7f2499..44984a2fb2a 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -17,9 +17,9 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: prover-node spec: - dnsPolicy: ClusterFirstWithHostNet {{- if .Values.network.public }} hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet {{- include "aztec-network.publicAntiAffinity" . | nindent 6 }} {{- end }} serviceAccountName: {{ include "aztec-network.fullname" . }}-node diff --git a/spartan/aztec-network/templates/pxe.yaml b/spartan/aztec-network/templates/pxe.yaml index 37f9a5b28d0..44f41bb1613 100644 --- a/spartan/aztec-network/templates/pxe.yaml +++ b/spartan/aztec-network/templates/pxe.yaml @@ -16,10 +16,10 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: pxe spec: - dnsPolicy: ClusterFirstWithHostNet serviceAccountName: {{ include "aztec-network.fullname" . }}-node {{- if .Values.network.public }} hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet {{- end }} volumes: - name: config diff --git a/spartan/aztec-network/templates/setup-l2-contracts.yaml b/spartan/aztec-network/templates/setup-l2-contracts.yaml index a1840a1be43..bdd30b8d5cd 100644 --- a/spartan/aztec-network/templates/setup-l2-contracts.yaml +++ b/spartan/aztec-network/templates/setup-l2-contracts.yaml @@ -54,7 +54,7 @@ spec: until curl -s -X POST -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","method":"pxe_getNodeInfo","params":[],"id":67}' \ $PXE_URL | grep -q '"enr:-'; do - echo "Waiting for PXE service..." + echo "Waiting for PXE service at ${PXE_URL}..." sleep 5 done echo "PXE service is ready!" diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index 7477dccf44d..1faa6823076 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -18,9 +18,9 @@ spec: {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: validator spec: - dnsPolicy: ClusterFirstWithHostNet {{- if .Values.network.public }} hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet {{- include "aztec-network.publicAntiAffinity" . | nindent 6 }} {{- end }} serviceAccountName: {{ include "aztec-network.fullname" . }}-node From e2d6be4c4eaef55c8c71ea17cfec6ffa85058be8 Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Thu, 5 Dec 2024 17:32:44 +0000 Subject: [PATCH 30/31] Remove collector endpoint config --- spartan/aztec-network/values/release-devnet.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/spartan/aztec-network/values/release-devnet.yaml b/spartan/aztec-network/values/release-devnet.yaml index 2fb6d1d1e4f..485e6462aeb 100644 --- a/spartan/aztec-network/values/release-devnet.yaml +++ b/spartan/aztec-network/values/release-devnet.yaml @@ -6,7 +6,6 @@ # (then `./forward.sh` if you want to see it) telemetry: enabled: true - otelCollectorEndpoint: http://34.150.160.154:4318 validator: replicas: 1 From 8a8d60004eb783d0152b62d1fa090fcdd4bd2482 Mon Sep 17 00:00:00 2001 From: PhilWindle Date: Thu, 5 Dec 2024 20:10:12 +0000 Subject: [PATCH 31/31] Fix --- .../files/config/setup-service-addresses.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 2eed798016d..063c84a16e5 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -96,10 +96,14 @@ echo "export ETHEREUM_HOST=${ETHEREUM_ADDR}" >> /shared/config/service-addresses echo "export BOOT_NODE_HOST=${BOOT_NODE_ADDR}" >> /shared/config/service-addresses echo "export PROVER_NODE_HOST=${PROVER_NODE_ADDR}" >> /shared/config/service-addresses echo "export PROVER_BROKER_HOST=${PROVER_BROKER_ADDR}" >> /shared/config/service-addresses -echo "export OTEL_COLLECTOR_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT" >> /shared/config/service-addresses -echo "export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/logs" >> /shared/config/service-addresses -echo "export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/metrics" >> /shared/config/service-addresses -echo "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/traces" >> /shared/config/service-addresses + +if [ "${OTEL_COLLECTOR_ENDPOINT}" != "" ]; then + echo "export OTEL_COLLECTOR_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT" >> /shared/config/service-addresses + echo "export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/logs" >> /shared/config/service-addresses + echo "export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/metrics" >> /shared/config/service-addresses + echo "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/traces" >> /shared/config/service-addresses +fi + echo "Addresses configured:" cat /shared/config/service-addresses