Skip to content

Commit ed0f0c0

Browse files
authored
Merge branch 'next' into ad/misc-kind-fixups
2 parents 037c88b + 6be0df0 commit ed0f0c0

File tree

10 files changed

+696
-75
lines changed

10 files changed

+696
-75
lines changed

.github/workflows/ci3.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ jobs:
120120
# End-to-end tests that target a network deployment.
121121
# We run this every release (at minimum, nightly), or when explicitly requested.
122122
# This task runs against a real testnet deployment. This uses resources on GCP (not AWS, thank free credit incentives).
123+
# Runs two test sets in parallel.
123124
ci-network-scenario:
124125
runs-on: ubuntu-latest
125-
timeout-minutes: 540
126126
# We either run after a release (tag starting with v), or when the ci-network-scenario label is present in a PR.
127127
# We exclude ci-release-pr test tags (v0.0.1-commit.*) which are only for testing the release process.
128128
needs: ci
@@ -133,7 +133,7 @@ jobs:
133133
with:
134134
ref: ${{ github.event.pull_request.head.sha || github.sha }}
135135

136-
- name: Run Network Deploy
136+
- name: Run Network Scenarios
137137
env:
138138
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
139139
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -146,7 +146,7 @@ jobs:
146146
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
147147
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
148148
RUN_ID: ${{ github.run_id }}
149-
AWS_SHUTDOWN_TIME: 540 # temporarily increased to 9 hours, todo(revert to 360)
149+
AWS_SHUTDOWN_TIME: 360
150150
NO_SPOT: 1
151151
run: |
152152
# For release tags, use the release image; for PRs, omit to build and push to aztecdev
@@ -163,7 +163,7 @@ jobs:
163163
docker_image=""
164164
fi
165165
set -x # print next line
166-
./.github/ci3.sh network-deploy next-scenario "$namespace" "$docker_image"
166+
./.github/ci3.sh network-scenarios next-scenario "$namespace" "$docker_image"
167167
168168
- name: Cleanup network resources
169169
# Clean up if this is a CI label or nightly.
@@ -176,7 +176,9 @@ jobs:
176176
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
177177
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
178178
NO_SPOT: 1
179-
run: ./.github/ci3.sh network-teardown next-scenario "$NAMESPACE"
179+
run: |
180+
./.github/ci3.sh network-teardown next-scenario "${NAMESPACE}-1" || true
181+
./.github/ci3.sh network-teardown next-scenario "${NAMESPACE}-2" || true
180182
181183
#############
182184
# Benchmarks

.github/workflows/test-network-scenarios.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# CI for Aztec Network Scenarios.
22
# Manually triggered to deploy and test a network.
3+
# If test_set is empty, runs both sets in parallel.
34
name: Test Network Scenarios
45

56
on:
@@ -18,6 +19,11 @@ on:
1819
required: false
1920
type: string
2021
default: next-scenario
22+
test_set:
23+
description: Test set to run (1, 2, or empty for both in parallel)
24+
required: false
25+
type: string
26+
default: ""
2127

2228
concurrency:
2329
group: test-network-scenarios-${{ inputs.namespace }}
@@ -26,12 +32,12 @@ concurrency:
2632
jobs:
2733
deploy-and-test:
2834
runs-on: ubuntu-latest
29-
timeout-minutes: 540
35+
timeout-minutes: 360
3036
steps:
3137
- name: Checkout
3238
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3339

