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: Dashboard related model serving issues #2022

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 @@ -103,7 +103,6 @@ Wait For RHODS Dashboard To Load
IF "${expected_page}" == "${NONE}"
Wait Until Page Contains Element //div[@data-testid="home-page"] timeout=${timeout}
ELSE
Menu.Navigate To Page ${expected_page}
Wait Until Keyword Succeeds 3x 5s
... Wait For Dashboard Page Title ${expected_page} timeout=${timeout}
END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ ${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create data science project
${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"]
${DELETE_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Delete project"]
${EDIT_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Edit project"]
${SPAWNER_LINK}= //*[@data-testid="launch-standalone-notebook-server"]
${SPAWNER_LINK}= xpath=//a[@data-testid="launch-standalone-notebook-server"]
${PROJECT_SEARCH_BAR}= [data-testid="projects-table-toolbar"]
${PROJECT_FILTER_TYPE}= ${PROJECT_SEARCH_BAR} [data-testid="filter-toolbar-dropdown"]
${PROJECT_SEARCH_INPUT}= ${PROJECT_SEARCH_BAR} [data-testid="filter-toolbar-text-field"] input

*** Keywords ***
Open Data Science Projects Home Page
[Documentation] Open "Data Science Projects" page from the sidebar
Wait Until Page Contains Data Science Projects
Click Link Data Science Projects
Wait For RHODS Dashboard To Load wait_for_cards=${FALSE} expected_page=Data Science Projects
Maybe Wait For Dashboard Loading Spinner Page

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
${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_SINGLE_SV_MODEL_BTN}= //button[contains(@data-testid,"single-serving-select-button")]
${DEPLOY_SINGLE_SV_MODEL_BTN}= //button[@data-testid="single-serving-select-button"]
${DEPLOY_SINGLE_MODEL_BTN}= //button[contains(@data-testid,"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 @@ -143,14 +143,22 @@
Select Existing Data Connection
[Documentation] Selects an existing data connection in the "deploy model" modal.
[Arguments] ${data_connection_name} ${retries}=1
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

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

IF ${is_enabled}
FOR ${retry_idx} IN RANGE 0 1+${retries}

Check notice

Code scanning / Robocop

Variable '{{ name }}' is assigned but not used Note test

Variable '${retry_idx}' is assigned but not used
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

Check notice

Code scanning / Robocop

'{{ block_name }}' condition can be simplified Note test

'INLINE IF' condition can be simplified
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 @@ -210,22 +218,26 @@
[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 //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
SeleniumLibrary.Reload Page
SeleniumLibrary.Wait Until Page Contains Element ${route_xpath} timeout=15s
END
${url}= SeleniumLibrary.Get Element Attribute ${route_xpath} value
# Click on Inference Endpoints link
${endpoint_link}= Set Variable //a[@data-testid="metrics-link-test-model" and text()="${model_name}"]/ancestor::tr//td//button[@data-testid="internal-external-service-button"]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (185/120)
SeleniumLibrary.Wait Until Page Contains Element ${endpoint_link}
SeleniumLibrary.Click Button ${endpoint_link}
# Get the external URL
${route_xpath}= Set Variable //span[text()="External (can be accessed from inside or outside the cluster)"]/ancestor::dl//dd/div/div/span[1]

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (150/120)
SeleniumLibrary.Wait Until Page Contains Element //div[@data-testid="external-service-popover"]
SeleniumLibrary.Wait Until Page Contains Element ${route_xpath}
# Get the URL
Sleep 2 reason=The element takes a little bit longer than expected rendering the url
${url}= Get Text ${route_xpath}
${kserve}= Run Keyword And Return Status SeleniumLibrary.Page Should Contain Single-model serving enabled
IF ${kserve}
${url}= Catenate SEPARATOR= ${url} /v2/models/${model_name}/infer
END
RETURN ${url}


Get Model Route for gRPC Via UI

Check warning

Code scanning / Robocop

Invalid number of empty lines between keywords ({{ empty_lines }}/{{ allowed_empty_lines }}) Warning test

Invalid number of empty lines between keywords (2/1)
[Arguments] ${model_name}
[Arguments] ${model_name}
${host_url}= Get Model Route Via UI model_name=${model_name}
${host}= Evaluate re.search(r"${GRPC_URL_REGEX}", r"${host_url}").group(1) re
RETURN ${host}
Expand Down
Loading