Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions spartan/aztec-network/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,37 @@ Sets up the OpenTelemetry resource attributes for a service
mountPath: /shared/config
{{- end -}}

{{/*
Otel Env vars
*/}}
{{- define "aztec-network.otelEnvVars" -}}
{{- $serviceName := base $.Template.Name | trimSuffix ".yaml" -}}
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: OTEL_SERVICE_NAME
value: "{{ $serviceName }}"
- name: OTEL_RESOURCE_ATTRIBUTES
value: 'service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }}'
- name: USE_GCLOUD_LOGGING
value: "{{ .Values.telemetry.useGcloudLogging }}"
- name: OTEL_EXCLUDE_METRICS
value: "{{ .Values.telemetry.excludeMetrics }}"
{{- end -}}

{{/**
Anti-affinity when running in public network mode
*/}}
Expand Down
25 changes: 4 additions & 21 deletions spartan/aztec-network/templates/boot-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ spec:
- /bin/bash
- -c
- |
source /scripts/setup-otel-resource.sh && \
source /shared/contracts/contracts.env && \
source /shared/config/p2p-addresses && \
source /shared/config/service-addresses && \
source /shared/config/otel-resource && \
env && \
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --node --archiver --sequencer --pxe
startupProbe:
Expand All @@ -156,27 +156,14 @@ spec:
volumeMounts:
- name: config
mountPath: /shared/config
- name: scripts
mountPath: /scripts
- name: boot-node-data
mountPath: {{ .Values.bootNode.dataDir }}
- name: scripts-output
mountPath: /shared/contracts
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "aztec-network.otelEnvVars" . | nindent 12 }}
- name: NODE_OPTIONS
value: "--max-old-space-size={{ .Values.bootNode.maxOldSpaceSize}}"
- name: AZTEC_PORT
Expand Down Expand Up @@ -223,10 +210,6 @@ spec:
value: "{{ .Values.storage.dataStoreMapSize }}"
- name: WS_DB_MAP_SIZE_KB
value: "{{ .Values.storage.worldStateMapSize }}"
- name: USE_GCLOUD_LOGGING
value: "{{ .Values.telemetry.useGcloudLogging }}"
- name: OTEL_EXCLUDE_METRICS
value: "{{ .Values.telemetry.excludeMetrics }}"
- name: TEST_ACCOUNTS
value: "{{ .Values.aztec.testAccounts }}"
{{- if .Values.blobSink.enabled }}
Expand Down
28 changes: 4 additions & 24 deletions spartan/aztec-network/templates/full-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ spec:
- /bin/bash
- -c
- |
source /scripts/setup-otel-resource.sh
source /shared/contracts/contracts.env
source /shared/config/p2p-addresses
source /shared/config/service-addresses
Expand All @@ -72,6 +73,8 @@ spec:
timeoutSeconds: 30
failureThreshold: 3
volumeMounts:
- name: scripts
mountPath: /scripts
- name: config
mountPath: /shared/config
- name: full-node-data
Expand All @@ -80,24 +83,7 @@ spec:
mountPath: /shared/contracts/contracts.env
subPath: contracts.env
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OTEL_SERVICE_NAME
value: full-node
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "aztec-network.otelEnvVars" . | nindent 12 }}
- name: NODE_OPTIONS
value: "--max-old-space-size={{ .Values.fullNode.maxOldSpaceSize}}"
- name: AZTEC_PORT
Expand All @@ -116,8 +102,6 @@ spec:
value: "true"
- name: L1_CHAIN_ID
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: PROVER_REAL_PROOFS
value: "{{ .Values.aztec.realProofs }}"
- name: PXE_PROVER_ENABLED
Expand Down Expand Up @@ -146,10 +130,6 @@ spec:
value: "{{ .Values.storage.dataStoreMapSize }}"
- name: WS_DB_MAP_SIZE_KB
value: "{{ .Values.storage.worldStateMapSize }}"
- name: USE_GCLOUD_LOGGING
value: "{{ .Values.telemetry.useGcloudLogging }}"
- name: OTEL_EXCLUDE_METRICS
value: "{{ .Values.telemetry.excludeMetrics }}"
- name: P2P_BOOTSTRAP_NODES_AS_FULL_PEERS
value: "{{ .Values.network.p2pBootstrapNodesAsFullPeers }}"
- name: TEST_ACCOUNTS
Expand Down
22 changes: 4 additions & 18 deletions spartan/aztec-network/templates/prover-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ spec:
defaultMode: 0755
initContainers:
{{- include "aztec-network.combinedAllSetupContainer" . | nindent 8 }}
{{- include "aztec-network.otelResourceSetupContainer" . | nindent 8 }}
- name: wait-for-prover-node
{{- include "aztec-network.image" . | nindent 10 }}
command:
Expand All @@ -69,26 +68,17 @@ spec:
volumeMounts:
- name: config
mountPath: /shared/config
- name: scripts
mountPath: /scripts
command:
- "/bin/bash"
- "-c"
- |
source /scripts/setup-otel-resource.sh && \
source /shared/config/service-addresses && \
source /shared/config/otel-resource && \
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --prover-agent
env:
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "aztec-network.otelEnvVars" . | nindent 12 }}
- name: AZTEC_PORT
value: "{{ .Values.proverAgent.service.nodePort }}"
- name: LOG_LEVEL
Expand All @@ -109,10 +99,6 @@ spec:
value: "{{ .Values.proverAgent.testDelayFactor }}"
- name: PROVER_AGENT_PROOF_TYPES
value: {{ join "," .Values.proverAgent.proofTypes | quote }}
- name: USE_GCLOUD_LOGGING
value: "{{ .Values.telemetry.useGcloudLogging }}"
- name: OTEL_EXCLUDE_METRICS
value: "{{ .Values.telemetry.excludeMetrics }}"
resources:
{{- toYaml .Values.proverAgent.resources | nindent 12 }}
{{- end }}
21 changes: 4 additions & 17 deletions spartan/aztec-network/templates/prover-broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,18 @@ spec:
mountPath: /shared/contracts
- name: prover-broker-data
mountPath: {{ .Values.proverBroker.dataDir }}
- name: scripts
mountPath: /scripts
command:
- "/bin/bash"
- "-c"
- |
source /scripts/setup-otel-resource.sh && \
source /shared/config/service-addresses && \
source /shared/contracts/contracts.env && \
source /shared/config/otel-resource && \
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --prover-broker
env:
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "aztec-network.otelEnvVars" . | nindent 12 }}
- name: NODE_OPTIONS
value: "--max-old-space-size={{ .Values.proverBroker.maxOldSpaceSize}}"
- name: L1_CHAIN_ID
Expand All @@ -153,10 +144,6 @@ spec:
value: "{{ .Values.proverBroker.dataDir }}"
- name: DATA_STORE_MAP_SIZE_KB
value: "{{ .Values.storage.dataStoreMapSize }}"
- name: USE_GCLOUD_LOGGING
value: "{{ .Values.telemetry.useGcloudLogging }}"
- name: OTEL_EXCLUDE_METRICS
value: "{{ .Values.telemetry.excludeMetrics }}"
resources:
{{- toYaml .Values.proverBroker.resources | nindent 12 }}
volumes:
Expand Down
25 changes: 4 additions & 21 deletions spartan/aztec-network/templates/prover-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,37 +135,24 @@ spec:
- /bin/bash
- -c
- |
source /scripts/setup-otel-resource.sh && \
source /shared/config/keys.env && \
source /shared/contracts/contracts.env && \
source /shared/config/p2p-addresses && \
source /shared/config/service-addresses && \
source /shared/config/otel-resource && \
env && \
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --prover-node --archiver
volumeMounts:
- name: scripts
mountPath: /scripts
- name: contracts-env
mountPath: /shared/contracts
- name: config
mountPath: /shared/config
- name: prover-node-data
mountPath: {{ .Values.proverNode.dataDir }}
env:
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- include "aztec-network.otelEnvVars" . | nindent 12 }}
- name: NODE_OPTIONS
value: "--max-old-space-size={{ .Values.proverNode.maxOldSpaceSize}}"
- name: AZTEC_PORT
Expand Down Expand Up @@ -230,10 +217,6 @@ spec:
value: "{{ .Values.storage.dataStoreMapSize }}"
- name: WS_DB_MAP_SIZE_KB
value: "{{ .Values.storage.worldStateMapSize }}"
- name: USE_GCLOUD_LOGGING
value: "{{ .Values.telemetry.useGcloudLogging }}"
- name: OTEL_EXCLUDE_METRICS
value: "{{ .Values.telemetry.excludeMetrics }}"
- name: TEST_ACCOUNTS
value: "{{ .Values.aztec.testAccounts }}"
{{- if .Values.blobSink.enabled }}
Expand Down
17 changes: 4 additions & 13 deletions spartan/aztec-network/templates/transaction-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ spec:
- "/bin/bash"
- "-c"
- |
source /scripts/setup-otel-resource.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW this is sourcing the script file, not the generated config


