-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Bench session workflow on localhost #1328
Changes from 3 commits
73818d1
eb7a81e
a841b6a
8c23822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,104 @@ | ||||||
name: "Bench HTC Mock on localhost" | ||||||
|
||||||
on: | ||||||
push: | ||||||
branches: | ||||||
- "ts/add-bench-workflow" | ||||||
- "main" | ||||||
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 | ||||||
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not used for bench |
||||||
purge-data: | ||||||
description: "Whether to purge session" | ||||||
default: "false" | ||||||
required: false | ||||||
release: | ||||||
types: [created, published] | ||||||
|
||||||
jobs: | ||||||
bench: | ||||||
name: Get Bench session stats | ||||||
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
echo "ntasks=${{ inputs.ntasks || 500 }}" >> $GITHUB_ENV | ||||||
echo "purge-data=${{ inputs.purge-data || false }}" >> $GITHUB_ENV | ||||||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure || works, but even if it does, you should take the default value defined in the parameter itself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Workflows do not consider inputs if they're triggered by an event other than workflow_dispatch or worfklow_call |
||||||
|
||||||
- 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/') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
echo "endpoint=$endpoint" >> "$GITHUB_OUTPUT" | ||||||
|
||||||
- id: bench | ||||||
name: Run Bench session | ||||||
uses: aneoconsulting/ArmoniK.Action.Deploy/bench@ts/add-bench-action | ||||||
with: | ||||||
armonik-core-version: ${{ env.core-version }} | ||||||
ntasks: ${{ env.ntasks}} | ||||||
session-name: bench1 | ||||||
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@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: bench-results | ||||||
path: ${{ steps.get-throughput.outputs.bench-file-path }} | ||||||
|
||||||
- name: Get current date | ||||||
run: | | ||||||
echo "date=$(printf '%(%Y-%m-%d-%Hh%Mm%Ss)T')" >> $GITHUB_ENV | ||||||
Comment on lines
+85
to
+87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you really want to have this, it should be at the start of the action |
||||||
|
||||||
- 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-bench-$ntasks_tasks.json" | ||||||
|
||||||
- if: "always()" | ||||||
id: destroy | ||||||
name: Destroy deployment | ||||||
uses: aneoconsulting/ArmoniK.Action.Deploy/destroy@main | ||||||
with: | ||||||
type: localhost |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to have a single action with a matrix that does all the benchmarks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
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@main | ||
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@main | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: bench-session | ||
namespace: armonik | ||
spec: | ||
ttlSecondsAfterFinished: 0 | ||
template: | ||
spec: | ||
containers: | ||
Check warning Code scanning / SonarCloud Service account permissions should be restricted Medium
Bind this resource's automounted service account to RBAC or disable automounting. See more on SonarCloud
|
||
- name: bench-session | ||
Check warning Code scanning / SonarCloud Storage limits should be enforced Medium
Specify a storage limit for this container. See more on SonarCloud
Check warning Code scanning / SonarCloud Memory limits should be enforced Medium
Specify a memory limit for this container. See more on SonarCloud
|
||
image: dockerhubaneo/armonik_core_bench_test_client::@@ARMONIK_CORE_VERSION@@ | ||
env: | ||
- name: BenchOptions__NTasks | ||
value: "@@NTASKS@@" | ||
- name: BenchOptions__Partition | ||
value: bench | ||
- name: BenchOptions__Options__SessionName | ||
value: "@@SESSION_NAME@@" | ||
- name: BenchOptions__PurgeData | ||
value: "@@PURGE_DATA@@" | ||
- name: BenchOptions__DownloadResults | ||
value: "false" | ||
- name: GrpcClient__Endpoint | ||
value: http://@@GRPC_CLIENT_ENDPOINT@@:5001 | ||
|
||
restartPolicy: Never |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: htcmock-session | ||
namespace: armonik | ||
spec: | ||
ttlSecondsAfterFinished: 0 | ||
template: | ||
spec: | ||
containers: | ||
Check warning Code scanning / SonarCloud Service account permissions should be restricted Medium
Bind this resource's automounted service account to RBAC or disable automounting. See more on SonarCloud
|
||
- name: htcmock-session | ||
Check warning Code scanning / SonarCloud Memory limits should be enforced Medium
Specify a memory limit for this container. See more on SonarCloud
Check warning Code scanning / SonarCloud Storage limits should be enforced Medium
Specify a storage limit for this container. See more on SonarCloud
|
||
image: dockerhubaneo/armonik_core_htcmock_test_client:@@ARMONIK_CORE_VERSION@@ | ||
env: | ||
- name: HtcMock__NTasks | ||
value: "@@NTASKS@@" | ||
- name: HtcMock__TotalCalculationTime | ||
value: "00:00:00.100" | ||
- name: HtcMock__DataSize | ||
value: "1" | ||
- name: HtcMock__MemorySize | ||
value: "1" | ||
- name: HtcMock__EnableFastCompute | ||
value: "true" | ||
- name: HtcMock__SubTasksLevels | ||
value: "@@SUBTASKS_LEVELS@@" | ||
- name: HtcMock__Partition | ||
value: htcmock | ||
- name: HtcMock__Options__SessionName | ||
value: "@@SESSION_NAME@@" | ||
- name: HtcMock__PurgeData | ||
value: "@@PURGE_DATA@@" | ||
- name: GrpcClient__Endpoint | ||
value: http://@@GRPC_CLIENT_ENDPOINT@@:5001 | ||
|
||
restartPolicy: Never |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default should be more like 100k or 1M
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventhough it is on localhost ?