E2E #118
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
name: E2E | |
on: | |
workflow_dispatch: | |
inputs: | |
git_ref: | |
type: string | |
region: | |
type: choice | |
options: | |
- "us-east-1" | |
- "us-east-2" | |
- "us-west-2" | |
- "eu-west-1" | |
default: "us-east-2" | |
suite: | |
type: choice | |
required: true | |
options: | |
- Beta/Integration | |
- Beta/NodeClaim | |
- Beta/Consolidation | |
- Beta/Interruption | |
- Beta/Drift | |
- Beta/Expiration | |
- Beta/Chaos | |
- Beta/IPv6 | |
- Beta/Scale | |
- Alpha/Integration | |
- Alpha/Machine | |
- Alpha/Consolidation | |
- Alpha/Utilization | |
- Alpha/Interruption | |
- Alpha/Drift | |
- Alpha/Expiration | |
- Alpha/Chaos | |
- Alpha/IPv6 | |
- Alpha/Scale | |
k8s_version: | |
type: choice | |
options: | |
- "1.23" | |
- "1.24" | |
- "1.25" | |
- "1.26" | |
- "1.27" | |
- "1.28" | |
default: "1.28" | |
enable_metrics: | |
type: boolean | |
default: false | |
cleanup: | |
type: boolean | |
required: true | |
default: true | |
workflow_call: | |
inputs: | |
git_ref: | |
type: string | |
region: | |
type: string | |
default: "us-east-2" | |
suite: | |
type: string | |
required: true | |
k8s_version: | |
type: string | |
default: "1.28" | |
enable_metrics: | |
type: boolean | |
default: false | |
cleanup: | |
type: boolean | |
required: true | |
workflow_trigger: | |
type: string | |
secrets: | |
SLACK_WEBHOOK_URL: | |
required: true | |
permissions: | |
id-token: write # aws-actions/[email protected] | |
statuses: write # ./.github/actions/commit-status/start | |
jobs: | |
run-suite: | |
name: suite-${{ inputs.suite }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.git_ref }} | |
- if: always() && github.event_name == 'workflow_run' | |
uses: ./.github/actions/commit-status/start | |
with: | |
name: ${{ github.workflow }} (${{ inputs.k8s_version }}) / e2e (${{ inputs.suite }}) | |
git_ref: ${{ inputs.git_ref }} | |
- uses: ./.github/actions/install-deps | |
- name: configure aws credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: arn:aws:iam::${{ vars.ACCOUNT_ID }}:role/${{ vars.ROLE_NAME }} | |
aws-region: ${{ inputs.region }} | |
role-duration-seconds: 21600 | |
- name: add jitter on cluster creation | |
run: | | |
# Creating jitter so that we can stagger cluster creation to avoid throttling | |
sleep $(( RANDOM % 300 + 1 )) | |
- id: generate-cluster-name | |
run: | | |
CLUSTER_NAME="$(echo ${{ inputs.suite }}-"$RANDOM$RANDOM" | awk '{print tolower($0)}' | tr / -)" | |
echo Using cluster name "$CLUSTER_NAME" | |
echo CLUSTER_NAME="$CLUSTER_NAME" >> "$GITHUB_OUTPUT" | |
- name: create eks cluster '${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }}' | |
uses: ./.github/actions/e2e/create-cluster | |
with: | |
account_id: ${{ vars.ACCOUNT_ID }} | |
role: ${{ vars.ROLE_NAME }} | |
region: ${{ inputs.region }} | |
cluster_name: ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }} | |
k8s_version: ${{ inputs.k8s_version }} | |
eksctl_version: v0.164.0 | |
ip_family: ${{ contains(inputs.suite, 'IPv6') && 'IPv6' || 'IPv4' }} # Set the value to IPv6 if IPv6 suite, else IPv4 | |
git_ref: ${{ inputs.git_ref }} | |
- name: install prometheus | |
uses: ./.github/actions/e2e/install-prometheus | |
with: | |
account_id: ${{ vars.ACCOUNT_ID }} | |
role: ${{ vars.ROLE_NAME }} | |
region: ${{ vars.PROMETHEUS_REGION }} | |
cluster_name: ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }} | |
workspace_id: ${{ vars.WORKSPACE_ID }} | |
git_ref: ${{ inputs.git_ref }} | |
- name: install karpenter | |
uses: ./.github/actions/e2e/install-karpenter | |
with: | |
account_id: ${{ vars.ACCOUNT_ID }} | |
role: ${{ vars.ROLE_NAME }} | |
region: ${{ inputs.region }} | |
ecr_account_id: ${{ vars.ECR_ACCOUNT_ID }} | |
ecr_region: ${{ vars.ECR_REGION }} | |
cluster_name: ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }} | |
git_ref: ${{ inputs.git_ref }} | |
- name: run the ${{ inputs.suite }} test suite | |
run: | | |
aws eks update-kubeconfig --name ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }} | |
TEST_SUITE="${{ inputs.suite }}" ENABLE_METRICS=${{ inputs.enable_metrics }} METRICS_REGION=${{ vars.TIMESTREAM_REGION }} GIT_REF="$(git rev-parse HEAD)" \ | |
CLUSTER_NAME="${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }}" CLUSTER_ENDPOINT="$(aws eks describe-cluster --name ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }} --query "cluster.endpoint" --output text)" \ | |
INTERRUPTION_QUEUE="${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }}" make e2etests | |
- name: notify slack of success or failure | |
uses: ./.github/actions/e2e/slack/notify | |
if: (success() || failure()) && github.event_name != 'workflow_run' && inputs.workflow_trigger != 'versionCompatibility' | |
with: | |
url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
suite: ${{ inputs.suite }} | |
k8s_version: ${{ inputs.k8s_version }} | |
git_ref: ${{ inputs.git_ref }} | |
- name: dump logs on failure | |
uses: ./.github/actions/e2e/dump-logs | |
if: failure() || cancelled() | |
with: | |
account_id: ${{ vars.ACCOUNT_ID }} | |
role: ${{ vars.ROLE_NAME }} | |
region: ${{ inputs.region }} | |
cluster_name: ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }} | |
- name: cleanup karpenter and cluster '${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }}' resources | |
uses: ./.github/actions/e2e/cleanup | |
if: always() && inputs.cleanup | |
with: | |
account_id: ${{ vars.ACCOUNT_ID }} | |
role: ${{ vars.ROLE_NAME }} | |
region: ${{ inputs.region }} | |
cluster_name: ${{ steps.generate-cluster-name.outputs.CLUSTER_NAME }} | |
git_ref: ${{ inputs.git_ref }} | |
eksctl_version: v0.164.0 | |
- if: always() && github.event_name == 'workflow_run' | |
uses: ./.github/actions/commit-status/end | |
with: | |
name: ${{ github.workflow }} (${{ inputs.k8s_version }}) / e2e (${{ inputs.suite }}) | |
git_ref: ${{ inputs.git_ref }} |