Skip to content

Commit

Permalink
Make AMI ID dropdown (#124)
Browse files Browse the repository at this point in the history
* explicit set empty

Signed-off-by: Thing-han, Lim <[email protected]>

* wip remove type from action

Signed-off-by: Thing-han, Lim <[email protected]>

* use double quote

Signed-off-by: Thing-han, Lim <[email protected]>

* try workflow dispatch choice

Signed-off-by: Thing-han, Lim <[email protected]>

* add default for ci ec2 choice

Signed-off-by: Thing-han, Lim <[email protected]>

---------

Signed-off-by: Thing-han, Lim <[email protected]>
  • Loading branch information
potsrevennil authored Sep 12, 2024
1 parent e5bc22a commit 13b94d9
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 30 deletions.
24 changes: 9 additions & 15 deletions .github/actions/bench/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,28 @@ inputs:
perf:
description: Method of obtaining PMU metrics
required: true
default: 'PERF'
type: choice
options:
- NO
- PERF
- PMU
- M1
default: "PERF"
cflags:
description: CFLAGS to pass to compilation
default: ''
default: ""
archflags:
description: ARCHFLAGS to pass to compilation
default: ''
default: ""
bench_extra_args:
description: Further arguments to be appended to command line for `bench` script
default: ''
default: ""
store_results:
description: Whether to push results to GH pages
default: false
default: "false"
gh_token:
description: GitHub access token
required: true
use-nix:
description: Whether to run in the default Nix environment
default: true
default: "true"
custom_shell:
description: The shell to use. Only relevant if use-nix is 'false'
default: 'bash'
description: The shell to use. Only relevant if use-nix is "false"
default: "bash"
runs:
using: composite
steps:
Expand Down Expand Up @@ -71,7 +65,7 @@ runs:
uses: benchmark-action/github-action-benchmark@v1
with:
name: ${{ inputs.name }}
tool: 'customSmallerIsBetter'
tool: "customSmallerIsBetter"
output-file-path: output.json
github-token: ${{ inputs.gh_token }}
auto-push: true
6 changes: 3 additions & 3 deletions .github/actions/cbmc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ description: Run CBMC proofs for MLKEM-C_AArch64
inputs:
use-nix:
description: Whether to run in the default Nix environment
default: true
default: "true"
custom_shell:
description: The shell to use. Only relevant if use-nix is 'false'
default: 'bash'
default: "bash"
cross-prefix:
description: Binary prefix for cross compilation
default: ''
default: ""
runs:
using: composite
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/functest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ description: Run functional tests for MLKEM-C_AArch64
inputs:
use-nix:
description: Whether to run in the default Nix environment
default: true
default: "true"
cflags:
description: CFLAGS to pass to compilation
default: ''
default: ""
cross-prefix:
description: Binary prefix for cross compilation
default: ''
default: ""
runs:
using: composite
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ description: Lint MLKEM-C_AArch64
inputs:
use-nix:
description: Whether to run in the default Nix environment
default: true
default: "true"
custom_shell:
description: The shell to use. Only relevant if use-nix is 'false'
default: 'bash'
default: "bash"
cross-prefix:
description: Binary prefix for cross compilation
default: ''
default: ""
runs:
using: composite
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
bench_pmu: PMU
archflags: -mcpu=cortex-a72
cflags: -DFORCE_AARCH64
bench_extra_args:
bench_extra_args: ""
- system: rpi5
name: Arm Cortex-A76 (Raspberry Pi 5) benchmarks
bench_pmu: PERF
archflags: "-mcpu=cortex-a76 -march=armv8.2-a"
cflags: -DFORCE_AARCH64
bench_extra_args:
bench_extra_args: ""
- system: a55
name: Arm Cortex-A55 (Snapdragon 888) benchmarks
bench_pmu: PERF
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bench_ec2_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
with:
ec2_instance_type: t4g.small
ec2_ami_id: ami-096ea6a12ea24a797
ec2_ami: ubuntu-latest (aarch64)
archflags: -mcpu=cortex-a76 -march=armv8.2-a
cflags: -DFORCE_AARCH64
store_results: true
Expand All @@ -33,7 +33,7 @@ jobs:
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
with:
ec2_instance_type: c7g.medium
ec2_ami_id: ami-096ea6a12ea24a797
ec2_ami: ubuntu-latest (aarch64)
archflags: -mcpu=neoverse-v1 -march=armv8.4-a
cflags: -DFORCE_AARCH64
store_results: true
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/bench_ec2_any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ on:
ec2_instance_type:
description: Type if EC2 instance to benchmark on
default: t4g.small
ec2_ami:
description: AMI ID
type: choice
options:
- ubuntu-latest (x86_64)
- ubuntu-latest (aarch64)
- ubuntu-latest (custom AMI)
default: ubuntu-latest (aarch64)
ec2_ami_id:
description: AMI ID
required: false
default: ami-096ea6a12ea24a797
cflags:
description: Custom CFLAGS for compilation
Expand All @@ -36,6 +45,7 @@ jobs:
uses: ./.github/workflows/bench_ec2_reusable.yml
with:
ec2_instance_type: ${{ inputs.ec2_instance_type }}
ec2_ami: ${{ inputs.ec2_ami }}
ec2_ami_id: ${{ inputs.ec2_ami_id }}
cflags: ${{ inputs.cflags }}
archflags: ${{ inputs.archflags }}
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/bench_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
type: string
description: Type if EC2 instance to benchmark on
default: t4g.small
ec2_ami:
type: string
description: Textual description of AMI
default: ubuntu-latest (aarch64)
ec2_ami_id:
type: string
description: AMI ID
Expand Down Expand Up @@ -39,6 +43,8 @@ on:
env:
AWS_ROLE: arn:aws:iam::559050233797:role/mlkem-c-aarch64-gh-action
AWS_REGION: us-east-1
AMI_UBUNTU_LATEST_X86_64: ami-0e86e20dae9224db8
AMI_UBUNTU_LATEST_AARCH64: ami-096ea6a12ea24a797
jobs:
start-ec2-runner:
name: Start ${{ inputs.name }} (${{ inputs.ec2_instance_type }})
Expand All @@ -51,6 +57,18 @@ jobs:
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- uses: actions/checkout@v4
- name: Determine AMI ID
id: det_ami_id
run: |
if [[ "${{ inputs.ec2_ami }}" == "ubuntu-latest (x86_64)" ]]; then
AMI_ID=${{ env.AMI_UBUNTU_LATEST_X86_64 }}
elif [[ "${{ inputs.ec2_ami }}" == "ubuntu-latest (aarch64)" ]]; then
AMI_ID=${{ env.AMI_UBUNTU_LATEST_AARCH64 }}
elif [[ "${{ inputs.ec2_ami }}" == "ubuntu-latest (custom AMI)" ]]; then
AMI_ID=${{ inputs.ec2_ami_id }}
fi
echo "Using AMI ID: $AMI_ID"
echo "AMI_ID=$AMI_ID" >> $GITHUB_OUTPUT
- name: Clear nix-installer action cache
uses: ./.github/actions/clear-cache
with:
Expand All @@ -68,7 +86,7 @@ jobs:
with:
mode: start
github-token: ${{ secrets.AWS_GITHUB_TOKEN }}
ec2-image-id: ${{ inputs.ec2_ami_id }}
ec2-image-id: ${{ steps.det_ami_id.outputs.AMI_ID }}
ec2-instance-type: ${{ inputs.ec2_instance_type }}
subnet-id: subnet-07b2729e5e065962f
security-group-id: sg-0ab2e297196c8c381
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci_ec2_any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ on:
ec2_instance_type:
description: Type if EC2 instance to run on
default: t4g.small
ec2_ami:
description: AMI ID
type: choice
options:
- ubuntu-latest (x86_64)
- ubuntu-latest (aarch64)
- ubuntu-latest (custom AMI)
default: ubuntu-latest (aarch64)
ec2_ami_id:
description: AMI ID
default: ami-096ea6a12ea24a797
Expand Down Expand Up @@ -41,6 +49,7 @@ jobs:
uses: ./.github/workflows/ci_ec2_reusable.yml
with:
ec2_instance_type: ${{ inputs.ec2_instance_type }}
ec2_ami: ${{ inputs.ec2_ami }}
ec2_ami_id: ${{ inputs.ec2_ami_id }}
cflags: ${{ inputs.cflags }}
cross-prefix: ${{ inputs.cross-prefix }}
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/ci_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
type: string
description: Type if EC2 instance to benchmark on
default: t4g.small
ec2_ami:
type: string
description: Textual description of AMI
default: ubuntu-latest (aarch64)
ec2_ami_id:
type: string
description: AMI ID
Expand Down Expand Up @@ -52,6 +56,18 @@ jobs:
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- uses: actions/checkout@v4
- name: Determine AMI ID
id: det_ami_id
run: |
if [[ "${{ inputs.ec2_ami }}" == "ubuntu-latest (x86_64)" ]]; then
AMI_ID=${{ env.AMI_UBUNTU_LATEST_X86_64 }}
elif [[ "${{ inputs.ec2_ami }}" == "ubuntu-latest (aarch64)" ]]; then
AMI_ID=${{ env.AMI_UBUNTU_LATEST_AARCH64 }}
elif [[ "${{ inputs.ec2_ami }}" == "ubuntu-latest (custom AMI)" ]]; then
AMI_ID=${{ inputs.ec2_ami_id }}
fi
echo "Using AMI ID: $AMI_ID"
echo "AMI_ID=$AMI_ID" >> $GITHUB_OUTPUT
- name: Clear nix-installer action cache
uses: ./.github/actions/clear-cache
with:
Expand All @@ -69,7 +85,7 @@ jobs:
with:
mode: start
github-token: ${{ secrets.AWS_GITHUB_TOKEN }}
ec2-image-id: ${{ inputs.ec2_ami_id }}
ec2-image-id: ${{ steps.det_ami_id.outputs.AMI_ID }}
ec2-instance-type: ${{ inputs.ec2_instance_type }}
subnet-id: subnet-07b2729e5e065962f
security-group-id: sg-0ab2e297196c8c381
Expand Down

0 comments on commit 13b94d9

Please sign in to comment.