source /shared/config/service-addresses
cat /shared/config/service-addresses

source /shared/config/keys.env
source /shared/config/otel-resource
{{- if .Values.bot.nodeUrl }}
export AZTEC_NODE_URL={{ .Values.bot.nodeUrl }}
{{- else if .Values.network.public }}
Expand All @@ -121,18 +123,7 @@ spec:
echo "AZTEC_NODE_URL=${AZTEC_NODE_URL}"
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --pxe --bot
env:
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "aztec-network.otelEnvVars" . | nindent 12 }}
- name: AZTEC_PORT
value: "{{ .Values.bot.service.nodePort }}"
- name: LOG_JSON
Expand Down
25 changes: 4 additions & 21 deletions spartan/aztec-network/templates/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ spec:
- "/bin/bash"
- "-c"
- |
source /scripts/setup-otel-resource.sh && \
source /shared/contracts/contracts.env && \
source /shared/config/p2p-addresses && \
source /shared/config/service-addresses && \
source /shared/config/keys.env && \
source /shared/config/otel-resource && \
env && \
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --node --archiver --sequencer
startupProbe:
Expand All @@ -102,29 +102,16 @@ spec:
timeoutSeconds: 30
failureThreshold: 3
volumeMounts:
- name: scripts
mountPath: /scripts
- name: contracts-env
mountPath: /shared/contracts
- name: config
mountPath: /shared/config
- name: validator-data
mountPath: {{ .Values.validator.dataDir }}
env:
- name: K8S_POD_UID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: K8S_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "aztec-network.otelEnvVars" . | nindent 12 }}
- name: NODE_OPTIONS
value: "--max-old-space-size={{ .Values.validator.maxOldSpaceSize}}"
- name: AZTEC_PORT
Expand Down Expand Up @@ -181,10 +168,6 @@ spec:
value: "{{ .Values.storage.dataStoreMapSize }}"
- name: WS_DB_MAP_SIZE_KB
value: "{{ .Values.storage.worldStateMapSize }}"
- name: USE_GCLOUD_LOGGING
value: "{{ .Values.telemetry.useGcloudLogging }}"
- name: OTEL_EXCLUDE_METRICS
value: "{{ .Values.telemetry.excludeMetrics }}"
- name: TEST_ACCOUNTS
value: "{{ .Values.aztec.testAccounts }}"
- name: P2P_BOOTSTRAP_NODES_AS_FULL_PEERS
Expand Down
Loading