Skip to content

Commit

Permalink
chore: Merge Devnet back to Master (#7611)
Browse files Browse the repository at this point in the history
This PR simply brings devnet back into master

---------

Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
Co-authored-by: Aztec Bot <49558828+AztecBot@users.noreply.github.com>
Co-authored-by: sirasistant <sirasistant@gmail.com>
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
Co-authored-by: Facundo <fcarreiro@users.noreply.github.com>
Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: Alex Gherghisan <alexg@aztecprotocol.com>
  • Loading branch information
8 people authored Jul 25, 2024
1 parent b060309 commit 112961c
Show file tree
Hide file tree
Showing 30 changed files with 1,755 additions and 62 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/devnet-deploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ env:
TF_VAR_L1_CHAIN_ID: 677692
TF_VAR_BOOTNODE_1_PRIVATE_KEY: ${{ secrets.BOOTNODE_1_PRIVATE_KEY }}
TF_VAR_BOOTNODE_2_PRIVATE_KEY: ${{ secrets.BOOTNODE_2_PRIVATE_KEY }}
TF_VAR_SEQ_1_PUBLISHER_PRIVATE_KEY: ${{ secrets.SEQ_1_PUBLISHER_PRIVATE_KEY }}
TF_VAR_SEQ_2_PUBLISHER_PRIVATE_KEY: ${{ secrets.SEQ_2_PUBLISHER_PRIVATE_KEY }}
TF_VAR_SEQUENCER_PRIVATE_KEYS: '["${{ secrets.SEQ_1_PUBLISHER_PRIVATE_KEY }}"]'
TF_VAR_NODE_P2P_PRIVATE_KEYS: '[""]'
TF_VAR_DEPLOY_TAG: devnet
TF_VAR_IMAGE_TAG: ${{ github.sha }}
TF_VAR_API_KEY: ${{ secrets.FORK_API_KEY }}
TF_VAR_FORK_MNEMONIC: ${{ secrets.FORK_MNEMONIC }}
TF_VAR_INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
TF_VAR_FAUCET_ACCOUNT_INDEX: 5
CONTRACT_S3_BUCKET: s3://aztec-${{ env.DEPLOY_TAG }}-deployments
CONTRACT_S3_BUCKET: s3://aztec-devnet-deployments

jobs:
setup:
Expand All @@ -47,11 +48,28 @@ jobs:
with:
concurrency_key: build-release-artifacts-${{ github.actor }}
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: Check if only workflow flows have changed
id: check_only_workflow_changes
uses: actions/github-script@v7
with:
script: |
const { execSync } = require('child_process');
const changedFiles = execSync('git diff --name-only ${{ github.event.before }} ${{ github.sha }}')
.toString()
.split('\n')
.filter(line => line);
const prefixesToIgnore = ['.github', 'iac'];
const suffixesToIgnore = ['.tf'];
return changedFiles.every(file => (
prefixesToIgnore.some(prefix => file.startsWith(prefix)) ||
suffixesToIgnore.some(suffix => file.endsWith(suffix))
));
- name: "Build & Push aztec images"
timeout-minutes: 40
if: steps.check_only_workflow_changes.outputs.result == 'false'
run: |
earthly-ci \
--no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }}
earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }}
earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }}
- name: Check if mainnet fork needs deployment
id: check_fork_changes
Expand Down Expand Up @@ -166,6 +184,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
fetch-depth: 0

- uses: ./.github/ci-setup-action

Expand All @@ -182,6 +201,7 @@ jobs:
- name: Deploy protocol contracts
run: |
set -e
docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }}
docker run aztecprotocol/aztec:${{ env.DEPLOY_TAG }} deploy-protocol-contracts \
--rpc-url https://api.aztec.network/${{ env.DEPLOY_TAG }}/aztec-pxe/${{ secrets.FORK_API_KEY }} \
Expand All @@ -193,6 +213,7 @@ jobs:
- name: Bootstrap devnet
run: |
set -e
docker run aztecprotocol/aztec:${{ env.DEPLOY_TAG }} bootstrap-devnet \
--rpc-url https://api.aztec.network/${{ env.DEPLOY_TAG }}/aztec-pxe/${{ secrets.FORK_API_KEY }} \
--l1-rpc-url https://${{ env.DEPLOY_TAG }}-mainnet-fork.aztec.network:8545/${{ secrets.FORK_API_KEY }} \
Expand Down Expand Up @@ -225,14 +246,15 @@ jobs:

