-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge Devnet back to Master (#7611)
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
1 parent
b060309
commit 112961c
Showing
30 changed files
with
1,755 additions
and
62 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
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,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 |
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
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,4 @@ | ||
FROM grafana/grafana:9.3.2 | ||
COPY grafana.ini /etc/grafana/grafana.ini | ||
USER root | ||
EXPOSE 80 |
Oops, something went wrong.