Skip to content

Commit 04d5631

Browse files
author
AztecBot
committed
Merge branch 'next' into merge-train/barretenberg
2 parents e6e7017 + d0d5be1 commit 04d5631

File tree

74 files changed

+3931
-2890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3931
-2890
lines changed

.github/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.secrets
1+
.secrets
2+
.act-tool-cache

.github/local_workflow.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ args=("$@")
3232

3333
SA_KEY_JSON=$(cat "$GOOGLE_APPLICATION_CREDENTIALS")
3434

35+
mkdir -p $REPO_ROOT/.github/.act-tool-cache
36+
3537
act workflow_dispatch -j $workflow_name \
38+
--env RUNNER_TOOL_CACHE=/work/toolcache \
3639
-s GITHUB_TOKEN="$(gh auth token)" \
3740
-s GCP_SA_KEY="$SA_KEY_JSON" \
3841
-s KUBECONFIG_B64="$(cat $HOME/.kube/config | base64 -w0)" \
39-
--container-options "--user $(id -u):$(id -g)" \
42+
--container-options "-v $REPO_ROOT/.github/.act-tool-cache:/work/toolcache --user $(id -u):$(id -g)" \
4043
--bind \
4144
--directory $REPO_ROOT "${args[@]}"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Canary Release Tag
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# Add permissions for the GitHub Actions bot to push tags
7+
permissions:
8+
contents: write
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
13+
jobs:
14+
nightly-release-tag:
15+
runs-on: ubuntu-latest
16+
steps:
17+
# Check out the repository so we can read files and create tags.
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
19+
with:
20+
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
21+
22+
# Extract the current release version from the manifest.
23+
# Then, create a canary tag using the current version and the current UTC date.
24+
- name: Create Canary Tag
25+
run: |
26+
git config --global user.email "[email protected]"
27+
git config --global user.name "AztecBot"
28+
current_version=$(jq -r '."."' .release-please-manifest.json)
29+
# Compute the next major version. e.g. if current version is 1.2.3, next major version is 2.0.0.
30+
if [[ "$current_version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
31+
major=$(( ${BASH_REMATCH[1]} + 1 ))
32+
next_major_version="${major}.0.0"
33+
else
34+
echo "Error: Current version format is invalid: $current_version"
35+
exit 1
36+
fi
37+
echo "Current version: $current_version"
38+
echo "Next version: $next_major_version"
39+
canary_tag="v${next_major_version}-canary.$(git rev-parse --short HEAD)"
40+
echo "Canary tag: $canary_tag"
41+
# Tag and push.
42+
git tag -a "$canary_tag" -m "$canary_tag"
43+
git push origin "$canary_tag"

.github/workflows/ci3.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ jobs:
149149
if: steps.ci_cache.outputs.cache-hit != 'true'
150150
run: echo "success" > ci-success.txt
151151

152+
- name: Get Semver from Tag
153+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
154+
id: semver
155+
run: |
156+
semver="${{ github.ref_name }}"
157+
# Remove 'v' prefix if present (e.g., v1.2.3 -> 1.2.3)
158+
semver=${semver#v}
159+
# Extract major version (e.g., 1.2.3 -> 1)
160+
major_version=${semver%%.*}
161+
echo "semver=$semver" >> $GITHUB_OUTPUT
162+
echo "major_version=$major_version" >> $GITHUB_OUTPUT
163+
164+
- name: Trigger Network Deployments
165+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
166+
uses: peter-evans/repository-dispatch@0ee9de00feb82e6165438c503f0bc29f628b8317
167+
with:
168+
event-type: network-deployments
169+
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "semver": "${{ steps.semver.outputs.semver }}", "major_version": "${{ steps.semver.outputs.major_version }}"}'
170+
152171
# If we have passed CI and labelled with ci-squash-and-merge, squash the PR.
153172
# This will rerun CI on the squash commit - but is intended to be a no-op due to caching.
154173
- name: CI Squash and Merge
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
name: Deploy Aztec Infra
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
cluster:
7+
description: The cluster to deploy to, e.g. aztec-gke-private or kind
8+
required: true
9+
type: string
10+
namespace:
11+
description: The namespace to deploy to
12+
required: true
13+
type: string
14+
ref:
15+
description: The branch name to deploy from.
16+
required: true
17+
type: string
18+
run_terraform_destroy:
19+
description: Whether to run terraform destroy
20+
required: true
21+
type: boolean
22+
default: false
23+
aztec_docker_image:
24+
description: The Aztec Docker image to deploy
25+
required: true
26+
type: string
27+
l1_rpc_urls:
28+
description: L1 RPC URLs as JSON array
29+
required: true
30+
type: string
31+
l1_consensus_host_urls:
32+
description: L1 consensus host URLs as JSON array
33+
required: true
34+
type: string
35+
l1_consensus_host_api_keys:
36+
description: L1 consensus host API keys as JSON array
37+
required: true
38+
type: string
39+
l1_consensus_host_api_key_headers:
40+
description: L1 consensus host API key headers as JSON array
41+
required: true
42+
type: string
43+
l1_chain_id:
44+
description: L1 chain ID
45+
required: true
46+
type: string
47+
registry_address:
48+
description: Registry contract address
49+
required: true
50+
type: string
51+
slash_factory_address:
52+
description: Slash factory contract address
53+
required: true
54+
type: string
55+
fee_asset_handler_address:
56+
description: Fee asset handler contract address
57+
required: true
58+
type: string
59+
validator_mnemonic:
60+
description: Validator mnemonic phrase
61+
required: true
62+
type: string
63+
validator_mnemonic_start_index:
64+
description: Validator mnemonic start index
65+
required: true
66+
type: number
67+
validators_per_node:
68+
description: Number of validators per node
69+
required: true
70+
type: number
71+
validator_replicas:
72+
description: Number of validator replicas
73+
required: true
74+
type: number
75+
prover_mnemonic:
76+
description: Prover mnemonic phrase
77+
required: true
78+
type: string
79+
prover_mnemonic_start_index:
80+
description: Prover mnemonic start index
81+
required: true
82+
type: number
83+
p2p_bootstrap_resource_profile:
84+
description: P2P bootstrap resource profile
85+
required: true
86+
type: string
87+
validator_resource_profile:
88+
description: Validator resource profile
89+
required: true
90+
type: string
91+
prover_resource_profile:
92+
description: Prover resource profile
93+
required: true
94+
type: string
95+
rpc_resource_profile:
96+
description: RPC resource profile
97+
required: true
98+
type: string
99+
rpc_external_ingress:
100+
description: Whether to use an external ingress for the rpc
101+
required: true
102+
type: boolean
103+
secrets:
104+
GCP_SA_KEY:
105+
description: The GCP service account key
106+
required: true
107+
KUBECONFIG_B64:
108+
description: The base64 encoded kubeconfig
109+
required: true
110+
111+
workflow_dispatch:
112+
inputs:
113+
cluster:
114+
description: The cluster to deploy to, e.g. aztec-gke-private or kind
115+
required: true
116+
type: string
117+
namespace:
118+
description: The namespace to deploy to
119+
required: true
120+
type: string
121+
ref:
122+
description: The branch name to deploy from.
123+
required: true
124+
type: string
125+
run_terraform_destroy:
126+
description: Whether to run terraform destroy
127+
required: true
128+
type: boolean
129+
default: false
130+
aztec_docker_image:
131+
description: The Aztec Docker image to deploy
132+
required: true
133+
type: string
134+
l1_rpc_urls:
135+
description: L1 RPC URLs as JSON array. Format, e.g. ["http://10.96.142.184:8545"]
136+
required: true
137+
type: string
138+
l1_consensus_host_urls:
139+
description: L1 consensus host URLs as JSON array. Format, e.g. ["http://10.96.36.205:5052"]
140+
required: true
141+
type: string
142+
l1_consensus_host_api_keys:
143+
description: L1 consensus host API keys as JSON array. Format, e.g. ["1234567890"]
144+
required: true
145+
type: string
146+
l1_consensus_host_api_key_headers:
147+
description: L1 consensus host API key headers as JSON array. Format, e.g. ["X-API-Key"]
148+
required: true
149+
type: string
150+
l1_chain_id:
151+
description: L1 chain ID
152+
required: true
153+
type: string
154+
registry_address:
155+
description: Registry contract address
156+
required: true
157+
type: string
158+
slash_factory_address:
159+
description: Slash factory contract address
160+
required: true
161+
type: string
162+
fee_asset_handler_address:
163+
description: Fee asset handler contract address
164+
required: true
165+
type: string
166+
validator_mnemonic:
167+
description: Validator mnemonic phrase
168+
required: true
169+
type: string
170+
validator_mnemonic_start_index:
171+
description: Validator mnemonic start index
172+
required: true
173+
type: number
174+
validators_per_node:
175+
description: Number of validators per node
176+
required: true
177+
type: number
178+
validator_replicas:
179+
description: Number of validator replicas
180+
required: true
181+
type: number
182+
prover_mnemonic:
183+
description: Prover mnemonic phrase
184+
required: true
185+
type: string
186+
prover_mnemonic_start_index:
187+
description: Prover mnemonic start index
188+
required: true
189+
type: number
190+
p2p_bootstrap_resource_profile:
191+
description: P2P bootstrap resource profile
192+
required: true
193+
type: string
194+
validator_resource_profile:
195+
description: Validator resource profile
196+
required: true
197+
type: string
198+
prover_resource_profile:
199+
description: Prover resource profile
200+
required: true
201+
type: string
202+
rpc_resource_profile:
203+
description: RPC resource profile
204+
required: true
205+
type: string
206+
rpc_external_ingress:
207+
description: Whether to use an external ingress for the rpc
208+
required: true
209+
type: boolean
210+
211+
jobs:
212+
deploy_aztec_infra:
213+
runs-on: ubuntu-latest
214+
env:
215+
TF_VAR_RELEASE_PREFIX: aztec-infra
216+
TF_VAR_GCP_PROJECT: "testnet-440309"
217+
TF_VAR_GCP_REGION: us-west1
218+
TF_VAR_K8S_CLUSTER_CONTEXT: ${{ inputs.cluster }}
219+
TF_VAR_NAMESPACE: ${{ inputs.namespace }}
220+
TF_VAR_AZTEC_DOCKER_IMAGE: ${{ inputs.aztec_docker_image }}
221+
TF_VAR_L1_RPC_URLS: ${{ inputs.l1_rpc_urls }}
222+
TF_VAR_L1_CONSENSUS_HOST_URLS: ${{ inputs.l1_consensus_host_urls }}
223+
TF_VAR_L1_CONSENSUS_HOST_API_KEYS: ${{ inputs.l1_consensus_host_api_keys }}
224+
TF_VAR_L1_CONSENSUS_HOST_API_KEY_HEADERS: ${{ inputs.l1_consensus_host_api_key_headers }}
225+
TF_VAR_L1_CHAIN_ID: ${{ inputs.l1_chain_id }}
226+
TF_VAR_REGISTRY_CONTRACT_ADDRESS: ${{ inputs.registry_address }}
227+
TF_VAR_SLASH_FACTORY_CONTRACT_ADDRESS: ${{ inputs.slash_factory_address }}
228+
TF_VAR_FEE_ASSET_HANDLER_CONTRACT_ADDRESS: ${{ inputs.fee_asset_handler_address }}
229+
TF_VAR_VALIDATOR_MNEMONIC: ${{ inputs.validator_mnemonic }}
230+
TF_VAR_VALIDATOR_MNEMONIC_START_INDEX: ${{ inputs.validator_mnemonic_start_index }}
231+
TF_VAR_VALIDATORS_PER_NODE: ${{ inputs.validators_per_node }}
232+
TF_VAR_VALIDATOR_REPLICAS: ${{ inputs.validator_replicas }}
233+
TF_VAR_PROVER_MNEMONIC: ${{ inputs.prover_mnemonic }}
234+
TF_VAR_PROVER_MNEMONIC_START_INDEX: ${{ inputs.prover_mnemonic_start_index }}
235+
TF_VAR_P2P_BOOTSTRAP_RESOURCE_PROFILE: ${{ inputs.p2p_bootstrap_resource_profile }}
236+
TF_VAR_VALIDATOR_RESOURCE_PROFILE: ${{ inputs.validator_resource_profile }}
237+
TF_VAR_PROVER_RESOURCE_PROFILE: ${{ inputs.prover_resource_profile }}
238+
TF_VAR_RPC_RESOURCE_PROFILE: ${{ inputs.rpc_resource_profile }}
239+
TF_VAR_RPC_EXTERNAL_INGRESS: ${{ inputs.rpc_external_ingress }}
240+
241+
steps:
242+
- name: Debug inputs
243+
run: |
244+
echo "cluster: ${{ inputs.cluster }}"
245+
echo "namespace: ${{ inputs.namespace }}"
246+
247+
- name: Setup K8s and Terraform
248+
uses: ./.github/actions/setup-k8s-terraform
249+
with:
250+
cluster: ${{ inputs.cluster }}
251+
namespace: ${{ inputs.namespace }}
252+
ref: ${{ inputs.ref || github.ref }}
253+
gcp_sa_key: ${{ secrets.GCP_SA_KEY }}
254+
kubeconfig_b64: ${{ secrets.KUBECONFIG_B64 }}
255+
terraform_dir: ./spartan/terraform/deploy-aztec-infra
256+
tf_state_prefix: deploy-aztec-infra
257+
run_terraform_destroy: ${{ inputs.run_terraform_destroy }}
258+
259+
- name: Terraform Plan
260+
working-directory: ./spartan/terraform/deploy-aztec-infra
261+
run: |
262+
# All variables are now set as TF_VAR_ environment variables
263+
terraform plan -out=tfplan
264+
265+
- name: Terraform Apply
266+
working-directory: ./spartan/terraform/deploy-aztec-infra
267+
run: |
268+
terraform apply tfplan

0 commit comments

Comments
 (0)