feat: add workflow for HTC Mock session on localhost #43
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 HTC Mock on localhost" | |
on: | |
push: | |
branches: | |
- "ts/add-htc-mock-worflow" | |
- "ts/ci-**" | |
workflow_dispatch: | |
inputs: | |
ntasks: | |
description: "Number of tasks to be created" | |
default: "100" | |
required: false | |
subtasks-levels: | |
description: "Levels of subtasking" | |
default: "1" | |
required: false | |
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 '.armonik_versions.core' | sed -r 's/"//g')" >> $GITHUB_ENV | |
echo "ntasks=${{ inputs.ntasks || 500 }}" >> $GITHUB_ENV | |
echo "subtasks-levels=${{ inputs.subtasks-levels || 5 }}" >> $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: | | |
endpoint=$(cat infrastructure/quick-deploy/localhost/generated/armonik-output.json | jq '.armonik.control_plane_url' | sed -r 's/("http:\/\/)([^:]*)(:.*)/\2/') | |
echo "endpoint=$endpoint" >> "$GITHUB_OUTPUT" | |
- name: Get current date | |
run: | | |
echo "date=$(printf '%(%Y-%m-%d-%Hh%Mm%Ss)T')" >> $GITHUB_ENV | |
- id: htcmock | |
name: Run HTC Mock | |
uses: aneoconsulting/ArmoniK.Action.Deploy/htcmock@ts/fix-htcmock-output | |
with: | |
armonik-core-version: ${{ env.core-version }} | |
ntasks: ${{ env.ntasks}} | |
subtasks-levels: ${{ env.subtasks-levels }} | |
session-name: htcmock1 | |
grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.endpoint }} | |
purge-data: ${{ env.purge-data }} | |
- id: get-throughput | |
name: Get Session Throughput | |
uses: aneoconsulting/ArmoniK.Action.Deploy/get-throughput@ts/fix-htcmock-output | |
with: | |
grpc-client-endpoint: ${{ steps.get-armonik-endpoint.outputs.endpoint }} | |
session-name: ${{ steps.htcmock.outputs.session-name }} | |
- name: Upload bench results to artifact registry | |
uses: actions/upload-artifact@v4 | |
with: | |
name: htc-mock-results | |
path: ${{ steps.get-throughput.outputs.bench-file-path }} | |
- name: (test) Upload bench results to s3 | |
env: | |
BENCH_RESULTS_PATH: ${{ steps.get-throughput.outputs.bench-file-path }} | |
COMMIT_SHA: ${{ github.sha }} | |
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/commit/$COMMIT_SHA/$date-htcmock-$ntasks_tasks.json" | |
- if: "always()" | |
id: destroy | |
name: Destroy deployment | |
uses: aneoconsulting/ArmoniK.Action.Deploy/destroy@main | |
with: | |
type: localhost |