34-
- name: Run
40+
- name: Run Network Scenarios
3541
env:
3642
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
3743
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -44,4 +50,25 @@ jobs:
4450
NO_SPOT: 1
4551
run: |
4652
namespace=$(echo "${{ inputs.namespace }}" | sed 's/[^a-z0-9-]/-/g' | cut -c1-20)
47-
./.github/ci3.sh network-deploy "${{ inputs.env_file }}" "$namespace" "${{ inputs.docker_image }}"
53+
echo "NAMESPACE=$namespace" >> $GITHUB_ENV
54+
# Run scenario tests (both sets in parallel, or specific set if provided)
55+
./.github/ci3.sh network-scenarios "${{ inputs.env_file }}" "$namespace" "${{ inputs.docker_image }}" "${{ inputs.test_set }}"
56+
57+
- name: Cleanup network resources
58+
if: always()
59+
env:
60+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
61+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
62+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
63+
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
64+
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
65+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
66+
NO_SPOT: 1
67+
run: |
68+
test_set="${{ inputs.test_set }}"
69+
if [[ -z "$test_set" ]]; then
70+
./.github/ci3.sh network-teardown "${{ inputs.env_file }}" "${NAMESPACE}-1" || true
71+
./.github/ci3.sh network-teardown "${{ inputs.env_file }}" "${NAMESPACE}-2" || true
72+
else
73+
./.github/ci3.sh network-teardown "${{ inputs.env_file }}" "${NAMESPACE}-${test_set}" || true
74+
fi

bootstrap.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,12 @@ case "$cmd" in
595595
# NETWORK DEPLOYMENTS WITH BENCHES/TESTS #
596596
##########################################
597597
"ci-network-deploy")
598-
# Args: <env_file> <namespace> [docker_image]
598+
# Args: <env_file> <namespace> [docker_image] [test_set]
599599
export CI=1
600600
env_file="${1:?env_file is required}"
601601
namespace="${2:?namespace is required}"
602602
docker_image="${3:-}"
603+
test_set="${4:-}"
603604
build
604605
# If no docker image provided, build and push to aztecdev
605606
if [ -z "$docker_image" ]; then
@@ -610,7 +611,7 @@ case "$cmd" in
610611
export NAMESPACE="$namespace"
611612
export AZTEC_DOCKER_IMAGE="$docker_image"
612613
deploy_exit_code=0
613-
spartan/bootstrap.sh network_deploy "${env_file}" || deploy_exit_code=$?
614+
spartan/bootstrap.sh network_deploy "${env_file}" "$test_set" || deploy_exit_code=$?
614615
# Merge and upload deploy benchmarks (deploy_network.sh writes to spartan/bench-out/)
615616
rm -rf bench-out
616617
mkdir -p bench-out

ci.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function print_usage {
2727
echo_cmd "grind" "Spin up multiple EC2 instances to run parallel full CI runs."
2828
echo_cmd "merge-queue" "Spin up several EC2 instances to run the merge-queue jobs."
2929
echo_cmd "network-deploy" "Spin up an EC2 instance to deploy a network."
30+
echo_cmd "network-scenarios" "Spin up EC2 instance(s) to run network scenario tests in parallel."
3031
echo_cmd "network-tests" "Spin up an EC2 instance to run tests on a network."
3132
echo_cmd "network-bench" "Spin up an EC2 instance to run benchmarks on a network."
3233
echo_cmd "network-teardown" "Spin up an EC2 instance to teardown a network deployment."
@@ -117,6 +118,29 @@ case "$cmd" in
117118
##########################################
118119
# NETWORK DEPLOYMENTS WITH BENCHES/TESTS #
119120
##########################################
121+
network-scenarios)
122+
# Args: <scenario> <namespace> [docker_image] [test_set]
123+
# If test_set provided, run just that set. Otherwise run both in parallel.
124+
scenario="${1:?scenario is required}"
125+
namespace="${2:?namespace is required}"
126+
docker_image="${3:-}"
127+
test_set="${4:-}"
128+
129+
export CI_DASHBOARD="network"
130+
run() {
131+
local set=$1
132+
JOB_ID="x-${namespace}-${set}" INSTANCE_POSTFIX="n-deploy-${set}" \
133+
bootstrap_ec2 "./bootstrap.sh ci-network-deploy $scenario ${namespace}-${set} \"$docker_image\" $set"
134+
}
135+
export -f run
136+
export scenario namespace docker_image
137+
138+
if [[ -n "$test_set" ]]; then
139+
run "$test_set"
140+
else
141+
parallel --jobs 2 --line-buffered ::: 'run 1' 'run 2'
142+
fi
143+
;;
120144
network-deploy)
121145
# Args: <scenario> <namespace> [docker_image]
122146
# If docker_image is not provided, ci-network-deploy will build and push to aztecdev.

0 commit comments

Comments
 (0)