Skip to content

Commit

Permalink
Backport PR red-hat-data-services#1934: Fix for single serving test
Browse files Browse the repository at this point in the history
This is to add UI fixes for ODS-2626 & ODS-2552.
Previous test updates were for multi-model scenario,
the original UI bugs were in the single model server test.

Signed-off-by: manosnoam <[email protected]>
  • Loading branch information
ConorOM1 authored and manosnoam committed Oct 30, 2024
1 parent 15d8a98 commit 3f7c687
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ ${SERVING_MODEL_SERVERS_SIDE_MENU}= xpath=//span[text()='Models and model ser
${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
${REPLICAS_COUNT_XP}= xpath=//input[@id='model-server-replicas']
${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}=${FALSE}
[Arguments] ${no_replicas}=1 ${server_size}=Small ${ext_route}=${TRUE}
... ${token}=${TRUE} ${runtime}=OpenVINO Model Server ${server_name}=Model Serving Test
... ${no_gpus}=0 ${existing_server}=${FALSE}
Move To Tab Models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ ${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_ENDPOINT_INPUT}= /ancestor::tr//td[@data-label="Inference endpoint"]//button[@data-testid='internal-service-button']
${MS_TABLE_ENDPOINT_INPUT}= /ancestor::tr//td[@data-label="Inference endpoint"]//button[@id='copy-button-4']
${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-model-button")]
${DEPLOY_SINGLE_SV_MODEL_BTN}= //button[contains(@data-testid,"single-serving-deploy-button")]
${DEPLOY_MODEL_BTN}= //button[contains(@data-testid,"deploy-button")]
${TOKEN_AUTH_CHECKBOX_XP}= xpath://input[@id="alt-form-checkbox-auth"]


Expand Down Expand Up @@ -131,7 +132,6 @@ 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 @@ -440,10 +440,32 @@ Deploy Kserve Model Via UI #robocop: disable
... ${token}=${FALSE} ${multi_token}=${FALSE} ${multi_service_account_name}=default-name2
... ${public_endpoint}=${TRUE} ${service_account_name}=${NONE}
Move To Tab Models
SeleniumLibrary.Click Button ${DEPLOY_MODEL_BTN}
SeleniumLibrary.Click Button ${DEPLOY_SINGLE_SV_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 @@ -464,7 +486,7 @@ Set Model Server Runtime
[Arguments] ${runtime}=Caikit TGIS
Page Should Contain Element ${KSERVE_RUNTIME_DROPDOWN}
Click Element ${KSERVE_RUNTIME_DROPDOWN}
Click Element ${KSERVE_RUNTIME_DROPDOWN}/..//*[@data-testid="ovms"]
Click Element ${KSERVE_RUNTIME_DROPDOWN}/..//*[@data-testid="kserve-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,12 +170,10 @@ 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=name=modelmesh-serving-test-server
Wait For Pods To Be Ready label_selector=serving.kserve.io/inferenceservice=${model_name}
... namespace=${new_project}
Verify Model Status ${model_name} success
${project_postfix}= Evaluate ${idx}+1
Expand Down

0 comments on commit 3f7c687

Please sign in to comment.