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: "Benchmark ArmoniK on AWS with Bench" | |
on: | |
push: | |
branches: | |
- "ts/add-bench-aws" | |
release: | |
types: [published] | |
jobs: | |
benchmark: | |
name: Bench ArmoniK on AWS | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
type: [localhost, aws] | |
include: | |
- type: localhost | |
ntasks: 100 | |
polling-limit: 300 | |
- type: aws | |
ntasks: 1000 | |
polling-limit: 600 | |
env: | |
prefix: bench | |
outputs: | |
terraform-output: ${{ steps.deploy.outputs.terraform-output }} | |
armonik-endpoint: ${{ steps.get-armonik-endpoint.outputs.endpoint }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Install Dependencies | |
uses: aneoconsulting/ArmoniK.Action.Deploy/dependencies@main | |
with: | |
terraform: true | |
k3s: true | |
docker: true | |
aws: true | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: eu-west-3 | |
- name: Get core version | |
run: | | |
echo "core-version=$(cat versions.tfvars.json | jq -r '.armonik_versions.core')" >> $GITHUB_ENV | |
- if: ${{ matrix.type == 'aws' }} | |
id: bootstrap-deploy | |
name: Deploy Bootstrap | |
uses: aneoconsulting/ArmoniK.Action.Deploy/bootstrap-deploy@main | |
with: | |
type: aws | |
prefix: ${{ env.prefix }} | |
- id: deploy | |
name: "Deploy ArmoniK" | |
uses: aneoconsulting/ArmoniK.Action.Deploy/deploy@main | |
with: | |
type: ${{ matrix.type }} | |
prefix: ${{ env.prefix }} | |
core-version: ${{ env.core-version }} | |
- id: get-armonik-endpoint | |
name: "Get ArmoniK's control plane endpoint" | |
env: | |
TYPE: ${{ matrix.type }} | |
run: | | |
grpc_endpoint=$(cat infrastructure/quick-deploy/$TYPE/generated/armonik-output.json | jq -r '.armonik.control_plane_url' | sed -r 's/(http:\/\/)([^:]*)(:.*)/\2/') | |
echo "grpc-endpoint=$grpc_endpoint" >> "$GITHUB_OUTPUT" | |
- id: bench | |
name: Run Bench | |
uses: aneoconsulting/ArmoniK.Action.Deploy/bench@ts/add-bench-action | |
with: | |
armonik-core-version: ${{ env.core-version }} | |
ntasks: ${{ matrix.ntasks }} | |
session-name: bench | |
grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.grpc-endpoint }} | |
kubeconfig-path: ${{ steps.deploy.outputs.generated-folder }}/kubeconfig | |
- id: get-bench-stats | |
name: Get Bench Stats | |
uses: aneoconsulting/ArmoniK.Action.Deploy/get-throughput@main | |
with: | |
grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.endpoint }} | |
session-name: ${{ steps.bench.outputs.session-name }} | |
poll-duration-limit: 720 | |
- name: Upload Bench results to artifact registry | |
uses: actions/upload-artifact@v4 | |
with: | |
name: main_benchmark_with_bench_on_${{ matrix.type }}_${{ github.run_id }} | |
path: ${{ steps.get-bench-stats.outputs.bench-file-path }} | |
- name: Upload benchmarks results to s3 | |
env: | |
BENCH_RESULTS_PATH: ${{ steps.get-bench-stats.outputs.bench-file-path }} | |
TYPE: ${{ matrix.type }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_EC2_METADATA_DISABLED: true | |
run: | | |
aws s3 cp "$BENCH_RESULTS_PATH" "s3://test-armonik-bench-storage/main_benchmark_with_bench_on_$TYPE_$GITHUB_RUN_ID.json" | |
- if: always() | |
id: destroy | |
name: Destroy deployment | |
uses: aneoconsulting/ArmoniK.Action.Deploy/destroy@main | |
with: | |
type: ${{ matrix.type }} | |
prefix: ${{ env.prefix }} | |
- if: always() && ${{ matrix.type == 'aws' }} | |
id: bootstrap-destroy | |
name: Destroy Bootstrap | |
uses: aneoconsulting/ArmoniK.Action.Deploy/bootstrap-destroy@main | |
with: | |
type: aws | |
prefix: ${{ env.prefix }} |