Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tf vars #10457

Merged
merged 13 commits into from
Dec 6, 2024
Merged
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
20 changes: 10 additions & 10 deletions .github/workflows/devnet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: ./.github/workflows/network-deploy.yml
with:
namespace: ${{ github.event.inputs.namespace }}
values_file: release-devnet
values_file: release-devnet.yaml
aztec_docker_image: ${{ github.event.inputs.aztec_docker_image }}
deployment_mnemonic_secret_name: ${{ github.event.inputs.deployment_mnemonic_secret_name }}
respect_tf_lock: ${{ github.event.inputs.respect_tf_lock }}
Expand All @@ -48,8 +48,6 @@ jobs:
runs-on: ubuntu-latest
needs: deploy-network
steps:
- uses: ./.github/ci-setup-action

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down Expand Up @@ -97,15 +95,15 @@ jobs:
trap cleanup EXIT

echo "Waiting for PXE pods to be ready..."
if ! kubectl wait --for=condition=ready pod -l app=$NAMESPACE-aztec-network-pxe --timeout=10m; then
if ! kubectl wait -n $NAMESPACE --for=condition=ready pod -l app=pxe --timeout=10m; then
echo "Error: PXE pods did not become ready within timeout"
exit 1
fi

helm get values $NAMESPACE -n $NAMESPACE -o json --all > helm_values.json

PXE_PORT="$(jq -r .pxe.service.nodePort helm_values.json)"
ETHEREUM_PORT="$(jq -r ethereum.service.port helm_values.json)"
ETHEREUM_PORT="$(jq -r .ethereum.service.port helm_values.json)"
L1_CHAIN_ID="$(jq -r .ethereum.chainId helm_values.json)"

MNEMONIC="$(jq -r .aztec.l1DeploymentMnemonic helm_values.json)"
Expand All @@ -115,18 +113,20 @@ jobs:

kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-pxe $PXE_PORT &
pxe_port_forward_pid=$!
kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-ethereum $ETHEREUM_PORT &

# port-forward directly to the pod because the Eth node does not have a service definition
ETH_POD_NAME=$(kubectl get pods -n $NAMESPACE -l app=ethereum -o jsonpath='{.items[0].metadata.name}')
kubectl port-forward -n $NAMESPACE pod/$ETH_POD_NAME $ETHEREUM_PORT &
ethereum_port_forward_pid=$!

# wait for port-forwards to establish
sleep 5

docker run --rm $AZTEC_DOCKER_IMAGE bootstrap-network \
--network host \
docker run --rm --network host $AZTEC_DOCKER_IMAGE bootstrap-network \
--rpc-url http://127.0.0.1:$PXE_PORT \
--l1-rpc-url http://127.0.0.1:$ETHEREUM_PORT \
--l1-chain-id $CHAIN_ID \
--mnemonic $MNEMONIC \
--l1-chain-id "$L1_CHAIN_ID" \
--mnemonic "$MNEMONIC" \
--json | tee ./basic_contracts.json

aws s3 cp ./basic_contracts.json ${{ env.CONTRACT_S3_BUCKET }}/devnet/basic_contracts.json
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/network-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ jobs:
working-directory: ./spartan/terraform/deploy-release
run: |
terraform plan \
-var="release_name=${{ env.NAMESPACE }}" \
-var="values_file=${{ env.VALUES_FILE }}" \
-var="gke_cluster_context=${{ env.GKE_CLUSTER_CONTEXT }}" \
-var="aztec_docker_image=${{ env.AZTEC_DOCKER_IMAGE }}" \
-var="l1_deployment_mnemonic=${{ steps.get-mnemonic.outputs.mnemonic }}" \
-var="RELEASE_NAME=${{ env.NAMESPACE }}" \
-var="VALUES_FILE=${{ env.VALUES_FILE }}" \
-var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \
-var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \
-var="L1_DEPLOYMENT_MNEMONIC=${{ steps.get-mnemonic.outputs.mnemonic }}" \
-out=tfplan \
-lock=${{ inputs.respect_tf_lock }}

Expand Down
5 changes: 5 additions & 0 deletions spartan/aztec-network/templates/deploy-l1-verifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ metadata:
name: {{ include "aztec-network.fullname" . }}-deploy-l1-verifier
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation

spec:
template:
metadata:
Expand Down
4 changes: 4 additions & 0 deletions spartan/aztec-network/templates/setup-l2-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "aztec-network.fullname" . }}-setup-l2-contracts
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
metadata:
Expand Down
5 changes: 3 additions & 2 deletions spartan/terraform/deploy-release/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = "~> 2.12.1"
version = "~> 2.16.1"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down Expand Up @@ -37,6 +37,7 @@ resource "helm_release" "aztec-gke-cluster" {
chart = "aztec-network"
namespace = var.RELEASE_NAME
create_namespace = true
upgrade_install = true

# base values file
values = [file("../../aztec-network/values/${var.VALUES_FILE}")]
Expand All @@ -48,7 +49,7 @@ resource "helm_release" "aztec-gke-cluster" {

set {
name = "aztec.l1DeploymentMnemonic"
value = var.l1_deployment_mnemonic
value = var.L1_DEPLOYMENT_MNEMONIC
}

# Setting timeout and wait conditions
Expand Down
2 changes: 1 addition & 1 deletion spartan/terraform/deploy-release/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ variable "AZTEC_DOCKER_IMAGE" {
type = string
}

variable "l1_deployment_mnemonic" {
variable "L1_DEPLOYMENT_MNEMONIC" {
description = "Mnemonic to use for the L1 contract deployments"
type = string
sensitive = true
Expand Down
1 change: 1 addition & 0 deletions yarn-project/cli/src/cmds/devnet/bootstrap_network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ async function deployERC20({ walletClient, publicClient }: L1Clients) {
publicClient,
erc20.contractAbi,
erc20.contractBytecode,
['DevCoin', 'DEV', walletClient.account.address],
);
const { address: portalAddress } = await deployL1Contract(
walletClient,
Expand Down
Loading