Unify HTC Mock and Bench benchmarks #48
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: "Bench ArmoniK on localhost" | |
on: | |
push: | |
branches: | |
- "main" | |
- "ts/generalize-bench-runs" | |
workflow_dispatch: # Possibility to run this workflow for debugging purposes | |
# inputs can be useful for tests in further developments | |
inputs: | |
htc-mock-ntasks: | |
description: "Number of tasks to be created for HTC Mock" | |
default: "100" | |
required: false | |
htc-mock-subtasks-levels: | |
description: "Levels of subtasking for HTC Mock" | |
default: "1" | |
required: false | |
htc-mock-polling-limit: | |
description: "Polling duration (in seconds) for HTC Mock session completion" | |
default: "180" | |
required: false | |
bench-ntasks: | |
description: "Number of tasks to be created for Bench " | |
default: "1000" | |
required: false | |
bench-polling-limit: | |
description: "Polling duration (in seconds) for Bench session completion" | |
default: "1200" | |
purge-data: | |
description: "Whether to purge session" | |
default: "false" | |
required: false | |
release: | |
types: [created, published] | |
jobs: | |
htc-mock: | |
name: Get HTC Mock throughput | |
runs-on: ubuntu-latest | |
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 | |
- name: Define runner env variables | |
run: | | |
echo "core-version=$(cat versions.tfvars.json | jq -r '.armonik_versions.core'" >> $GITHUB_ENV | |
echo "htcmock-ntasks=${{ inputs.htcmock-ntasks || null }}" >> $GITHUB_ENV | |
echo "htcmock-subtasks-levels=${{ inputs.htcmock-subtasks-levels || null }}" >> $GITHUB_ENV | |
echo "htcmock-polling-limit=${{ inputs.htcmock-polling-limit || null }}" >> $GITHUB_ENV" | |
echo "bench-ntasks=${{ inputs.bench-ntasks || null }}" >> $GITHUB_ENV | |
echo "bench-polling-limit=${{ inputs.bench-polling-limit || null }}" >> $GITHUB_ENV" | |
echo "purge-data=${{ inputs.purge-data || false }}" >> $GITHUB_ENV | |
- id: deploy | |
name: "Deploy ArmoniK" | |
uses: aneoconsulting/ArmoniK.Action.Deploy/deploy@main | |
with: | |
type: localhost | |
- id: get-armonik-endpoint | |
name: "Get ArmoniK's control plane endpoint" | |
run: | | |
grpc-endpoint=$(cat infrastructure/quick-deploy/localhost/generated/armonik-output.json | jq -r '.armonik.control_plane_url' | sed -r 's/(http:\/\/)([^:]*)(:.*)/\2/') | |
echo "grpc-endpoint=$grpc-endpoint" >> "$GITHUB_OUTPUT" | |
- id: htcmock | |
name: Run HTC Mock | |
uses: aneoconsulting/ArmoniK.Action.Deploy/htcmock@main | |
with: | |
armonik-core-version: ${{ env.core-version }} | |
ntasks: ${{ env.htcmock-ntasks || null}} | |
subtasks-levels: ${{ env.htcmock-subtasks-levels || null}} | |
session-name: htcmock | |
grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.grpc-endpoint }} | |
purge-data: ${{ env.purge-data }} | |
- id: get-htcmock-stats | |
name: Get HTC Mock Stats | |
uses: aneoconsulting/ArmoniK.Action.Deploy/get-throughput@main | |
with: | |
grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.endpoint }} | |
session-name: ${{ steps.htcmock.outputs.session-name }} | |
- name: Upload HTC Mock results to artifact registry | |
uses: actions/upload-artifact@v4 | |
with: | |
name: main_benchmark_htcmock_${{ github.run_id }} | |
path: ${{ steps.get-htcmock-stats.outputs.bench-file-path }} | |
- id: bench | |
name: Run Bench | |
uses: aneoconsulting/ArmoniK.Action.Deploy/htcmock@ts/add-bench-action | |
with: | |
armonik-core-version: ${{ env.core-version }} | |
ntasks: ${{ env.bench-ntasks }} | |
session-name: bench | |
grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.grpc-endpoint }} | |
purge-data: ${{ env.purge-data }} | |
- 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 }} | |
- name: Upload Bench results to artifact registry | |
uses: actions/upload-artifact@v4 | |
with: | |
name: main_benchmark_bench_${{ github.run_id }} | |
path: ${{ steps.get-bench-stats.outputs.bench-file-path }} | |
- name: Upload benchmarks results to s3 | |
env: | |
HTCMOCK_RESULTS_PATH: ${{ steps.get-htcmock-stats.outputs.bench-file-path }} | |
BENCH_RESULTS_PATH: ${{ steps.get-bench-stats.outputs.bench-file-path }} | |
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 "$HTCMOCK_RESULTS_PATH" "s3://test-armonik-bench-storage/main_benchmark_htcmock_$GITHUB_RUN_ID.json" | |
aws s3 cp "$BENCH_RESULTS_PATH" "s3://test-armonik-bench-storage/main_benchmark_bench_$GITHUB_RUN_ID.json" | |
- if: "always()" | |
id: destroy | |
name: Destroy deployment | |
uses: aneoconsulting/ArmoniK.Action.Deploy/destroy@main | |
with: | |
type: localhost |