Skip to content

Commit

Permalink
[UI] Runtime framework selection in model deployment - dropdown is av…
Browse files Browse the repository at this point in the history
…ailable only if there's multiple selection (#2051)

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

jenkins - job/rhoai-test-flow/1616/console (isvc fails on product bug
but issues in this pr are working)
  • Loading branch information
rnetser authored Nov 21, 2024
2 parents 4bc622f + 9ce2028 commit 78316c4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 23 deletions.
5 changes: 4 additions & 1 deletion ods_ci/tests/Resources/Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ Wait Until Generic Modal Disappears
${is_modal}= Is Generic Modal Displayed
IF ${is_modal} == ${TRUE}
IF ${partial_match} == ${TRUE}
Wait Until Page Does Not Contain Element xpath=//*[contains(@id,"${id}")] timeout=${timeout}
${is_displayed}= Run Keyword And Return Status xpath=//*[contains(@id,"${id}")] timeout=${timeout}
IF ${is_displayed}
Wait Until Page Does Not Contain Element xpath=//*[contains(@id,"${id}")] timeout=${timeout}
END
ELSE
Wait Until Page Does Not Contain Element xpath=//*[@id="${id}")] timeout=${timeout}
END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
- '--served-model-name={{.Name}}'
- '--distributed-executor-backend=mp'
- '--chat-template=/app/data/template/template_chatml.jinja'
image: ${runtime_image}
image: quay.io/modh/vllm@sha256:167aa05982214c3941afbdde7c5aff6f81040193a0db1dc06a5ad16af0a8780e
name: kserve-container
command:
- python3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Resource ODHDataScienceProject/ModelServer.resource
Resource ODHDataScienceProject/DataConnections.resource
Resource ../../../CLI/ModelServing/llm.resource
Library ../../../../../libs/Helpers.py
Library RPA.Desktop


*** Variables ***
Expand Down Expand Up @@ -124,41 +125,47 @@ Select Model Server
${selectable}= Run Keyword And Return Status
... Wait Until Element Is Visible xpath://span[.="Model servers"]/../../..//button[@aria-label="Options menu"] timeout=3
IF ${selectable}==True
Open Model servers Options Menu # robocop:disable
Click Element xpath://button[@id="serving-runtime-template-selection"]
Click Element xpath://li/button[.="${model_server}"]
END

Select Framework
[Documentation] Selects the framework in the "deploy model" modal.
... Possible values for now: "onnx", "openvino_ir"
[Arguments] ${framework}
[Arguments] ${framework} ${retries}=1
TRY
Open Model framework (name - version) Options Menu
Page Should Contain Element xpath://li/button[contains(., "${framework}")]
Click Element xpath://li/button[contains(., "${framework}")]
${is_enabled}= Run Keyword And Return Status
... Element Should Be Enabled xpath://button[@id="inference-service-framework-selection"]

IF ${is_enabled}
FOR ${retry_idx} IN RANGE 0 1+${retries}
Click Element xpath://button[@id="inference-service-framework-selection"]
Page Should Contain Element xpath://span[contains(., "${framework}")]
${selected}= Run Keyword And Return Status
... Click Element xpath://span[contains(., "${framework}")]
IF ${selected}==${TRUE} BREAK
END
ELSE
Element Should Be Disabled id:inference-service-framework-selection
${text}= Get Text xpath://button[@id="inference-service-framework-selection"]/span
Should Be True ${framework} in ${text}
END
EXCEPT
Log framework ${framework} does not appear to be supported by the chosen model server
END
END


Select Existing Data Connection
[Documentation] Selects an existing data connection in the "deploy model" modal.
[Arguments] ${data_connection_name} ${retries}=1

${is_enabled}= Run Keyword And Return Status
... Element Should Be Enabled xpath://button[@id="inference-service-data-connection"]

IF ${is_enabled}
FOR ${retry_idx} IN RANGE 0 1+${retries}
Open Name Options Menu
Click Element xpath://li/button[.="${data_connection_name}"]
${selected}= Run Keyword And Return Status
... Page Should Contain Element //span[.="Name"]/../../..//button[@aria-label="Options menu"][.="${data_connection_name}"] #robocop: disable
IF ${selected}==${TRUE} BREAK
FOR ${retry_idx} IN RANGE 0 1+${retries}
Click Element xpath://button[@class="pf-v5-c-menu-toggle__button"]
Click Element xpath://button[@class="pf-v5-c-menu__item"]/span/span[contains(., "${data_connection_name}")]
${selected}= Get Element Attribute //span[@class="pf-v5-c-text-input-group__text"]/input value
IF "${selected}"=="${data_connection_name}"
BREAK
END
ELSE
Element Should Be Disabled id:inference-service-data-connection
${text}= Get Text xpath://button[@id="inference-service-data-connection"]/span/div/div
Should Be Equal ${text} ${data_connection_name}
END

Set Folder Path
Expand Down Expand Up @@ -511,7 +518,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}/..//span[contains(text(),"${runtime}")]
Click Element //span[contains(text(),"${runtime}")]

Get Kserve Inference Host Via UI
[Documentation] Fetches the host of the model's URL from the Data Science Project UI
Expand Down

0 comments on commit 78316c4

Please sign in to comment.