-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: test release network via ci workflow #10388
Merged
just-mitch
merged 18 commits into
master
from
10247-feat-test-release-network-via-ci-workflow
Dec 3, 2024
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2131215
test live network
just-mitch d9bb8ec
fix command
just-mitch 2ba398d
correct the instance name
just-mitch cfa1622
install gke auth plugin
just-mitch 1a34b48
set up kubectl within the container
just-mitch 6e282e5
update gcloud install
just-mitch ad3473f
pass in gcloud config
just-mitch 66b756e
swap default image
just-mitch 1843422
rerun with debug
just-mitch 3e76189
try to copy correct gcloud config dir
just-mitch ef652b6
try to do the install just before
just-mitch 3f7d9f3
try different image
just-mitch bebc9d4
try set project ID
just-mitch 4ded237
try old image once more
just-mitch e4ca85e
allow gcloud specific environment setup in spartan tests
just-mitch 5c07fe3
try with new config
just-mitch 4544d64
clean up workflow
just-mitch a35e870
minor cleanup
just-mitch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was disappointed by this: I would've thought copying in the gcloud and kube configs would've sufficed; indeed, it does locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's a permissions thing, like
~/.ssh
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be the file owner not being the same user id as in docker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm those are good ideas. The thing about it is that when I said it works locally, I meant I ran the test container locally as it does in the workflow and I didn't need to do this explicit
get-credentials
; it does seems that some permissions aren't getting setup/passed correctly when the test container runs from CI. The other oddity is that the kube config gets mounted in the same way and doesn't appear to have a problem.But not worth futzing with now I'm afraid. Thanks to you both for having a look!