From f3de72d697c767e857d647065ce4c8b902139c98 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 5 Sep 2024 05:11:31 +0100 Subject: [PATCH] Push EC2 benchmark results to GH pages Signed-off-by: Hanno Becker --- .github/workflows/bench_ec2_all.yml | 8 ++++++-- .github/workflows/bench_ec2_reusable.yml | 24 +++++++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bench_ec2_all.yml b/.github/workflows/bench_ec2_all.yml index 61bb325fd..484807954 100644 --- a/.github/workflows/bench_ec2_all.yml +++ b/.github/workflows/bench_ec2_all.yml @@ -1,4 +1,4 @@ -name: bench-ec2-all +name: Bench EC2 on: workflow_dispatch: push: @@ -19,6 +19,8 @@ jobs: ec2_ami_id: ami-096ea6a12ea24a797 cflags: -mcpu=cortex-a76 archflags: -march=armv8.2-a + store_results: true + name: Graviton2 secrets: inherit bench-gv3: name: Graviton3 @@ -32,4 +34,6 @@ jobs: ec2_ami_id: ami-096ea6a12ea24a797 cflags: -mcpu=neoverse-v1 archflags: -march=armv8.4-a - secrets: inherit + store_results: true + name: Graviton3 + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/bench_ec2_reusable.yml b/.github/workflows/bench_ec2_reusable.yml index 74224c09c..b16b10bff 100644 --- a/.github/workflows/bench_ec2_reusable.yml +++ b/.github/workflows/bench_ec2_reusable.yml @@ -2,6 +2,10 @@ name: bench-ec2-reusable on: workflow_call: inputs: + name: + type: string + description: Alternative name of instance + default: Graviton2 ec2_instance_type: type: string description: Type if EC2 instance to benchmark on @@ -18,12 +22,16 @@ on: type: string description: Custom ARCH flags for compilation default: -march=armv8.2-a + store_results: + type: bool + description: Indicates if results should be pushed to github pages + default: false env: AWS_ROLE: arn:aws:iam::559050233797:role/mlkem-c-aarch64-gh-action AWS_REGION: us-east-1 jobs: start-ec2-runner: - name: Start ${{ github.event.inputs.ec2_instance_type }} instance + name: Start ${{ github.event.inputs.name }} (${{ github.event.inputs.ec2_instance_type }}) permissions: contents: 'read' id-token: 'write' @@ -48,7 +56,7 @@ jobs: subnet-id: subnet-07b2729e5e065962f security-group-id: sg-0ab2e297196c8c381 bench: - name: Bench on ${{ inputs.ec2_instance_type }} + name: Bench ${{ inputs.name }} needs: start-ec2-runner # required to start the main job when the runner is ready runs-on: ${{ needs.start-ec2-runner.outputs.label }} # run the job on the newly created runner steps: @@ -78,8 +86,18 @@ jobs: - name: Dump benchmark run: | cat output.json + - name: Store benchmark result + if: ${{ inputs.store_result == true }} + uses: benchmark-action/github-action-benchmark@v1 + with: + name: ${{ inputs.name }} + tool: 'customSmallerIsBetter' + output-file-path: output.json + github-token: ${{ secrets.GITHUB_TOKEN }} + auto-push: true + stop-ec2-runner: - name: Stop ${{ inputs.ec2_instance_type }} instance + name: Stop ${{ github.event.inputs.name }} (${{ github.event.inputs.ec2_instance_type }}) permissions: contents: 'read' id-token: 'write'