Skip to content

Commit 58fff55

Browse files
authored
chore: deploy testnet GA workflow (#15887)
1 parent acd3a0c commit 58fff55

File tree

2 files changed

+116
-1
lines changed

2 files changed

+116
-1
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Aztec Testnet Deployment
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
respect_tf_lock:
7+
description: Whether to respect the Terraform lock
8+
required: false
9+
type: string
10+
default: "true"
11+
run_terraform_destroy:
12+
description: Whether to run terraform destroy before deploying
13+
required: false
14+
type: string
15+
default: "false"
16+
aztec_docker_image:
17+
description: The Aztec Docker image to use, e.g. aztecprotocol/aztec:latest
18+
required: false
19+
type: string
20+
secrets:
21+
GCP_SA_KEY:
22+
required: true
23+
workflow_dispatch:
24+
inputs:
25+
respect_tf_lock:
26+
description: Whether to respect the Terraform lock
27+
required: false
28+
type: string
29+
default: "true"
30+
run_terraform_destroy:
31+
description: Whether to run terraform destroy before deploying
32+
required: false
33+
type: string
34+
default: "false"
35+
aztec_docker_image:
36+
description: The Aztec Docker image to use, e.g. aztecprotocol/aztec:latest
37+
required: false
38+
type: string
39+
40+
jobs:
41+
testnet_deployment:
42+
runs-on: ubuntu-latest
43+
concurrency:
44+
group: deploy-testnet # Only one job globally
45+
cancel-in-progress: false # Allow previous deployment to complete to avoid corruption
46+
47+
env:
48+
AZTEC_DOCKER_IMAGE: ${{ inputs.aztec_docker_image }}
49+
CLUSTER_NAME: aztec-gke-public
50+
REGION: us-west1-a
51+
TF_STATE_BUCKET: aztec-terraform
52+
GKE_CLUSTER_CONTEXT: "gke_testnet-440309_us-west1-a_aztec-gke-public"
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
57+
with:
58+
ref: ${{ inputs.ref }}
59+
60+
- name: Authenticate to Google Cloud
61+
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f
62+
with:
63+
credentials_json: ${{ secrets.GCP_SA_KEY }}
64+
65+
- name: Set up Cloud SDK
66+
uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a
67+
68+
- name: Install GKE Auth Plugin
69+
run: |
70+
gcloud components install gke-gcloud-auth-plugin --quiet
71+
72+
- name: Configure kubectl with GKE cluster
73+
run: |
74+
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region ${{ env.REGION }}
75+
76+
- name: Ensure Terraform state bucket exists
77+
run: |
78+
if ! gsutil ls gs://${{ env.TF_STATE_BUCKET }} >/dev/null 2>&1; then
79+
echo "Creating GCS bucket for Terraform state..."
80+
gsutil mb -l us-east4 gs://${{ env.TF_STATE_BUCKET }}
81+
gsutil versioning set on gs://${{ env.TF_STATE_BUCKET }}
82+
else
83+
echo "Terraform state bucket already exists"
84+
fi
85+
86+
- name: Setup Terraform
87+
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1
88+
with:
89+
terraform_version: "1.5.0"
90+
91+
- name: Terraform Init
92+
working-directory: ./spartan/terraform/deploy-testnet
93+
run: |
94+
terraform init
95+
96+
- name: Terraform Destroy
97+
working-directory: ./spartan/terraform/deploy-testnet
98+
if: ${{ inputs.run_terraform_destroy == 'true' }}
99+
# Destroy fails if the resources are already destroyed, so we continue on error
100+
continue-on-error: true
101+
run: |
102+
terraform destroy -auto-approve \
103+
-lock=${{ inputs.respect_tf_lock }}
104+
105+
- name: Terraform Plan
106+
working-directory: ./spartan/terraform/deploy-testnet
107+
run: |
108+
terraform plan \
109+
-out=tfplan \
110+
-var="AZTEC_DOCKER_IMAGE=${AZTEC_DOCKER_IMAGE:-aztecprotocol/aztec:latest}" \
111+
-lock=${{ inputs.respect_tf_lock }}
112+
113+
- name: Terraform Apply
114+
working-directory: ./spartan/terraform/deploy-testnet
115+
run: terraform apply -lock=${{ inputs.respect_tf_lock }} -auto-approve tfplan

spartan/terraform/deploy-telemetry/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ resource "kubernetes_manifest" "otel_ingress_backend" {
9393

9494
locals {
9595
prefixes = jsondecode(file("../../../yarn-project/aztec/public_include_metric_prefixes.json"))
96-
registries = ["0x4d2cc1d5fb6be65240e0bfc8154243e69c0fb19e", "0xec4156431d0f3df66d4e24ba3d30dcb4c85fa309"]
96+
registries = ["0xec4156431d0f3df66d4e24ba3d30dcb4c85fa309"]
9797
roles = ["sequencer"]
9898

9999
otel_metric_allowlist = join(" or ", formatlist("HasPrefix(name, %q)", local.prefixes))

0 commit comments

Comments
 (0)