From 3f7c687d2b4168f60cdedb3580f479dd02bfde6b Mon Sep 17 00:00:00 2001 From: Conor O'Malley <97108400+ConorOM1@users.noreply.github.com> Date: Fri, 18 Oct 2024 08:52:44 +0100 Subject: [PATCH] Backport PR #1934: Fix for single serving test 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 --- .../ModelServer.resource | 4 +-- .../ODH/ODHDashboard/ODHModelServing.resource | 32 ++++++++++++++++--- .../1005__model_serving_ovms_on_kserve.robot | 4 +-- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource index 2a93203a8..d01ce0c97 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDataScienceProject/ModelServer.resource @@ -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 diff --git a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource index c1b9c70cc..438333a4b 100644 --- a/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource +++ b/ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHModelServing.resource @@ -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"] @@ -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 @@ -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} @@ -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 diff --git a/ods_ci/tests/Tests/1000__model_serving/1005__model_serving_ovms_on_kserve.robot b/ods_ci/tests/Tests/1000__model_serving/1005__model_serving_ovms_on_kserve.robot index 0c3da1869..1eaf6f2f2 100644 --- a/ods_ci/tests/Tests/1000__model_serving/1005__model_serving_ovms_on_kserve.robot +++ b/ods_ci/tests/Tests/1000__model_serving/1005__model_serving_ovms_on_kserve.robot @@ -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