Perf tests on EKS #98
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: "Perf tests on EKS" | |
on: | |
schedule: | |
- cron: "0 0 * * 1-5" | |
workflow_dispatch: | |
inputs: | |
mesh_version: | |
description: "Mesh version, if not specified, then version is the latest commit from kong/kong-mesh@master" | |
type: string | |
num_services: | |
description: "Number of services to run during testing" | |
required: true | |
type: number | |
instances_per_service: | |
description: "Number of instances per service to run during testing" | |
required: true | |
type: number | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
perf-test: | |
runs-on: ubuntu-latest | |
env: | |
PERF_TEST_NUM_SERVICES: ${{ inputs.num_services || 1000 }} | |
PERF_TEST_INSTANCES_PER_SERVICE: ${{ inputs.instances_per_service || 2}} | |
PERF_TEST_MESH_VERSION: ${{ inputs.mesh_version }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/mesh-perf-ci | |
role-duration-seconds: 7200 | |
aws-region: us-west-1 | |
- name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: make dev/tools | |
run: make dev/tools | |
- name: Calculate number of nodes for cluster | |
run: | |
echo "EKS_NUM_OF_NODES=$(make number-of-nodes)" >> $GITHUB_ENV | |
- name: Start cluster | |
run: ENV=eks make start-cluster | |
- name: Export Terraform outputs | |
env: | |
ENV: eks | |
run: | | |
echo "AWS_REGION=$(make ecr-get-region)" >> $GITHUB_ENV | |
echo "ALTERNATIVE_CONTAINER_REGISTRY=$(make ecr-get-registry)" >> $GITHUB_ENV | |
- name: Configure kubectl | |
run: aws eks --region $AWS_REGION update-kubeconfig --name mesh-perf | |
- name: Upload images to ECR | |
run: make ecr-push | |
- name: Run tests | |
env: | |
PERF_TEST_STABILIZATION_SLEEP: 30s | |
KMESH_LICENSE_JSON: | | |
${{ secrets.KMESH_LICENSE_JSON }} | |
run: | | |
KMESH_LICENSE=<(printenv KMESH_LICENSE_JSON) make run | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: test-metrics-snapshot | |
path: /tmp/prom-snapshots | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: test-reports | |
path: /tmp/perf-test-reports | |
- name: submit logs to Datadog | |
if: always() | |
env: | |
DD_API_KEY: ${{ secrets.DD_API_KEY }} | |
DD_APP_KEY: ${{ secrets.DD_APP_KEY }} | |
run: | | |
go run ./tools/reports/main.go /tmp/perf-test-reports/* | |
- name: Destroy cluster | |
if: always() | |
run: ENV=eks make destroy-cluster |