-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: test release network via ci workflow (#10388)
New workflow to run an arbitrary test on an arbitrary namespace (within our aztec-gke cluster) with an arbitrary e2e image. I tested this with a temporary `on: push` flag. See successful run [here](https://github.com/AztecProtocol/aztec-packages/actions/runs/12148432809/job/33876880156) using smoke test with a locally built image against the smoke cluster. Also tweak our release to also publish our `end-to-end` image so it can be used by this workflow more easily. Fix #10247 Fix #10383
- Loading branch information
1 parent
93cd323
commit e6060ec
Showing
11 changed files
with
146 additions
and
26 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,86 @@ | ||
name: Aztec Network Test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
namespace: | ||
description: The namespace to deploy to, e.g. smoke | ||
required: true | ||
test: | ||
description: The test to run, e.g. spartan/smoke.test.ts | ||
required: true | ||
aztec_e2e_docker_image: | ||
description: The Aztec E2E Docker image to use, e.g. aztecprotocol/end-to-end:da809c58290f9590836f45ec59376cbf04d3c4ce-x86_64 | ||
required: true | ||
|
||
jobs: | ||
network_test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
TEST_DOCKER_IMAGE: ${{ inputs.aztec_e2e_docker_image }} | ||
NAMESPACE: ${{ inputs.namespace }} | ||
TEST: ${{ inputs.test }} | ||
CHART_PATH: ./spartan/aztec-network | ||
CLUSTER_NAME: aztec-gke | ||
REGION: us-west1-a | ||
PROJECT_ID: testnet-440309 | ||
GKE_CLUSTER_CONTEXT: gke_testnet-440309_us-west1-a_aztec-gke | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- 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 | ||
with: | ||
install_components: gke-gcloud-auth-plugin | ||
|
||
- name: Configure kubectl with GKE cluster | ||
run: | | ||
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --region ${{ env.REGION }} | ||
- name: Run test | ||
run: | | ||
# Find 3 free ports between 9000 and 10000 | ||
FREE_PORTS=$(comm -23 <(seq 9000 10000 | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 3) | ||
# Extract the free ports from the list | ||
PXE_PORT=$(echo $FREE_PORTS | awk '{print $1}') | ||
ANVIL_PORT=$(echo $FREE_PORTS | awk '{print $2}') | ||
METRICS_PORT=$(echo $FREE_PORTS | awk '{print $3}') | ||
export GRAFANA_PASSWORD=$(kubectl get secrets -n metrics metrics-grafana -o jsonpath='{.data.admin-password}' | base64 --decode) | ||
gcloud config set project ${{ env.PROJECT_ID }} | ||
GCLOUD_CONFIG_DIR=$(gcloud info --format='value(config. paths. global_config_dir)') | ||
echo "gcloud config dir: [$GCLOUD_CONFIG_DIR]" | ||
docker run --rm --network=host \ | ||
-v ~/.kube:/root/.kube \ | ||
-v $GCLOUD_CONFIG_DIR:/root/.config/gcloud \ | ||
-e K8S=gcloud \ | ||
-e CLUSTER_NAME=${{ env.CLUSTER_NAME }} \ | ||
-e REGION=${{ env.REGION }} \ | ||
-e INSTANCE_NAME=${{ env.NAMESPACE }} \ | ||
-e SPARTAN_DIR="/usr/src/spartan" \ | ||
-e NAMESPACE=${{ env.NAMESPACE }} \ | ||
-e HOST_PXE_PORT=$PXE_PORT \ | ||
-e CONTAINER_PXE_PORT=8081 \ | ||
-e HOST_ETHEREUM_PORT=$ANVIL_PORT \ | ||
-e CONTAINER_ETHEREUM_PORT=8545 \ | ||
-e HOST_METRICS_PORT=$METRICS_PORT \ | ||
-e CONTAINER_METRICS_PORT=80 \ | ||
-e GRAFANA_PASSWORD=$GRAFANA_PASSWORD \ | ||
-e DEBUG="aztec:*" \ | ||
-e LOG_JSON=1 \ | ||
-e LOG_LEVEL=debug \ | ||
${{ env.TEST_DOCKER_IMAGE }} ${{ env.TEST }} |
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
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
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
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
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