Skip to content
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

test(e2e): add location option to the e2e pipeline #37

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/actions/e2e/create-acr/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
git_ref:
description: "The git commit, tag, or branch to check out"
required: false
location:
type: string
description: "the azure location to run the e2e test in"
default: "westus2"
runs:
using: "composite"
steps:
Expand All @@ -36,4 +40,4 @@ runs:
run: az account set --subscription ${{ inputs.subscription-id }}
- name: create ACR
shell: bash
run: AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} AZURE_ACR_NAME=${{ inputs.acr_name }} make az-mkacr
run: AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} AZURE_ACR_NAME=${{ inputs.acr_name }} AZURE_LOCATION=${{ inputs.location }} make az-mkacr
11 changes: 6 additions & 5 deletions .github/actions/e2e/create-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ inputs:
subscription-id:
description:
required: true
# region:
# description: "Region to create aks cluster"
# required: true
resource_group:
description: "Name of the resource group to create the cluster within"
required: true
Expand All @@ -29,6 +26,10 @@ inputs:
git_ref:
description: "The git commit, tag, or branch to check out"
required: false
location:
type: string
description: "the azure location to run the e2e test in"
default: "westus2"
runs:
using: "composite"
steps:
Expand All @@ -46,7 +47,7 @@ runs:
run: az account set --subscription ${{ inputs.subscription-id }}
- name: create cluster
shell: bash
run: AZURE_CLUSTER_NAME=${{ inputs.cluster_name }} AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} AZURE_ACR_NAME=${{ inputs.acr_name }} make az-mkaks-cilium
run: AZURE_CLUSTER_NAME=${{ inputs.cluster_name }} AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} AZURE_ACR_NAME=${{ inputs.acr_name }} AZURE_LOCATION=${{ inputs.location }} make az-mkaks-cilium
- name: az login 2
uses: azure/login@v1
with:
Expand All @@ -55,4 +56,4 @@ runs:
subscription-id: ${{ inputs.subscription-id }}
- name: update azure perms
shell: bash
run: AZURE_CLUSTER_NAME=${{ inputs.cluster_name }} AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} make az-perm
run: AZURE_CLUSTER_NAME=${{ inputs.cluster_name }} AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} AZURE_LOCATION=${{ inputs.location }} make az-perm
6 changes: 5 additions & 1 deletion .github/actions/e2e/install-karpenter/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ inputs:
git_ref:
description: "The git commit, tag, or branch to check out"
required: false
location:
type: string
description: "the azure location to run the e2e test in"
default: "westus2"
runs:
using: "composite"
steps:
Expand All @@ -42,7 +46,7 @@ runs:
run: az account set --subscription ${{ inputs.subscription-id }}
- name: patch skaffold and cilium
shell: bash
run: AZURE_CLUSTER_NAME=${{ inputs.cluster_name }} AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} make az-patch-skaffold-azureoverlay
run: AZURE_CLUSTER_NAME=${{ inputs.cluster_name }} AZURE_RESOURCE_GROUP=${{ inputs.resource_group }} AZURE_LOCATION=${{ inputs.location }} make az-patch-skaffold-azureoverlay
- name: deploy karpenter to cluster
shell: bash
run: AZURE_ACR_NAME=${{ inputs.acr_name }} make az-run
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/e2e-matrix-trigger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: E2EMatrixTrigger
on:
workflow_dispatch:
inputs:
location:
type: string
description: "the azure location to run the e2e test in"
default: "westus2"
push:
branches: [main]
workflow_run:
Expand All @@ -19,6 +24,7 @@ jobs:
uses: ./.github/workflows/e2e-matrix.yaml
with:
git_ref: ${{ needs.resolve.outputs.GIT_REF }}
location: ${{ inputs.location || 'westus2' }}
secrets:
E2E_CLIENT_ID: ${{ secrets.E2E_CLIENT_ID }}
E2E_TENANT_ID: ${{ secrets.E2E_TENANT_ID }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/e2e-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
inputs:
git_ref:
type: string
# region:
# type: string
# default: "us-east-2"
location:
type: string
description: "the azure location to run the e2e test in"
default: "westus2"
# k8s_version:
# type: string
# default: "1.27"
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
git_ref: ${{ inputs.git_ref }}
suite: ${{ matrix.suite }}
hash: ${{ needs.initialize-generative-params.outputs.E2E_HASH }}
# region: ${{ inputs.region }}
location: ${{ inputs.location }}
# k8s_version: ${{ inputs.k8s_version }}
secrets:
E2E_CLIENT_ID: ${{ secrets.E2E_CLIENT_ID }}
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: E2E
on:
workflow_call:
inputs:
# region:
# type: string
# default: "us-east-2"
git_ref:
type: string
suite:
Expand All @@ -13,6 +10,10 @@ on:
hash:
type: string
required: true
location:
type: string
description: "the azure location to run the e2e test in"
default: "westus2"
# k8s_version:
# type: string
# default: "1.27"
Expand Down Expand Up @@ -75,6 +76,7 @@ jobs:
resource_group: ${{ env.RG_NAME }}
acr_name: ${{ env.ACR_NAME }}
git_ref: ${{ inputs.git_ref }}
location: ${{ inputs.location }}
- name: add jitter on cluster creation
run: |
# Creating jitter so that we can stagger cluster creation to avoid throttling
Expand All @@ -90,11 +92,11 @@ jobs:
client-id: ${{ secrets.E2E_CLIENT_ID }}
tenant-id: ${{ secrets.E2E_TENANT_ID }}
subscription-id: ${{ secrets.E2E_SUBSCRIPTION_ID }}
# region: westus2
resource_group: ${{ env.RG_NAME }}
cluster_name: ${{ env.CLUSTER_NAME }}
acr_name: ${{ env.ACR_NAME }}
git_ref: ${{ inputs.git_ref }}
location: ${{ inputs.location }}
- name: build and publish karpenter
shell: bash
run: AZURE_ACR_NAME=${{ env.ACR_NAME }} make az-build
Expand All @@ -108,6 +110,7 @@ jobs:
cluster_name: ${{ env.CLUSTER_NAME }}
acr_name: ${{ env.ACR_NAME }}
git_ref: ${{ inputs.git_ref }}
location: ${{ inputs.location }}
- name: run the ${{ inputs.suite }} test suite
if: inputs.suite != 'Nonbehavioral'
run: |
Expand All @@ -130,7 +133,6 @@ jobs:
client-id: ${{ secrets.E2E_CLIENT_ID }}
tenant-id: ${{ secrets.E2E_TENANT_ID }}
subscription-id: ${{ secrets.E2E_SUBSCRIPTION_ID }}
# region: westus2
resource_group: ${{ env.RG_NAME }}
cluster_name: ${{ env.CLUSTER_NAME }}
acr_name: ${{ env.ACR_NAME }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile-az.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ az-mkacr: az-mkrg ## Create test ACR
az acr login --name $(AZURE_ACR_NAME)

az-mkaks: az-mkacr ## Create test AKS cluster (with --vm-set-type AvailabilitySet for compatibility with standalone VMs)
az aks create --name $(AZURE_CLUSTER_NAME) --resource-group $(AZURE_RESOURCE_GROUP) --attach-acr $(AZURE_ACR_NAME) \
az aks create --name $(AZURE_CLUSTER_NAME) --resource-group $(AZURE_RESOURCE_GROUP) --attach-acr $(AZURE_ACR_NAME) --location $(AZURE_LOCATION) \
--enable-managed-identity --node-count 3 --generate-ssh-keys --vm-set-type AvailabilitySet -o none
az aks get-credentials --name $(AZURE_CLUSTER_NAME) --resource-group $(AZURE_RESOURCE_GROUP) --overwrite-existing
skaffold config set default-repo $(AZURE_ACR_NAME).azurecr.io/karpenter
Expand Down
Loading