|
| 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 | + default: "kind" |
| 11 | + namespace: |
| 12 | + description: The namespace to deploy to |
| 13 | + required: true |
| 14 | + type: string |
| 15 | + default: "eth-devnet" |
| 16 | + ref: |
| 17 | + description: The branch name to deploy from. |
| 18 | + required: true |
| 19 | + type: string |
| 20 | + default: "next" |
| 21 | + run_terraform_destroy: |
| 22 | + description: Whether to run terraform destroy |
| 23 | + required: true |
| 24 | + type: boolean |
| 25 | + default: false |
| 26 | + aztec_docker_image: |
| 27 | + description: The Aztec Docker image to deploy |
| 28 | + required: true |
| 29 | + type: string |
| 30 | + default: "aztecprotocol/aztec:2.0.0-nightly.20250821" |
| 31 | + l1_rpc_urls: |
| 32 | + description: L1 RPC URLs as JSON array |
| 33 | + required: true |
| 34 | + type: string |
| 35 | + default: '["http://10.96.142.184:8545"]' |
| 36 | + l1_consensus_host_urls: |
| 37 | + description: L1 consensus host URLs as JSON array |
| 38 | + required: true |
| 39 | + type: string |
| 40 | + default: '["http://10.96.36.205:5052"]' |
| 41 | + l1_consensus_host_api_keys: |
| 42 | + description: L1 consensus host API keys as JSON array |
| 43 | + required: true |
| 44 | + type: string |
| 45 | + default: '[""]' |
| 46 | + l1_consensus_host_api_key_headers: |
| 47 | + description: L1 consensus host API key headers as JSON array |
| 48 | + required: true |
| 49 | + type: string |
| 50 | + default: '[""]' |
| 51 | + l1_chain_id: |
| 52 | + description: L1 chain ID |
| 53 | + required: true |
| 54 | + type: string |
| 55 | + default: "1337" |
| 56 | + registry_address: |
| 57 | + description: Registry contract address |
| 58 | + required: true |
| 59 | + type: string |
| 60 | + default: "0x23c876c7cb2c16e52ff4eace5b83a4ff87339183" |
| 61 | + slash_factory_address: |
| 62 | + description: Slash factory contract address |
| 63 | + required: true |
| 64 | + type: string |
| 65 | + default: "0x51a50bb3d8cfebacfc2b6285f0eaf3ee71aefc36" |
| 66 | + fee_asset_handler_address: |
| 67 | + description: Fee asset handler contract address |
| 68 | + required: true |
| 69 | + type: string |
| 70 | + default: "0xf1bb40a94dbf6054e972c0c1f2b0fde6724e5126" |
| 71 | + validator_mnemonic: |
| 72 | + description: Validator mnemonic phrase |
| 73 | + required: true |
| 74 | + type: string |
| 75 | + default: "test test test test test test test test test test test junk" |
| 76 | + validator_mnemonic_start_index: |
| 77 | + description: Validator mnemonic start index |
| 78 | + required: true |
| 79 | + type: number |
| 80 | + default: 1 |
| 81 | + validators_per_node: |
| 82 | + description: Number of validators per node |
| 83 | + required: true |
| 84 | + type: number |
| 85 | + default: 1 |
| 86 | + validator_replicas: |
| 87 | + description: Number of validator replicas |
| 88 | + required: true |
| 89 | + type: number |
| 90 | + default: 4 |
| 91 | + prover_mnemonic: |
| 92 | + description: Prover mnemonic phrase |
| 93 | + required: true |
| 94 | + type: string |
| 95 | + default: "test test test test test test test test test test test junk" |
| 96 | + prover_mnemonic_start_index: |
| 97 | + description: Prover mnemonic start index |
| 98 | + required: true |
| 99 | + type: number |
| 100 | + default: 1000 |
| 101 | + p2p_bootstrap_resource_profile: |
| 102 | + description: P2P bootstrap resource profile |
| 103 | + required: true |
| 104 | + type: string |
| 105 | + default: "dev" |
| 106 | + validator_resource_profile: |
| 107 | + description: Validator resource profile |
| 108 | + required: true |
| 109 | + type: string |
| 110 | + default: "dev" |
| 111 | + prover_resource_profile: |
| 112 | + description: Prover resource profile |
| 113 | + required: true |
| 114 | + type: string |
| 115 | + default: "dev" |
| 116 | + rpc_resource_profile: |
| 117 | + description: RPC resource profile |
| 118 | + required: true |
| 119 | + type: string |
| 120 | + default: "dev" |
| 121 | + secrets: |
| 122 | + GCP_SA_KEY: |
| 123 | + description: The GCP service account key |
| 124 | + required: true |
| 125 | + KUBECONFIG_B64: |
| 126 | + description: The base64 encoded kubeconfig |
| 127 | + required: true |
| 128 | + |
| 129 | + workflow_dispatch: |
| 130 | + inputs: |
| 131 | + cluster: |
| 132 | + description: The cluster to deploy to, e.g. aztec-gke-private or kind |
| 133 | + required: false |
| 134 | + type: string |
| 135 | + default: "kind" |
| 136 | + namespace: |
| 137 | + description: The namespace to deploy to |
| 138 | + required: false |
| 139 | + type: string |
| 140 | + default: "eth-devnet" |
| 141 | + ref: |
| 142 | + description: The branch name to deploy from. |
| 143 | + required: true |
| 144 | + type: string |
| 145 | + default: "next" |
| 146 | + run_terraform_destroy: |
| 147 | + description: Whether to run terraform destroy |
| 148 | + required: true |
| 149 | + type: boolean |
| 150 | + default: false |
| 151 | + aztec_docker_image: |
| 152 | + description: The Aztec Docker image to deploy |
| 153 | + required: false |
| 154 | + type: string |
| 155 | + default: "aztecprotocol/aztec:2.0.0-nightly.20250821" |
| 156 | + l1_rpc_urls: |
| 157 | + description: L1 RPC URLs as JSON array |
| 158 | + required: false |
| 159 | + type: string |
| 160 | + default: '["http://10.96.142.184:8545"]' |
| 161 | + l1_consensus_host_urls: |
| 162 | + description: L1 consensus host URLs as JSON array |
| 163 | + required: false |
| 164 | + type: string |
| 165 | + default: '["http://10.96.36.205:5052"]' |
| 166 | + l1_consensus_host_api_keys: |
| 167 | + description: L1 consensus host API keys as JSON array |
| 168 | + required: false |
| 169 | + type: string |
| 170 | + default: '[""]' |
| 171 | + l1_consensus_host_api_key_headers: |
| 172 | + description: L1 consensus host API key headers as JSON array |
| 173 | + required: false |
| 174 | + type: string |
| 175 | + default: '[""]' |
| 176 | + l1_chain_id: |
| 177 | + description: L1 chain ID |
| 178 | + required: false |
| 179 | + type: string |
| 180 | + default: "1337" |
| 181 | + registry_address: |
| 182 | + description: Registry contract address |
| 183 | + required: false |
| 184 | + type: string |
| 185 | + default: "0x23c876c7cb2c16e52ff4eace5b83a4ff87339183" |
| 186 | + slash_factory_address: |
| 187 | + description: Slash factory contract address |
| 188 | + required: false |
| 189 | + type: string |
| 190 | + default: "0x51a50bb3d8cfebacfc2b6285f0eaf3ee71aefc36" |
| 191 | + fee_asset_handler_address: |
| 192 | + description: Fee asset handler contract address |
| 193 | + required: false |
| 194 | + type: string |
| 195 | + default: "0xf1bb40a94dbf6054e972c0c1f2b0fde6724e5126" |
| 196 | + validator_mnemonic: |
| 197 | + description: Validator mnemonic phrase |
| 198 | + required: false |
| 199 | + type: string |
| 200 | + default: "test test test test test test test test test test test junk" |
| 201 | + validator_mnemonic_start_index: |
| 202 | + description: Validator mnemonic start index |
| 203 | + required: false |
| 204 | + type: number |
| 205 | + default: 1 |
| 206 | + validators_per_node: |
| 207 | + description: Number of validators per node |
| 208 | + required: false |
| 209 | + type: number |
| 210 | + default: 1 |
| 211 | + validator_replicas: |
| 212 | + description: Number of validator replicas |
| 213 | + required: false |
| 214 | + type: number |
| 215 | + default: 4 |
| 216 | + prover_mnemonic: |
| 217 | + description: Prover mnemonic phrase |
| 218 | + required: false |
| 219 | + type: string |
| 220 | + default: "test test test test test test test test test test test junk" |
| 221 | + prover_mnemonic_start_index: |
| 222 | + description: Prover mnemonic start index |
| 223 | + required: false |
| 224 | + type: number |
| 225 | + default: 1000 |
| 226 | + p2p_bootstrap_resource_profile: |
| 227 | + description: P2P bootstrap resource profile |
| 228 | + required: false |
| 229 | + type: string |
| 230 | + default: "dev" |
| 231 | + validator_resource_profile: |
| 232 | + description: Validator resource profile |
| 233 | + required: false |
| 234 | + type: string |
| 235 | + default: "dev" |
| 236 | + prover_resource_profile: |
| 237 | + description: Prover resource profile |
| 238 | + required: false |
| 239 | + type: string |
| 240 | + default: "dev" |
| 241 | + rpc_resource_profile: |
| 242 | + description: RPC resource profile |
| 243 | + required: false |
| 244 | + type: string |
| 245 | + default: "dev" |
| 246 | + |
| 247 | +jobs: |
| 248 | + deploy_aztec_infra: |
| 249 | + runs-on: ubuntu-latest |
| 250 | + env: |
| 251 | + TF_VAR_K8S_CLUSTER_CONTEXT: ${{ inputs.cluster }} |
| 252 | + TF_VAR_NAMESPACE: ${{ inputs.namespace }} |
| 253 | + TF_VAR_RELEASE_PREFIX: aztec-infra |
| 254 | + TF_VAR_AZTEC_DOCKER_IMAGE: ${{ inputs.aztec_docker_image }} |
| 255 | + TF_VAR_L1_RPC_URLS: ${{ inputs.l1_rpc_urls }} |
| 256 | + TF_VAR_L1_CONSENSUS_HOST_URLS: ${{ inputs.l1_consensus_host_urls }} |
| 257 | + TF_VAR_L1_CONSENSUS_HOST_API_KEYS: ${{ inputs.l1_consensus_host_api_keys }} |
| 258 | + TF_VAR_L1_CONSENSUS_HOST_API_KEY_HEADERS: ${{ inputs.l1_consensus_host_api_key_headers }} |
| 259 | + TF_VAR_L1_CHAIN_ID: ${{ inputs.l1_chain_id }} |
| 260 | + TF_VAR_REGISTRY_CONTRACT_ADDRESS: ${{ inputs.registry_address }} |
| 261 | + TF_VAR_SLASH_FACTORY_CONTRACT_ADDRESS: ${{ inputs.slash_factory_address }} |
| 262 | + TF_VAR_FEE_ASSET_HANDLER_CONTRACT_ADDRESS: ${{ inputs.fee_asset_handler_address }} |
| 263 | + TF_VAR_VALIDATOR_MNEMONIC: ${{ inputs.validator_mnemonic }} |
| 264 | + TF_VAR_VALIDATOR_MNEMONIC_START_INDEX: ${{ inputs.validator_mnemonic_start_index }} |
| 265 | + TF_VAR_VALIDATORS_PER_NODE: ${{ inputs.validators_per_node }} |
| 266 | + TF_VAR_VALIDATOR_REPLICAS: ${{ inputs.validator_replicas }} |
| 267 | + TF_VAR_PROVER_MNEMONIC: ${{ inputs.prover_mnemonic }} |
| 268 | + TF_VAR_PROVER_MNEMONIC_START_INDEX: ${{ inputs.prover_mnemonic_start_index }} |
| 269 | + TF_VAR_P2P_BOOTSTRAP_RESOURCE_PROFILE: ${{ inputs.p2p_bootstrap_resource_profile }} |
| 270 | + TF_VAR_VALIDATOR_RESOURCE_PROFILE: ${{ inputs.validator_resource_profile }} |
| 271 | + TF_VAR_PROVER_RESOURCE_PROFILE: ${{ inputs.prover_resource_profile }} |
| 272 | + TF_VAR_RPC_RESOURCE_PROFILE: ${{ inputs.rpc_resource_profile }} |
| 273 | + |
| 274 | + steps: |
| 275 | + - name: Debug inputs |
| 276 | + run: | |
| 277 | + echo "cluster: ${{ inputs.cluster }}" |
| 278 | + echo "namespace: ${{ inputs.namespace }}" |
| 279 | +
|
| 280 | + - name: Setup K8s and Terraform |
| 281 | + uses: ./.github/actions/setup-k8s-terraform |
| 282 | + with: |
| 283 | + cluster: ${{ inputs.cluster }} |
| 284 | + namespace: ${{ inputs.namespace }} |
| 285 | + ref: ${{ inputs.ref || github.ref }} |
| 286 | + gcp_sa_key: ${{ secrets.GCP_SA_KEY }} |
| 287 | + kubeconfig_b64: ${{ secrets.KUBECONFIG_B64 }} |
| 288 | + terraform_dir: ./spartan/terraform/deploy-staging-testnet |
| 289 | + tf_state_prefix: deploy-staging-testnet |
| 290 | + run_terraform_destroy: ${{ inputs.run_terraform_destroy }} |
| 291 | + |
| 292 | + - name: Terraform Plan |
| 293 | + working-directory: ./spartan/terraform/deploy-staging-testnet |
| 294 | + run: | |
| 295 | + # All variables are now set as TF_VAR_ environment variables |
| 296 | + terraform plan -out=tfplan |
| 297 | +
|
| 298 | + - name: Terraform Apply |
| 299 | + working-directory: ./spartan/terraform/deploy-staging-testnet |
| 300 | + run: | |
| 301 | + terraform apply tfplan |
0 commit comments