From c2c1744cb40f91773988476b23e61eb00babdc84 Mon Sep 17 00:00:00 2001 From: just-mitch <68168980+just-mitch@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:52:52 -0500 Subject: [PATCH] chore: centralized helm flag for proving and clean release tf deploys (#10221) Make a single flag `aztec.realProofs` in our aztec-network chart for enabling real proofs. (fix #10157) Improve usability of deploy script for network releases. (fix #10158) --- .../aztec-network/templates/boot-node.yaml | 4 ++-- .../aztec-network/templates/prover-agent.yaml | 2 +- .../aztec-network/templates/prover-node.yaml | 2 +- spartan/aztec-network/templates/pxe.yaml | 2 +- .../templates/transaction-bot.yaml | 4 ++-- spartan/aztec-network/values.yaml | 8 +------- .../1-validator-with-proving-and-metrics.yaml | 17 +++++------------ .../values/1-validator-with-proving.yaml | 17 +++++------------ .../values/gcp-proving-test.yaml | 9 +-------- .../aztec-network/values/multicloud-demo.yaml | 4 ---- .../values/prover-node-with-agents.yaml | 6 ------ spartan/aztec-network/values/release.yaml | 19 +++++-------------- spartan/terraform/deploy-release/deploy.sh | 11 +++++++++-- spartan/terraform/deploy-release/main.tf | 12 ++++++------ .../terraform/deploy-release/release.tfvars | 5 +---- spartan/terraform/deploy-release/variables.tf | 8 ++++---- 16 files changed, 44 insertions(+), 86 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 00e585513a6..022d344ebe4 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -157,9 +157,9 @@ spec: - name: OTEL_EXPORTER_OTLP_LOGS_ENDPOINT value: {{ include "aztec-network.otelCollectorLogsEndpoint" . | quote }} - name: PROVER_REAL_PROOFS - value: "{{ .Values.bootNode.realProofs }}" + value: "{{ .Values.aztec.realProofs }}" - name: PXE_PROVER_ENABLED - value: "{{ .Values.bootNode.realProofs }}" + value: "{{ .Values.aztec.realProofs }}" - name: ETHEREUM_SLOT_DURATION value: "{{ .Values.ethereum.blockTime }}" - name: AZTEC_SLOT_DURATION diff --git a/spartan/aztec-network/templates/prover-agent.yaml b/spartan/aztec-network/templates/prover-agent.yaml index ef080501868..a4517c7a503 100644 --- a/spartan/aztec-network/templates/prover-agent.yaml +++ b/spartan/aztec-network/templates/prover-agent.yaml @@ -88,7 +88,7 @@ spec: - name: DEBUG value: "{{ .Values.proverAgent.debug }}" - name: PROVER_REAL_PROOFS - value: "{{ .Values.proverAgent.realProofs }}" + value: "{{ .Values.aztec.realProofs }}" - name: PROVER_AGENT_COUNT value: "1" - name: PROVER_AGENT_POLL_INTERVAL_MS diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index bf13dad1821..bfe9447570c 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -121,7 +121,7 @@ spec: - name: DEBUG value: "{{ .Values.proverNode.debug }}" - name: PROVER_REAL_PROOFS - value: "{{ .Values.proverNode.realProofs }}" + value: "{{ .Values.aztec.realProofs }}" - name: PROVER_AGENT_COUNT value: "{{ .Values.proverNode.proverAgent.count }}" - name: PROVER_AGENT_POLL_INTERVAL_MS diff --git a/spartan/aztec-network/templates/pxe.yaml b/spartan/aztec-network/templates/pxe.yaml index 94a8a87886c..bb15f206c2d 100644 --- a/spartan/aztec-network/templates/pxe.yaml +++ b/spartan/aztec-network/templates/pxe.yaml @@ -87,7 +87,7 @@ spec: - name: DEBUG value: "{{ .Values.pxe.debug }}" - name: PXE_PROVER_ENABLED - value: "{{ .Values.pxe.proverEnabled }}" + value: "{{ .Values.aztec.realProofs }}" ports: - name: http containerPort: {{ .Values.pxe.service.nodePort }} diff --git a/spartan/aztec-network/templates/transaction-bot.yaml b/spartan/aztec-network/templates/transaction-bot.yaml index cd5b88a13bd..762c6bd7c07 100644 --- a/spartan/aztec-network/templates/transaction-bot.yaml +++ b/spartan/aztec-network/templates/transaction-bot.yaml @@ -94,9 +94,9 @@ spec: - name: BOT_NO_START value: "{{ .Values.bot.botNoStart }}" - name: PXE_PROVER_ENABLED - value: "{{ .Values.bot.pxeProverEnabled }}" + value: "{{ .Values.aztec.realProofs }}" - name: PROVER_REAL_PROOFS - value: "{{ .Values.bot.proverRealProofs }}" + value: "{{ .Values.aztec.realProofs }}" - name: BOT_MAX_CONSECUTIVE_ERRORS value: "{{ .Values.bot.maxErrors }}" - name: BOT_STOP_WHEN_UNHEALTHY diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index 005d3061137..fbc957e802f 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -33,6 +33,7 @@ aztec: slotDuration: 24 # in seconds, aka L2 slot duration. Must be a multiple of {{ ethereum.blockTime }} epochDuration: 16 # how many L2 slots in an epoch epochProofClaimWindow: 13 # in L2 slots + realProofs: false bootNode: peerIdPrivateKey: "" @@ -48,7 +49,6 @@ bootNode: sequencer: maxSecondsBetweenBlocks: 0 minTxsPerBlock: 1 - realProofs: false validator: disabled: true p2p: @@ -118,7 +118,6 @@ proverNode: nodePort: 8080 logLevel: "debug" debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*" - realProofs: false proverAgent: count: 0 pollIntervalMs: 1000 @@ -136,9 +135,7 @@ proverNode: storage: "8Gi" pxe: - proverEnabled: false logLevel: "debug" - proverEnable: false debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*" replicas: 1 service: @@ -167,8 +164,6 @@ bot: # Do not wait for transactions followChain: "NONE" botNoStart: false - pxeProverEnabled: false - proverRealProofs: false maxErrors: 3 stopIfUnhealthy: true service: @@ -222,7 +217,6 @@ proverAgent: spotEnabled: false logLevel: "debug" debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*" - realProofs: false bb: hardwareConcurrency: "" nodeSelector: {} 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..95b7f0ac638 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 @@ -1,3 +1,8 @@ +aztec: + realProofs: true + slotDuration: 36 + epochDuration: 32 + validator: replicas: 1 validatorKeys: @@ -11,12 +16,8 @@ bootNode: validator: disabled: true -proverNode: - realProofs: true - proverAgent: replicas: 6 - realProofs: true bb: hardwareConcurrency: 16 resources: @@ -27,22 +28,14 @@ proverAgent: memory: "96Gi" cpu: "16" -pxe: - proverEnabled: true - bot: enabled: true - pxeProverEnabled: true txIntervalSeconds: 200 jobs: deployL1Verifier: enable: true -aztec: - slotDuration: 36 - epochDuration: 32 - telemetry: enabled: true otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 diff --git a/spartan/aztec-network/values/1-validator-with-proving.yaml b/spartan/aztec-network/values/1-validator-with-proving.yaml index 07f064561f5..caa0d4e5a15 100644 --- a/spartan/aztec-network/values/1-validator-with-proving.yaml +++ b/spartan/aztec-network/values/1-validator-with-proving.yaml @@ -1,3 +1,8 @@ +aztec: + realProofs: true + slotDuration: 36 + epochDuration: 32 + validator: replicas: 1 validatorKeys: @@ -11,12 +16,8 @@ bootNode: validator: disabled: true -proverNode: - realProofs: true - proverAgent: replicas: 6 - realProofs: true bb: hardwareConcurrency: 16 resources: @@ -27,18 +28,10 @@ proverAgent: memory: "96Gi" cpu: "16" -pxe: - proverEnabled: true - bot: enabled: true - pxeProverEnabled: true txIntervalSeconds: 200 jobs: deployL1Verifier: enable: true - -aztec: - slotDuration: 36 - epochDuration: 32 diff --git a/spartan/aztec-network/values/gcp-proving-test.yaml b/spartan/aztec-network/values/gcp-proving-test.yaml index 6a361ecd025..765f1a2ade3 100644 --- a/spartan/aztec-network/values/gcp-proving-test.yaml +++ b/spartan/aztec-network/values/gcp-proving-test.yaml @@ -23,7 +23,6 @@ validator: storage: "128Gi" bootNode: - realProofs: true validator: disabled: true resources: @@ -33,7 +32,6 @@ bootNode: storage: "128Gi" proverNode: - realProofs: true resources: requests: memory: "8Gi" @@ -42,7 +40,6 @@ proverNode: proverAgent: replicas: 120 - realProofs: true bb: hardwareConcurrency: 31 resources: @@ -50,15 +47,10 @@ proverAgent: memory: "116Gi" cpu: "31" -pxe: - proverEnabled: true - bot: replicas: 16 enabled: true - pxeProverEnabled: true txIntervalSeconds: 1 - proverRealProofs: true botPrivateKey: "" privateTransfersPerTx: 1 publicTransfersPerTx: 1 @@ -80,3 +72,4 @@ fullnameOverride: sp aztec: slotDuration: 36 epochDuration: 32 + realProofs: true diff --git a/spartan/aztec-network/values/multicloud-demo.yaml b/spartan/aztec-network/values/multicloud-demo.yaml index 6ba49557253..2c4ea379e6e 100644 --- a/spartan/aztec-network/values/multicloud-demo.yaml +++ b/spartan/aztec-network/values/multicloud-demo.yaml @@ -17,12 +17,8 @@ bootNode: validator: disabled: true -proverNode: - realProofs: false - proverAgent: replicas: 1 - realProofs: false bb: hardwareConcurrency: 16 diff --git a/spartan/aztec-network/values/prover-node-with-agents.yaml b/spartan/aztec-network/values/prover-node-with-agents.yaml index 4a58f419958..a1b981a5fc9 100644 --- a/spartan/aztec-network/values/prover-node-with-agents.yaml +++ b/spartan/aztec-network/values/prover-node-with-agents.yaml @@ -16,22 +16,16 @@ bootNode: validator: disabled: true -proverNode: - realProofs: false - proverAgent: replicas: 1 - realProofs: false bb: hardwareConcurrency: 16 pxe: external: false - proverEnabled: true bot: enabled: false - pxeProverEnabled: false txIntervalSeconds: 200 jobs: diff --git a/spartan/aztec-network/values/release.yaml b/spartan/aztec-network/values/release.yaml index b48f9cf2640..2f18e02fc51 100644 --- a/spartan/aztec-network/values/release.yaml +++ b/spartan/aztec-network/values/release.yaml @@ -1,6 +1,11 @@ network: public: true +aztec: + slotDuration: 36 + epochDuration: 32 + realProofs: true + images: aztec: pullPolicy: Always @@ -10,7 +15,6 @@ telemetry: otelCollectorEndpoint: http://34.150.160.154:4318 validator: - realProofs: true replicas: 48 validatorKeys: - 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 @@ -118,17 +122,12 @@ validator: disabled: false bootNode: - realProofs: true peerIdPrivateKey: 080212200ba8451c6d62b03c4441f0a466c0bce7a3a595f2cf50a055ded3305c77aa3af0 validator: disabled: true -proverNode: - realProofs: true - proverAgent: replicas: 4 - realProofs: true bb: hardwareConcurrency: 16 gke: @@ -141,19 +140,11 @@ proverAgent: memory: "96Gi" cpu: "16" -pxe: - proverEnabled: true - bot: followChain: "PENDING" enabled: true - pxeProverEnabled: true txIntervalSeconds: 200 jobs: deployL1Verifier: enable: true - -aztec: - slotDuration: 36 - epochDuration: 32 diff --git a/spartan/terraform/deploy-release/deploy.sh b/spartan/terraform/deploy-release/deploy.sh index e9574554524..ac13466745f 100755 --- a/spartan/terraform/deploy-release/deploy.sh +++ b/spartan/terraform/deploy-release/deploy.sh @@ -1,5 +1,12 @@ #!/bin/bash -RELEASE_NAME="rough-rhino" +# Usage: ./deploy.sh +# Example: ./deploy.sh rough-rhino aztecprotocol/aztec:698cd3d62680629a3f1bfc0f82604534cedbccf3-x86_64 + +set -eu + +RELEASE_NAME=$1 +AZTEC_DOCKER_IMAGE=$2 + terraform init -backend-config="key=deploy-network/${RELEASE_NAME}/terraform.tfstate" -terraform apply -var-file="release.tfvars" +terraform apply -var-file="release.tfvars" -var="RELEASE_NAME=${RELEASE_NAME}" -var="AZTEC_DOCKER_IMAGE=${AZTEC_DOCKER_IMAGE}" diff --git a/spartan/terraform/deploy-release/main.tf b/spartan/terraform/deploy-release/main.tf index bd98f0897a8..458f36795ef 100644 --- a/spartan/terraform/deploy-release/main.tf +++ b/spartan/terraform/deploy-release/main.tf @@ -18,32 +18,32 @@ terraform { provider "kubernetes" { alias = "gke-cluster" config_path = "~/.kube/config" - config_context = var.gke_cluster_context + config_context = var.GKE_CLUSTER_CONTEXT } provider "helm" { alias = "gke-cluster" kubernetes { config_path = "~/.kube/config" - config_context = var.gke_cluster_context + config_context = var.GKE_CLUSTER_CONTEXT } } # Aztec Helm release for gke-cluster resource "helm_release" "aztec-gke-cluster" { provider = helm.gke-cluster - name = var.release_name + name = var.RELEASE_NAME repository = "../../" chart = "aztec-network" - namespace = var.release_name + namespace = var.RELEASE_NAME create_namespace = true # base values file - values = [file("../../aztec-network/values/${var.values_file}")] + values = [file("../../aztec-network/values/${var.VALUES_FILE}")] set { name = "images.aztec.image" - value = var.aztec_docker_image + value = var.AZTEC_DOCKER_IMAGE } # Setting timeout and wait conditions diff --git a/spartan/terraform/deploy-release/release.tfvars b/spartan/terraform/deploy-release/release.tfvars index f3236423d9f..916a85db918 100644 --- a/spartan/terraform/deploy-release/release.tfvars +++ b/spartan/terraform/deploy-release/release.tfvars @@ -1,4 +1 @@ -release_name = "rough-rhino" -values_file = "release.yaml" -aztec_docker_image = "aztecprotocol/aztec:698cd3d62680629a3f1bfc0f82604534cedbccf3-x86_64" - +VALUES_FILE = "release.yaml" diff --git a/spartan/terraform/deploy-release/variables.tf b/spartan/terraform/deploy-release/variables.tf index ebccc9d3f67..03930fa3d65 100644 --- a/spartan/terraform/deploy-release/variables.tf +++ b/spartan/terraform/deploy-release/variables.tf @@ -1,20 +1,20 @@ -variable "gke_cluster_context" { +variable "GKE_CLUSTER_CONTEXT" { description = "GKE cluster context" type = string default = "gke_testnet-440309_us-east4-a_spartan-gke" } -variable "release_name" { +variable "RELEASE_NAME" { description = "Name of helm deployment and k8s namespace" type = string } -variable "values_file" { +variable "VALUES_FILE" { description = "Name of the values file to use for deployment" type = string } -variable "aztec_docker_image" { +variable "AZTEC_DOCKER_IMAGE" { description = "Docker image to use for the aztec network" type = string }