Skip to content

Commit

Permalink
Fix for Authorino TC (red-hat-data-services#1770)
Browse files Browse the repository at this point in the history
* add fix for authorino

Signed-off-by: Milind Waykole <[email protected]>

* add fix for authorino

Signed-off-by: Milind Waykole <[email protected]>

---------

Signed-off-by: Milind Waykole <[email protected]>
Co-authored-by: Milind Waykole <[email protected]>
  • Loading branch information
mwaykole and Milind Waykole authored Sep 3, 2024
1 parent f85a462 commit c636a13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 5 additions & 1 deletion ods_ci/tests/Resources/CLI/ModelServing/llm.resource
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,11 @@ Query Model Multiple Times
... inference_type=${inference_type} model_name=${model_name} body_params=${body_params}
... query_text=${EXP_RESPONSES}[queries][${query_idx}][query_text]
IF "${token}" != "${None}"
Set To Dictionary ${header} Authorization Bearer ${token}
IF "${protocol}" == "grpc"
${header}= Set Variable "Authorization: Bearer ${token}" -H ${header}
ELSE
Set To Dictionary ${header} Authorization Bearer ${token}
END
END
${runtime_details}= Set Variable ${RUNTIME_FORMATS}[${runtime}][endpoints][${inference_type}][${protocol}]
${endpoint}= Set Variable ${runtime_details}[endpoint]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,16 +571,14 @@ Verify User Can Serve And Query A Model With Token
Wait For Pods To Be Ready label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace}
Create Role Binding For Authorino name=${DEFAULT_BUCKET_PREFIX} namespace=${test_namespace}
# TODO: The token created from this keyword does not work to query the model, it will result in a 401 Unauthorized
# error being sent back. Investigate and figure out why, fix the logic.
${inf_token}= Create Inference Access Token ${test_namespace} ${DEFAULT_BUCKET_SA_NAME}
Sleep 600s
Query Model Multiple Times model_name=${flan_model_name}
... inference_type=all-tokens n_times=1
... namespace=${test_namespace} token=${inf_token} protocol=http
... namespace=${test_namespace} token=${inf_token}
Query Model Multiple Times model_name=${flan_model_name}
... inference_type=streaming n_times=1
... namespace=${test_namespace} token=${inf_token} protocol=http
... namespace=${test_namespace} token=${inf_token}
[Teardown] Clean Up Test Project test_ns=${test_namespace}
... isvc_names=${models_names} wait_prj_deletion=${FALSE}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,27 +648,25 @@ Verify User Can Serve And Query A Model With Token
Wait For Pods To Be Ready label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace}
Create Role Binding For Authorino name=${DEFAULT_BUCKET_PREFIX} namespace=tgis-standalone-cli
# TODO: The token created from this keyword does not work to query the model, it will result in a 401 Unauthorized
# error being sent back. Investigate and figure out why, fix the logic.
${inf_token}= Create Inference Access Token ${test_namespace} ${DEFAULT_BUCKET_SA_NAME}
${pod_name}= Get Pod Name namespace=${test_namespace}
... label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
IF ${IS_KSERVE_RAW} Start Port-forwarding namespace=${test_namespace} pod_name=${pod_name}
Query Model Multiple Times model_name=${flan_model_name} runtime=${TGIS_RUNTIME_NAME}
... inference_type=all-tokens n_times=1 protocol=http
... inference_type=all-tokens n_times=1
... namespace=${test_namespace} port_forwarding=${IS_KSERVE_RAW} token=${inf_token}
Query Model Multiple Times model_name=${flan_model_name} runtime=${TGIS_RUNTIME_NAME}
... inference_type=tokenize n_times=1 port_forwarding=${IS_KSERVE_RAW}
... namespace=${test_namespace} validate_response=${TRUE} string_check_only=${TRUE}
... token=${inf_token} protocol=http
... token=${inf_token}
Query Model Multiple Times model_name=${flan_model_name} runtime=${TGIS_RUNTIME_NAME}
... inference_type=model-info n_times=1 port_forwarding=${IS_KSERVE_RAW}
... namespace=${test_namespace} validate_response=${TRUE} string_check_only=${TRUE}
... token=${inf_token} protocol=http
... token=${inf_token}
Query Model Multiple Times model_name=${flan_model_name} runtime=${TGIS_RUNTIME_NAME}
... inference_type=streaming n_times=1 port_forwarding=${IS_KSERVE_RAW}
... namespace=${test_namespace} validate_response=${FALSE}
... token=${inf_token} protocol=http
... token=${inf_token}
[Teardown] Run Keywords
... Clean Up Test Project test_ns=${test_namespace}
... isvc_names=${models_names} wait_prj_deletion=${FALSE}
Expand Down

0 comments on commit c636a13

Please sign in to comment.