From d092245735bfeb5b5ce755033b8f8d9e653f297b Mon Sep 17 00:00:00 2001 From: Trystan Schneider Date: Wed, 16 Oct 2024 16:34:56 +0200 Subject: [PATCH] fix: HTC Mock and Get Throughput actions --- get-throughput/action.yml | 12 ++++++------ htcmock/action.yml | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/get-throughput/action.yml b/get-throughput/action.yml index f62d971..ea6afa8 100644 --- a/get-throughput/action.yml +++ b/get-throughput/action.yml @@ -15,10 +15,10 @@ inputs: description: "The amount of seconds the throughtput getter will wait for the session to finish" required: false default: "600" -# outputs: -# session-throughput: -# description: "Throughput for the session" -# value: ${{ steps.get-throughput.outputs }} +outputs: + bench-file-path: + description: "JSON with throughput for the session" + value: ${{ steps.get-throughput.outputs.bench-file-path }} runs: using: composite steps: @@ -33,5 +33,5 @@ runs: run: | set -ex cd tools/ci/python - pip install requirements.txt - python program.py "$GRPC_CLIENT_ENDPOINT" "$SESSION_NAME" "$POLL_DURATION_LIMIT" + pip install -r requirements.txt + echo "bench-file-path=$(python program.py -n "$SESSION_NAME" --polling-limit "$POLL_DURATION_LIMIT" "$GRPC_CLIENT_ENDPOINT")" >> "$GITHUB_OUTPUT" diff --git a/htcmock/action.yml b/htcmock/action.yml index c12c441..722860b 100644 --- a/htcmock/action.yml +++ b/htcmock/action.yml @@ -23,7 +23,14 @@ inputs: description: "A name that is provided as the value for key 'SessionName' for the 'HtcMock__Options' option" required: false default: "cicd" - + purge-data: + description: "Whether to purge session after execution" + required: false + default: "false" +outputs: + session-name: + description: "Name of the HTC Mock session to help retrieve its id" + value: ${{ steps.run.outputs.session-name }} runs: using: composite steps: @@ -37,11 +44,11 @@ runs: SUBTASKS_LEVELS: ${{ inputs.subtasks-levels }} SESSION_NAME: ${{ inputs.session-name }} GRPC_CLIENT_ENDPOINT: ${{ inputs.grpc-client-endpoint }} - ARMONIK_KUBERNETES_NAMESPACE: ${{ inputs.armonik-kubernetes-namespace }} + PURGE_DATA: ${{ inputs.purge-data }} run: | set -ex cd tools/ci - echo "session-name=$SESSION_NAME" >> "$GITHUB_OUTPUTS" - sed "s/@@NTASKS@@/$NTASKS/g; s/@@SUBTASKS_LEVELS@@/$SUBTASKS_LEVELS/g; s/@@SESSION_NAME@@/$SESSION_NAME/g; s/@@GRPC_CLIENT_ENDPOINT@@/$GRPC_CLIENT_ENDPOINT/g" \ - htcmock-job-template.yml | + echo "session-name=$SESSION_NAME" >> "$GITHUB_OUTPUT" + sed "s/@@ARMONIK_CORE_VERSION@@/$ARMONIK_CORE_VERSION/g; s/@@NTASKS@@/$NTASKS/g; s/@@SUBTASKS_LEVELS@@/$SUBTASKS_LEVELS/g; s/@@SESSION_NAME@@/$SESSION_NAME/g; s/@@GRPC_CLIENT_ENDPOINT@@/$GRPC_CLIENT_ENDPOINT/g; s/@@PURGE_DATA@@/$PURGE_DATA/g" \ + ${{ inputs.working-directory }}/tools/ci/htcmock-job-template.yml | kubectl apply -f -