- name: Retrieve contract addresses
run: |
set -e
aws s3 cp ${{ env.CONTRACT_S3_BUCKET }}/l1_contract_addresses.json ./l1-contract_addresses.json
aws s3 cp ${{ env.CONTRACT_S3_BUCKET }}/devnet-contracts.json ./devnet-contracts.json
echo "TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS=$(jq -r '.gasTokenAddress' ./l1-contract_addresses.json)" >>$GITHUB_ENV
echo "TF_VAR_DEV_COIN_CONTRACT_ADDRESS=$(jq -r '.devCoinL1' ./devnet-contracts.json)" >>$GITHUB_ENV
- name: Deploy Faucet
working-directory: ./yarn-project/aztec/aztec-faucet
working-directory: ./yarn-project/aztec-faucet
run: |
terraform init -input=false -backend-config="key=${{ env.DEPLOY_TAG }}/aztec-faucet"
terraform apply -input=false -auto-approve
127 changes: 127 additions & 0 deletions .github/workflows/metrics-deploys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Deploy metrics
on:
push:
branches: [devnet]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
GIT_COMMIT: ${{ github.sha }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# TF Vars
TF_VAR_DOCKERHUB_ACCOUNT: aztecprotocol
TF_VAR_GRAFANA_CLIENT_ID: ${{ secrets.GRAFANA_CLIENT_ID }}
TF_VAR_GRAFANA_CLIENT_SECRET: ${{ secrets.GRAFANA_CLIENT_SECRET }}
TF_VAR_IMAGE_TAG: ${{ github.sha }}

jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
username: master
runner_type: builder-x86
secrets: inherit
build:
needs: setup
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
fetch-depth: 0
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-metrics-${{ github.actor }}
dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}"

- name: Check if metrics have changed
id: check_metrics_changes
uses: actions/github-script@v7
with:
script: |
const { execSync } = require('child_process');
const changedFiles = execSync('git diff --name-only ${{ github.event.before }} ${{ github.sha }}').toString().split('\n');
const fileChanged = changedFiles.some(file => file.startsWith('metrics'));
return fileChanged
- name: Build & push prometheus
working-directory: ./metrics/prometheus
if: steps.check_metrics_changes.outputs.result == 'true'
run: |
docker build -t aztecprotocol/aztec-prometheus .
docker tag aztecprotocol/aztec-prometheus aztecprotocol/aztec-prometheus:$GIT_COMMIT
docker push aztecprotocol/aztec-prometheus
docker push aztecprotocol/aztec-prometheus:$GIT_COMMIT
- name: Build & push grafana
working-directory: ./metrics/grafana
if: steps.check_metrics_changes.outputs.result == 'true'
run: |
docker build -t aztecprotocol/aztec-grafana .
docker tag aztecprotocol/aztec-grafana aztecprotocol/aztec-grafana:$GIT_COMMIT
docker push aztecprotocol/aztec-grafana
docker push aztecprotocol/aztec-grafana:$GIT_COMMIT
- name: Build & push open telemetry
working-directory: ./metrics/otel
if: steps.check_metrics_changes.outputs.result == 'true'
run: |
docker build -t aztecprotocol/aztec-otel .
docker tag aztecprotocol/aztec-otel aztecprotocol/aztec-otel:$GIT_COMMIT
docker push aztecprotocol/aztec-otel
docker push aztecprotocol/aztec-otel:$GIT_COMMIT
terraform_deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
fetch-depth: 0
- uses: ./.github/ci-setup-action
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.7.5

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2

- name: Check if metrics have changed
id: check_metrics_changes
uses: actions/github-script@v7
with:
script: |
const { execSync } = require('child_process');
const changedFiles = execSync('git diff --name-only ${{ github.event.before }} ${{ github.sha }}').toString().split('\n');
const fileChanged = changedFiles.some(file => file.startsWith('metrics'));
return fileChanged
- name: Deploy prometheus
working-directory: ./metrics/prometheus/terraform
if: steps.check_metrics_changes.outputs.result == 'true'
run: |
terraform init -input=false -backend-config="key=aztec-prometheus"
terraform apply -input=false -auto-approve
- name: Deploy grafana
working-directory: ./metrics/grafana/terraform
if: steps.check_metrics_changes.outputs.result == 'true'
run: |
terraform init -input=false -backend-config="key=aztec-grafana"
terraform apply -input=false -auto-approve
- name: Deploy open telemetry
working-directory: ./metrics/otel/terraform
if: steps.check_metrics_changes.outputs.result == 'true'
run: |
terraform init -input=false -backend-config="key=aztec-otel"
terraform apply -input=false -auto-approve
12 changes: 6 additions & 6 deletions barretenberg/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme
;
[subrepo]
remote = https://github.com/AztecProtocol/barretenberg
branch = master
commit = f5b9be0eb29d7d1a7f202cb075f892552ab151c5
parent = 840486e5ce6b41d6c873239de108b3731dd81101
method = merge
cmdver = 0.4.6
remote = https://github.com/AztecProtocol/barretenberg
branch = master
commit = f5b9be0eb29d7d1a7f202cb075f892552ab151c5
parent = 840486e5ce6b41d6c873239de108b3731dd81101
method = merge
cmdver = 0.4.6
4 changes: 4 additions & 0 deletions metrics/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM grafana/grafana:9.3.2
COPY grafana.ini /etc/grafana/grafana.ini
USER root
EXPOSE 80
Loading

0 comments on commit 112961c

Please sign in to comment.