-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
119 additions
and
789 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: Deploy devnet | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
namespace: | ||
description: The namespace to deploy to, e.g. smoke | ||
required: true | ||
aztec_docker_image: | ||
description: The Aztec Docker image to use | ||
required: true | ||
deployment_mnemonic_secret_name: | ||
description: The name of the secret which holds the boot node's contract deployment mnemonic | ||
required: true | ||
default: testnet-deployment-mnemonic | ||
respect_tf_lock: | ||
description: Whether to respect the Terraform lock | ||
required: false | ||
default: "true" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
CONTRACT_S3_BUCKET: s3://static.aztec.network | ||
CLUSTER_NAME: aztec-gke | ||
REGION: us-west1-a | ||
NAMESPACE: ${{ inputs.namespace }} | ||
AZTEC_DOCKER_IMAGE: ${{ inputs.aztec_docker_image }} | ||
|
||
jobs: | ||
call-network-deploy: | ||
uses: ./.github/workflows/network-deploy.yml@HEAD | ||
with: | ||
namespace: ${{ github.event.inputs.namespace }} | ||
values_file: release-devnet | ||
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 }} | ||
|
||
bootstrap: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: "${{ env.GIT_COMMIT }}" | ||
|
||
- uses: ./.github/ci-setup-action | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: eu-west-2 | ||
|
||
- name: Authenticate to Google Cloud | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
credentials_json: ${{ secrets.GCP_SA_KEY }} | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v2 | ||
|
||
- name: Setup kubectl access | ||
run: | | ||
gcloud components install kubectl gke-gcloud-auth-plugin --quiet | ||
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region ${{ env.REGION }} | ||
- name: Bootstrap network | ||
run: | | ||
set -eu -o pipefail | ||
pxe_port_forward_pid="" | ||
ethereum_port_forward_pid="" | ||
cleanup() { | ||
echo "Cleaning up port-forward processes..." | ||
if [ -n "$pxe_port_forward_pid" ]; then | ||
kill $pxe_port_forward_pid 2>/dev/null || true | ||
fi | ||
if [ -n "$ethereum_port_forward_pid" ]; then | ||
kill $ethereum_port_forward_pid 2>/dev/null || true | ||
fi | ||
} | ||
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 | ||
echo "Error: PXE pods did not become ready within timeout" | ||
exit 1 | ||
fi | ||
kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-pxe 8081 & | ||
pxe_port_forward_pid=$! | ||
kubectl port-forward -n $NAMSPACE svc/$NAMESPACE-aztec-network-ethereum 8545 & | ||
ethereum_port_forward_pid=$! | ||
# wait for port-forwards to establish | ||
sleep 5 | ||
helm get values $NAMSPACE -n $NAMSPACE -o json --all > helm_values.json | ||
L1_CHAIN_ID="$(jq -r .ethereum.chainId helm_values.json)" | ||
MNEMONIC="$(jq -r .aztec.l1DeploymentMnemonic helm_values.json)" | ||
echo "::add-mask::$MNEMONIC" | ||
docker run --rm $AZTEC_DOCKER_IMAGE bootstrap-network \ | ||
--rpc-url http://127.0.0.1:8081 \ | ||
--l1-rpc-url http://127.0.0.1:8545 \ | ||
--l1-chain-id $CHAIN_ID \ | ||
--mnemonic $MNEMONIC \ | ||
--json | tee ./basic_contracts.json | ||
aws s3 cp ./basic_contracts.json ${{ env.CONTRACT_S3_BUCKET }}/devnet/basic_contracts.json | ||
Oops, something went wrong.