forked from openshift-psap/topsail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Watsonx: keep working on the scale test (openshift-psap#19)
- Loading branch information
Showing
17 changed files
with
240 additions
and
186 deletions.
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
roles/watsonx_serving/watsonx_serving_validate_model/defaults/main/config.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Auto-generated file, do not edit manually ... | ||
# Toolbox generate command: repo generate_ansible_default_settings | ||
# Source component: Watsonx_Serving.validate_model | ||
|
||
# a list of names of the inference service to validate | ||
# Mandatory value | ||
watsonx_serving_validate_model_inference_service_names: | ||
|
||
# the model-id to pass to the inference service | ||
# Mandatory value | ||
watsonx_serving_validate_model_model_id: | ||
|
||
# the data to pass to the model query | ||
# Mandatory value | ||
watsonx_serving_validate_model_query_data: | ||
|
||
# the namespace in which the Serving stack was deployed. If empty, use the current project. | ||
watsonx_serving_validate_model_namespace: | ||
|
Empty file.
3 changes: 3 additions & 0 deletions
3
roles/watsonx_serving/watsonx_serving_validate_model/meta/main.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- role: check_deps |
6 changes: 6 additions & 0 deletions
6
roles/watsonx_serving/watsonx_serving_validate_model/tasks/main.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Validate the models | ||
loop: "{{ watsonx_serving_validate_model_inference_service_names }}" | ||
loop_control: | ||
loop_var: watsonx_serving_validate_model_inference_service_name | ||
include_tasks: validate_model.yaml |
59 changes: 59 additions & 0 deletions
59
roles/watsonx_serving/watsonx_serving_validate_model/tasks/validate_model.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
- name: Ensure that GRPCurl is available | ||
shell: | ||
which grpcurl | ||
|
||
- name: Create the artifact directory | ||
file: | ||
path: "{{ artifact_extra_logs_dir }}/{{ watsonx_serving_validate_model_inference_service_name }}" | ||
state: directory | ||
mode: '0755' | ||
|
||
- name: Get the name of the KSVC | ||
shell: | ||
set -o pipefail; | ||
oc get ksvc | ||
-lserving.kserve.io/inferenceservice={{ watsonx_serving_validate_model_inference_service_name }} | ||
-n {{ watsonx_serving_validate_model_namespace }} | ||
-ojsonpath='{.items[0].status.url}' | ||
| sed 's|https://||' | ||
register: ksvc_hostname_cmd | ||
|
||
|
||
- name: Wait for the model to answer successfully | ||
shell: | | ||
set -o pipefail | ||
GRPCURL_DATA=$(echo "{{ watsonx_serving_validate_model_query_data }}" | sed "s/'/\"/g") | ||
grpcurl \ | ||
-insecure \ | ||
-d "$GRPCURL_DATA" \ | ||
-H "mm-model-id: {{ watsonx_serving_validate_model_model_id }}" \ | ||
{{ ksvc_hostname_cmd.stdout }}:443 \ | ||
caikit.runtime.Nlp.NlpService/TextGenerationTaskPredict \ | ||
> {{ artifact_extra_logs_dir }}/{{ watsonx_serving_validate_model_inference_service_name }}/TextGenerationTaskPredict.answer | ||
register: grpc_working_cmd | ||
until: grpc_working_cmd.rc == 0 | ||
retries: 600 | ||
delay: 1 | ||
|
||
- name: Save the number of attempts | ||
local_action: | ||
copy content={{ grpc_working_cmd }} dest={{ artifact_extra_logs_dir }}/{{ watsonx_serving_validate_model_inference_service_name }}/attempts.json | ||
|
||
- name: Prettify the file | ||
shell: | | ||
set -o pipefail | ||
content=$(cat "{{ artifact_extra_logs_dir }}/{{ watsonx_serving_validate_model_inference_service_name }}/attempts.json") | ||
echo "$content" | jq > "{{ artifact_extra_logs_dir }}/{{ watsonx_serving_validate_model_inference_service_name }}/attempts.json" | ||
- name: Query the model 2nd endpoint | ||
shell: | | ||
set -o pipefail | ||
GRPCURL_DATA=$(echo "{{ watsonx_serving_validate_model_query_data }}" | sed "s/'/\"/g") | ||
grpcurl \ | ||
-insecure \ | ||
-d "$GRPCURL_DATA" \ | ||
-H "mm-model-id: {{ watsonx_serving_validate_model_model_id }}" \ | ||
{{ ksvc_hostname_cmd.stdout }}:443 \ | ||
caikit.runtime.Nlp.NlpService/ServerStreamingTextGenerationTaskPredict \ | ||
> {{ artifact_extra_logs_dir }}/{{ watsonx_serving_validate_model_inference_service_name }}/ServerStreamingTextGenerationTaskPredict.answer |
Empty file.
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
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
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
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
Oops, something went wrong.