Skip to content

Commit

Permalink
UI fixes for failing model serving tests (#1928)
Browse files Browse the repository at this point in the history
Some updates to the UI requires dashboard fixes for the following model
serving tests:
ODS-2626
ODS-2054
  • Loading branch information
CFSNM authored Oct 15, 2024
2 parents 7879910 + caf37bd commit de0998b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ ${TOKEN_AUTH_CHECKBOX_XP}= xpath://input[@id="alt-form-checkbox-auth"]
${ADD_SERVICE_ACCOUNT_BUTTON}= xpath://button[text()='Add a service account']
${SERVICE_ACCOUNT_INPUT}= xpath://input[@data-testid='service-account-form-name']
${REPLICAS_COUNT_XP}= xpath://section[@class='pf-v5-c-form__section']//span[@class='pf-v5-c-form-control']/input
${PROJECT_SELECTOR_XP}= xpath://main[contains(@id, 'dashboard-page-main')]//*[@data-testid="project-selector-dropdown"]
${PROJECT_SELECTOR_XP}= xpath://main[contains(@id, 'dashboard-page-main')]//*[@data-testid="project-selector-toggle"]


*** Keywords ***
Create Model Server
[Documentation] Keyword to create a Model Server in a Data Science Project
[Arguments] ${no_replicas}=1 ${server_size}=Small ${ext_route}=${TRUE}
[Arguments] ${no_replicas}=1 ${server_size}=Small ${ext_route}=${FALSE}
... ${token}=${TRUE} ${runtime}=OpenVINO Model Server ${server_name}=Model Serving Test
... ${no_gpus}=0 ${existing_server}=${FALSE}
Move To Tab Models
Expand All @@ -57,6 +57,7 @@ Create Model Server
END
IF ${ext_route}==${TRUE}
Enable External Serving Route
Wait Until Page Contains Element ${TOKEN_AUTH_CHECKBOX_XP} timeout=10s
IF ${token}==${FALSE}
Disable Token Authentication
ELSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ ${S3_REGION_DC_INPUT_XP}= xpath=//input[@aria-label="Field list AWS_DEF
${S3_BUCKET_DC_INPUT_XP}= xpath=//input[@aria-label="Field list AWS_S3_BUCKET"]
${S3_DEFAULT_BUCKET}= ods-ci-s3
${MS_TABLE_PROJECT}= /../../td[@data-label="Project"]
${MS_TABLE_STATUS}= /../../td[@data-label="Status"]
${MS_TABLE_ENDPOINT}= /../../td[@data-label="Inference endpoint"]
${MS_TABLE_ENDPOINT_INPUT}= ${MS_TABLE_ENDPOINT}//div[@class="pf-v5-c-clipboard-copy"]//input
${MS_TABLE_STATUS_SUCCESS}= //span[contains(@class,"pf-v5-c-icon__content")][contains(@class,"pf-m-success")]
${MS_TABLE_STATUS_FAILURE}= //span[contains(@class,"pf-v5-c-icon__content")][contains(@class,"pf-m-danger")]
${MS_TABLE_ENDPOINT_INPUT}= /ancestor::tr//td[@data-label="Inference endpoint"]//button[@data-testid='internal-service-button']
${MS_TABLE_STATUS_SUCCESS}= /ancestor::tr//td[@data-label="Status"]//span[contains(@class,"pf-m-success")]
${MS_TABLE_STATUS_FAILURE}= /ancestor::tr//td[@data-label="Status"]//span[contains(@class,"pf-m-danger")]
${KSERVE_MODAL_HEADER}= //header[@class="pf-v5-c-modal-box__header"]/h1[.="Deploy model"]
${KSERVE_RUNTIME_DROPDOWN}= //button[@data-testid="serving-runtime-template-selection"]
${LLM_RESOURCES_DIRPATH}= tests/Resources/Files/llm
${DEPLOY_MODEL_BTN}= //button[contains(@data-testid,"deploy")]
${DEPLOY_MODEL_BTN}= //button[contains(@data-testid,"deploy-model-button")]
${TOKEN_AUTH_CHECKBOX_XP}= xpath://input[@id="alt-form-checkbox-auth"]


Expand Down Expand Up @@ -133,6 +131,7 @@ Select Framework
[Arguments] ${framework}
TRY
Open Model framework (name - version) Options Menu
SeleniumLibrary.Wait Until Page Contains Element xpath://span[.="Model framework (name - version)"]
Page Should Contain Element xpath://li/button[contains(., "${framework}")]
Click Element xpath://li/button[contains(., "${framework}")]
EXCEPT
Expand Down Expand Up @@ -179,12 +178,12 @@ Verify Model Status
[Arguments] ${model_name} ${expected_status}=success
IF "${expected_status}"=="success"
SeleniumLibrary.Wait Until Page Contains Element
... //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_SUCCESS} timeout=2m
Page Should Not Contain Element //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_FAILURE}
... //a[@data-testid='metrics-link-test-model' and text()='${model_name}']${MS_TABLE_STATUS_SUCCESS} timeout=2m
Page Should Not Contain Element //a[@data-testid='metrics-link-test-model' and text()='${model_name}']${MS_TABLE_STATUS_FAILURE}
ELSE
SeleniumLibrary.Wait Until Page Contains Element
... //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_FAILURE} timeout=2m
Page Should Not Contain Element //div[.="${model_name} "]${MS_TABLE_STATUS}${MS_TABLE_STATUS_SUCCESS}
... //a[@data-testid='metrics-link-test-model' and text()='${model_name}']${MS_TABLE_STATUS_FAILURE} timeout=2m
Page Should Not Contain Element //a[@data-testid='metrics-link-test-model' and text()='${model_name}']${MS_TABLE_STATUS_SUCCESS}
END

Delete Model Via UI
Expand All @@ -209,7 +208,7 @@ Get Model Route Via UI
[Documentation] Grabs the serving route (URL) of an already deployed model from the Model Serving page.
[Arguments] ${model_name}
# TODO: Open model serving home page if needed?
${route_xpath}= Set Variable xpath://div[.="${model_name} "]${MS_TABLE_ENDPOINT_INPUT}
${route_xpath}= Set Variable //a[.="${model_name}"]${MS_TABLE_ENDPOINT_INPUT}
${loaded}= Run Keyword And Return Status SeleniumLibrary.Wait Until Page Contains Element ${route_xpath} timeout=15s
IF ${loaded} == ${FALSE}
Log message=Model Route was not loaded in UI (RHOAIENG-1919). Trying refreshing! level=WARN
Expand Down Expand Up @@ -444,29 +443,7 @@ Deploy Kserve Model Via UI #robocop: disable
SeleniumLibrary.Click Button ${DEPLOY_MODEL_BTN}
SeleniumLibrary.Wait Until Page Contains Element xpath=${KSERVE_MODAL_HEADER}
Set Model Name ${model_name}
Set Model Server Runtime ${serving_runtime}
Select Framework ${model_framework}
Set Replicas Number With Buttons ${replicas}
Set Server Size ${size}
IF ${public_endpoint}
Enable External Serving Route
# By default this also enables Token Authentication. Let's disable it and let it get re-enable by the next
# IF block if needed.
${token_enabled}= Run Keyword And Return Status SeleniumLibrary.Checkbox Should Be Selected
... ${TOKEN_AUTH_CHECKBOX_XP}
IF ${token_enabled}
Disable Token Authentication
ELSE
Log Token Authentication was supposed to be automatically enabled, but it wasn't level=ERROR
... console=${True}
END
END
IF ${token}
Enable Token Authentication service_account_name=${service_account_name}
IF ${multi_token}
Add Another Service Account ${multi_service_account_name}
END
END
Select Existing Data Connection ${data_connection}
Set Folder Path ${path}
IF ${no_gpus} > ${0}
Expand All @@ -479,15 +456,15 @@ Deploy Kserve Model Via UI #robocop: disable
Set Number of GPU With Buttons ${no_gpus}
END
Click Button Deploy
Wait Until Page Does Not Contain Element xpath=${KSERVE_MODAL_HEADER} timeout=60s
Wait Until Page Does Not Contain Element xpath=//button[@data-testid="modal-submit-button"] timeout=60s

Set Model Server Runtime
[Documentation] Opens the Serving runtime dropdown in the deploy model modal window for models
... and select the given runtime
[Arguments] ${runtime}=Caikit TGIS
Page Should Contain Element ${KSERVE_RUNTIME_DROPDOWN}
Click Element ${KSERVE_RUNTIME_DROPDOWN}
Click Element ${KSERVE_RUNTIME_DROPDOWN}/..//span[contains(text(),"${runtime}")]
Click Element ${KSERVE_RUNTIME_DROPDOWN}/..//*[@data-testid="ovms"]

Get Kserve Inference Host Via UI
[Documentation] Fetches the host of the model's URL from the Data Science Project UI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,12 @@ Create Openvino Models For Kserve # robocop: off=too-many-calls-in-keyword
Recreate S3 Data Connection project_title=${new_project} dc_name=model-serving-connection
... aws_access_key=${S3.AWS_ACCESS_KEY_ID} aws_secret_access=${S3.AWS_SECRET_ACCESS_KEY}
... aws_bucket_name=ods-ci-s3
Create Model Server token=${TRUE} server_name=test-server existing_server=${TRUE}
Wait Until Element Is Visible ${DEPLOY_MODEL_BTN}
Deploy Kserve Model Via UI model_name=${model_name} serving_runtime=OpenVINO Model Server
... data_connection=model-serving-connection path=kserve-openvino-test/openvino-example-model
... model_framework=openvino_ir
Wait For Pods To Be Ready label_selector=serving.kserve.io/inferenceservice=${model_name}
Wait For Pods To Be Ready label_selector=name=modelmesh-serving-test-server
... namespace=${new_project}
Verify Model Status ${model_name} success
${project_postfix}= Evaluate ${idx}+1
Expand Down

0 comments on commit de0998b

Please sign in to comment.