Skip to content

Commit

Permalink
Fix Verify User Can Validate Scale To Zero test case (#1788)
Browse files Browse the repository at this point in the history
* Skip processing the json response if the query fails

* Add connect timout flag to grpcurl

* Use Query Model Multiple Times instead of GRPCURL command directly, add connect timeout
  • Loading branch information
hdefazio authored Sep 17, 2024
1 parent c7f1187 commit f42b7ae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
3 changes: 2 additions & 1 deletion ods_ci/tests/Resources/CLI/ModelServing/llm.resource
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ Query Model Multiple Times
... ${validate_response}=${TRUE}
... ${string_check_only}=${FALSE}
... ${protocol}=grpc
... ${connect_timeout}=10
... ${port_forwarding}=${FALSE}
... ${port}=443
... ${body_params}=&{EMPTY}
Expand Down Expand Up @@ -378,7 +379,7 @@ Query Model Multiple Times
... endpoint=${endpoint}
... json_body=${body} json_header=${header}
... insecure=${insecure} plaintext=${plaintext} skip_res_json=${skip_json_load_response}
... cert=${cert} &{args}
... cert=${cert} connect_timeout=${connect_timeout} &{args}
ELSE IF "${protocol}" == "http"
${payload}= ODHDashboardAPI.Prepare Payload body=${body} str_to_json=${TRUE}
Log Dictionary ${args}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ Query Model With GRPCURL
... ${background}=${NONE}
... ${skip_res_json}=${FALSE}
... ${cert}=${False}
... ${connect_timeout}=10
... &{args}
${cmd}= Set Variable grpcurl -d ${json_body}
${cmd}= Set Variable grpcurl -connect-timeout ${connect_timeout} -d ${json_body}
IF $json_header != None
${cmd}= Catenate ${cmd} -H ${json_header}
END
Expand All @@ -277,15 +278,17 @@ Query Model With GRPCURL
${cmd}= Catenate ${cmd} ${endpoint}
IF '${background}' == '${NONE}'
# ${rc} ${response}= Run And Return Rc And Output ${cmd}
Log ${cmd} console=yes
${query_process}= Run Process command=${cmd} stderr=STDOUT shell=yes
# Run Keyword And Continue On Failure Should Be Equal As Integers ${query_process.rc} ${0}
${rc}= Set Variable ${query_process.rc}
Run Keyword And Continue On Failure Should Be Equal As Integers ${rc} ${0}
# Log ${query_process.stdout} console=yes
${response}= Set Variable ${query_process.stdout}
Log ${response} console=yes
Log ${rc} console=yes
# ${json_res}= Load Json String ${query_process.stdout}
IF ${skip_res_json} == ${TRUE}
IF ${rc} != ${0} or ${skip_res_json} == ${TRUE}
Log ${response}
RETURN ${response}
ELSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,23 +282,16 @@ Verify User Can Validate Scale To Zero # robocop: off=too-long-test-case,too-
... namespace=${test_namespace}
Wait For Model KServe Deployment To Be Ready label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace} runtime=${CAIKIT_TGIS_RUNTIME_NAME}
${host}= Get KServe Inference Host Via CLI isvc_name=${flan_model_name} namespace=${test_namespace}
${body}= Set Variable '{"text": "At what temperature does liquid Nitrogen boil?"}'
${header}= Set Variable 'mm-model-id: ${flan_model_name}'
Query Model With GRPCURL host=${host} port=443
... endpoint="caikit.runtime.Nlp.NlpService/TextGenerationTaskPredict"
... json_body=${body} json_header=${header}
... insecure=${TRUE}
Query Model Multiple Times model_name=${flan_model_name} n_times=1 connect_timeout=300
... namespace=${test_namespace} runtime=${CAIKIT_TGIS_RUNTIME_NAME}
Set Minimum Replicas Number n_replicas=0 model_name=${flan_model_name}
... namespace=${test_namespace}
Wait For Model KServe Deployment To Be Ready label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace} runtime=${CAIKIT_TGIS_RUNTIME_NAME} exp_replicas=${2}
Wait For Pods To Be Terminated label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace}
Query Model With GRPCURL host=${host} port=443
... endpoint="caikit.runtime.Nlp.NlpService/TextGenerationTaskPredict"
... json_body=${body} json_header=${header}
... insecure=${TRUE}
Query Model Multiple Times model_name=${flan_model_name} n_times=1 connect_timeout=300
... namespace=${test_namespace} runtime=${CAIKIT_TGIS_RUNTIME_NAME}
Wait For Model KServe Deployment To Be Ready label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace} runtime=${CAIKIT_TGIS_RUNTIME_NAME}
Wait For Pods To Be Terminated label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ Verify User Can Validate Scale To Zero # robocop: off=too-long-test-case,too-
... namespace=${test_namespace} runtime=${TGIS_RUNTIME_NAME} exp_replicas=${2}
Wait For Pods To Be Terminated label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace}
Query Model Multiple Times model_name=${flan_model_name} runtime=${TGIS_RUNTIME_NAME} n_times=1
... namespace=${test_namespace}
Query Model Multiple Times model_name=${flan_model_name} n_times=1 connect_timeout=300
... namespace=${test_namespace} runtime=${TGIS_RUNTIME_NAME}
Wait For Model KServe Deployment To Be Ready label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
... namespace=${test_namespace} runtime=${TGIS_RUNTIME_NAME}
Wait For Pods To Be Terminated label_selector=serving.kserve.io/inferenceservice=${flan_model_name}
Expand Down

0 comments on commit f42b7ae

Please sign in to comment.