Skip to content

Commit

Permalink
Push EC2 benchmark results to GH pages
Browse files Browse the repository at this point in the history
Signed-off-by: Hanno Becker <[email protected]>
  • Loading branch information
hanno-becker committed Sep 5, 2024
1 parent bd2edd6 commit f3de72d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/bench_ec2_all.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: bench-ec2-all
name: Bench EC2
on:
workflow_dispatch:
push:
Expand All @@ -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
Expand All @@ -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

Check failure on line 38 in .github/workflows/bench_ec2_all.yml

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Format error

.github/workflows/bench_ec2_all.yml require to be formatted

Check failure on line 38 in .github/workflows/bench_ec2_all.yml

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Format error

.github/workflows/bench_ec2_all.yml require to be formatted
secrets: inherit
24 changes: 21 additions & 3 deletions .github/workflows/bench_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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:
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit f3de72d

Please sign in to comment.