Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for single serving test #1934

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
${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}
Dismissed Show dismissed Hide dismissed
... ${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']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, interesting - truly moving away from the data-testid to a simple id? Was it removed from the element so we can't use it anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah there is only a data-testid for the internal endpoint option at the moment. If the external route option is enabled there is no data-testid

${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
Loading