Skip to content

Commit

Permalink
fixup! wip: basic test for peerpods
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Nov 15, 2024
1 parent 0aa7546 commit 729ba9a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/e2e_peerpods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: e2e peer-pods

on:
workflow_dispatch:
inputs:
image-id:
description: "ID of the guest VM image to test (default: build a fresh image)"
required: false
pull_request:

jobs:
Expand All @@ -23,11 +27,11 @@ jobs:
azure_tenant_id: ${{ vars.AZURE_TENANT_ID }}
azure_client_id: ${{ vars.PEER_POD_CLIENT_ID_AZURE }}
azure_client_secret: ${{ secrets.PEER_POD_CLIENT_SECRET_AZURE }}
azure_image_id: ${{ inputs.image-id }}
azure_resource_group: contrast-ci
azure_location: germanywestcentral
CONTRAST_CACHE_DIR: "./workspace.cache"
run: |
export azure_resource_group=contrast-ci
export azure_location=germanywestcentral
export CONTRAST_CACHE_DIR="./workspace.cache"
ssh-keygen -t rsa -f ./infra/azure-peerpods/id_rsa -N ""
nix run .#scripts.test-peerpods
- name: Terminate cluster
Expand Down
25 changes: 16 additions & 9 deletions packages/test-peerpods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@

set -euo pipefail

# TODO(burgerdev): re-enable image upload once rest is working
true || nix run -L .#scripts.upload-image -- \
--subscription-id="${azure_subscription_id:?}" \
--location="${azure_location:?}" \
--resource-group="${azure_resource_group:?}"
image_id=/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/contrast-ci/providers/Microsoft.Compute/galleries/contrast_ci_contrast/images/contrast/versions/0.0.1730981348
echo "image_id = \"${image_id}\"" > infra/azure-peerpods/image_id.auto.tfvars
set -x

if [ -z "${azure_image_id}" ]; then
# TODO(burgerdev): re-enable image upload once rest is working
true || nix run -L .#scripts.upload-image -- \
--subscription-id="${azure_subscription_id:?}" \
--location="${azure_location:?}" \
--resource-group="${azure_resource_group:?}"
echo 'image_id = "/subscriptions/0d202bbb-4fa7-4af8-8125-58c269a05435/resourceGroups/contrast-ci/providers/Microsoft.Compute/galleries/contrast_ci_contrast/images/contrast/versions/0.0.1730981348"' > infra/azure-peerpods/image_id.auto.tfvars
else
echo "image_id = \"${azure_image_id}\"" > infra/azure-peerpods/image_id.auto.tfvars
fi


cat >infra/azure-peerpods/testrun.auto.tfvars <<EOF
name_prefix = "${azure_resource_group:?}"
name_prefix = "${azure_resource_group:?}-$RANDOM"
resource_group = "${azure_resource_group:?}"
subscription_id = "${azure_subscription_id:?}"
tenant_id = "${azure_tenant_id:?}"
Expand All @@ -28,7 +34,8 @@ just get-credentials AKS-PEER-SNP
just node-installer AKS-PEER-SNP

cleanup() {
kubectl delete deploy nginx --timeout=0s --wait=true
kubectl delete deploy nginx
kubectl wait --for=delete pod --selector=app=nginx --timeout=5m
}

trap cleanup EXIT
Expand Down

0 comments on commit 729ba9a

Please sign in to comment.