store benchmark results in s3 #1
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: 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" | |
jobs: | |
build: | |
# this is to prevent the job to run at forked projects | |
if: github.repository == 'awslabs/mountpoint-s3-csi-driver' | |
strategy: | |
matrix: | |
cluster-type: ["kops"] | |
arch: ["x86"] | |
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 | |
if: matrix.cluster-type == 'kops' | |
run: | | |
export ACTION=create_cluster | |
export AWS_REGION=${{ env.AWS_REGION }} | |
export CLUSTER_TYPE=${{ matrix.cluster-type }} | |
export ARCH=${{ matrix.arch }} | |
tests/e2e-kubernetes/scripts/run.sh | |
- name: Update kubeconfig | |
run: | | |
export ACTION=update_kubeconfig | |
export AWS_REGION=${{ env.AWS_REGION }} | |
export CLUSTER_TYPE=${{ matrix.cluster-type }} | |
export ARCH=${{ matrix.arch }} | |
tests/e2e-kubernetes/scripts/run.sh | |
- name: Install the driver | |
run: | | |
export ACTION=install_driver | |
export AWS_REGION=${{ env.AWS_REGION }} | |
export CLUSTER_TYPE=${{ matrix.cluster-type }} | |
export IMAGE_NAME=${{ env.TMP_IMAGE_NAME }} | |
export TAG="${{ env.COMMIT_ID }}-perf" | |
export ARCH=${{ matrix.arch }} | |
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 us-east-1 s3://mountpoint-s3-csi-driver-benchmark/benchmark-data.json 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 us-east-1 benchmark-data.json s3://mountpoint-s3-csi-driver-benchmark/benchmark-data.json | |
- name: Post e2e cleanup | |
if: always() | |
run: | | |
export ACTION=e2e_cleanup | |
export AWS_REGION=${{ env.AWS_REGION }} | |
export CLUSTER_TYPE=${{ matrix.cluster-type }} | |
export ARCH=${{ matrix.arch }} | |
tests/e2e-kubernetes/scripts/run.sh | |
- name: Delete cluster | |
if: always() && matrix.cluster-type == 'kops' | |
run: | | |
export ACTION=delete_cluster | |
export AWS_REGION=${{ env.AWS_REGION }} | |
export CLUSTER_TYPE=${{ matrix.cluster-type }} | |
export ARCH=${{ matrix.arch }} | |
tests/e2e-kubernetes/scripts/run.sh |