Skip to content

Commit

Permalink
store benchmark results in s3
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Volodkin committed Nov 28, 2023
1 parent efe47a8 commit 5dfe745
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_NAME: ${{ env.TMP_IMAGE_NAME }}
run: |
BRANCH_OR_TAG=$(echo $GITHUB_REF | cut -d'/' -f3)
export PLATFORM=linux/amd64,linux/arm64
export TAG=${{ env.COMMIT_ID }}
make -j `nproc` all-push
Expand Down Expand Up @@ -121,16 +120,6 @@ jobs:
export TAG=${{ env.COMMIT_ID }}
export ARCH=${{ matrix.arch }}
tests/e2e-kubernetes/scripts/run.sh
- name: Run Performance Tests
# todo, add: (startsWith(github.ref_name, 'main')
if: ${{ matrix.cluster-type == 'kops' && matrix.arch == 'x86' }}
run: |
export ACTION=run_perf
export AWS_REGION=${{ env.AWS_REGION }}
export CLUSTER_TYPE=${{ matrix.cluster-type }}
export TAG=${{ env.COMMIT_ID }}
export ARCH=${{ matrix.arch }}
tests/e2e-kubernetes/scripts/run.sh
- name: Post e2e cleanup
if: always()
run: |
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/performance-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Performance Tests

on:
push:
branches: [ "main", "bench" ]
paths:
- 'tests/**'
- 'pkg/**'
- 'cmd/**'
- 'charts/**'
- '.github/workflows/**'
- 'Dockerfile'

concurrency: performance-cluster
env:
AWS_REGION : "us-east-1"
COMMIT_ID: ${{ github.sha }}
TMP_IMAGE_NAME: "s3-csi-driver-tmp"
BENCHMARK_RESULTS_PATH: "s3://mountpoint-s3-csi-driver-benchmark/benchmark-data.json"
BENCHMARK_RESULTS_REGION: "us-east-1"
jobs:
build:
# this is to prevent the job to run at forked projects
if: github.repository == 'awslabs/mountpoint-s3-csi-driver'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up crane
uses: imjasonh/[email protected]
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: arn:aws:iam::239424963615:role/S3CSIDriverE2ETestsRole
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push docker image to Amazon ECR Private Repository
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_NAME: ${{ env.TMP_IMAGE_NAME }}
run: |
export PLATFORM=linux/amd64,linux/arm64
export TAG="${{ env.COMMIT_ID }}-perf"
make -j `nproc` all-push
- name: Install tools
run: |
export ACTION=install_tools
tests/e2e-kubernetes/scripts/run.sh
- name: Create cluster
run: |
export ACTION=create_cluster
export AWS_REGION=${{ env.AWS_REGION }}
export CLUSTER_NAME=s3-csi-cluster-perf
tests/e2e-kubernetes/scripts/run.sh
- name: Update kubeconfig
run: |
export ACTION=update_kubeconfig
export AWS_REGION=${{ env.AWS_REGION }}
export CLUSTER_NAME=s3-csi-cluster-perf
tests/e2e-kubernetes/scripts/run.sh
- name: Install the driver
run: |
export ACTION=install_driver
export AWS_REGION=${{ env.AWS_REGION }}
export CLUSTER_NAME=s3-csi-cluster-perf
export IMAGE_NAME=${{ env.TMP_IMAGE_NAME }}
export TAG="${{ env.COMMIT_ID }}-perf"
tests/e2e-kubernetes/scripts/run.sh
- name: Run Performance Tests
run: |
export ACTION=run_perf
export CLUSTER_NAME=s3-csi-cluster-perf
export AWS_REGION=${{ env.AWS_REGION }}
export TAG=${{ env.COMMIT_ID }}
tests/e2e-kubernetes/scripts/run.sh
- name: Download previous benchmark results
run: |
aws s3 cp --region ${{ env.BENCHMARK_RESULTS_REGION }} ${{ env.BENCHMARK_RESULTS_PATH }} benchmark-data.json || true
- name: Update benchmark result file
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'customBiggerIsBetter'
output-file-path: tests/e2e-kubernetes/csi-test-artifacts/output.json
alert-threshold: "200%"
fail-on-alert: true
external-data-json-path: benchmark-data.json
max-items-in-chart: 20
- name: Store benchmark result
run: |
aws s3 cp --region ${{ env.BENCHMARK_RESULTS_REGION }} benchmark-data.json ${{ env.BENCHMARK_RESULTS_PATH }}
- name: Post e2e cleanup
if: always()
run: |
export ACTION=e2e_cleanup
export AWS_REGION=${{ env.AWS_REGION }}
export CLUSTER_NAME=s3-csi-cluster-perf
tests/e2e-kubernetes/scripts/run.sh
- name: Delete cluster
if: always()
run: |
export ACTION=delete_cluster
export AWS_REGION=${{ env.AWS_REGION }}
export CLUSTER_NAME=s3-csi-cluster-perf
tests/e2e-kubernetes/scripts/run.sh

0 comments on commit 5dfe745

Please sign in to comment.