Skip to content

Commit

Permalink
Merge branch 'master' into amd_nfd_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bdattoma authored Jan 7, 2025
2 parents a8798ac + 1157066 commit ea81b9d
Show file tree
Hide file tree
Showing 66 changed files with 583 additions and 616 deletions.
2 changes: 1 addition & 1 deletion ods_ci/rhods_install_configuration.yaml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RHODS_INSTALL:
INSTALL_TYPE: CLi
INSTALL_TYPE: Cli
TEST_ENV: AWS
cluster_type: managed
operator_version: quay.io/modh/qe-catalog-source:latest
Expand Down
6 changes: 3 additions & 3 deletions ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Install RHODS
${csv_display_name} = Set Variable ${RHODS_CSV_DISPLAY}
END
IF "${cluster_type}" == "selfmanaged"
IF "${TEST_ENV}" in "${SUPPORTED_TEST_ENV}" and "${INSTALL_TYPE}" == "CLi"
IF "${TEST_ENV}" in "${SUPPORTED_TEST_ENV}" and "${INSTALL_TYPE}" == "Cli"
Install RHODS In Self Managed Cluster Using CLI ${cluster_type} ${image_url}
ELSE IF "${TEST_ENV}" in "${SUPPORTED_TEST_ENV}" and "${INSTALL_TYPE}" == "OperatorHub"
${file_path} = Set Variable tasks/Resources/RHODS_OLM/install/
Expand All @@ -63,12 +63,12 @@ Install RHODS
FAIL Provided test environment and install type is not supported
END
ELSE IF "${cluster_type}" == "managed"
IF "${TEST_ENV}" in "${SUPPORTED_TEST_ENV}" and "${INSTALL_TYPE}" == "CLi" and "${UPDATE_CHANNEL}" == "odh-nightlies"
IF "${TEST_ENV}" in "${SUPPORTED_TEST_ENV}" and "${INSTALL_TYPE}" == "Cli" and "${UPDATE_CHANNEL}" == "odh-nightlies"
# odh-nightly is not build for Managed, it is only possible for Self-Managed
Set Global Variable ${OPERATOR_NAMESPACE} openshift-marketplace
Install RHODS In Self Managed Cluster Using CLI ${cluster_type} ${image_url}
Set Global Variable ${OPERATOR_NAME} opendatahub-operator
ELSE IF "${TEST_ENV}" in "${SUPPORTED_TEST_ENV}" and "${INSTALL_TYPE}" == "CLi"
ELSE IF "${TEST_ENV}" in "${SUPPORTED_TEST_ENV}" and "${INSTALL_TYPE}" == "Cli"
Install RHODS In Managed Cluster Using CLI ${cluster_type} ${image_url}
ELSE
FAIL Provided test environment is not supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Is RHODS Installed
Log Checking if RHODS is installed with "${clusterType}" "${UPDATE_CHANNEL}" "${INSTALL_TYPE}" console=yes
IF "${cluster_type}" == "selfmanaged"
IF "${INSTALL_TYPE}" == "CLi"
IF "${INSTALL_TYPE}" == "Cli"
${result}= Run Keyword And Return Status
... Run Keywords
... Check A RHODS Family Operator Is Installed namespace=${OPERATOR_NAMESPACE}
Expand Down
2 changes: 1 addition & 1 deletion ods_ci/tasks/Resources/RHODS_OLM/uninstall/uninstall.robot
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Uninstall RHODS In OSD

Uninstall RHODS In Self Managed Cluster
[Documentation] Uninstall rhods from self-managed cluster
IF "${INSTALL_TYPE}" == "CLi"
IF "${INSTALL_TYPE}" == "Cli"
Uninstall RHODS In Self Managed Cluster Using CLI
ELSE IF "${INSTALL_TYPE}" == "OperatorHub"
Uninstall RHODS In Self Managed Cluster For Operatorhub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ${ACCELERATOR_RESOURCES_DIRPATH}= tests/Resources/Files/accelerator
Create An Accelerator Profile Via CLI
[Documentation] Create an instance of Accelerator Profile using OC
[Arguments] ${name} ${ns}=${APPLICATIONS_NAMESPACE}
${status}= Run Keyword And Return Status Oc Create kind=AcceleratorProfile
${status}= Run Keyword And Return Status Oc Apply kind=AcceleratorProfile
... src=${ACCELERATOR_RESOURCES_DIRPATH}/${name}.yaml namespace=${ns}
... template_data={test_name: '${TEST_NAME}', test_ns: '${ns}'}
Should Be Equal As Integers ${status} ${TRUE}
Expand Down
50 changes: 36 additions & 14 deletions ods_ci/tests/Resources/Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ Begin Web Test
... ODH dashboard, checking that the spawner is in a ready state before
... handing control over to the test suites.
[Arguments] ${username}=${TEST_USER.USERNAME} ${password}=${TEST_USER.PASSWORD}
... ${auth_type}=${TEST_USER.AUTH_TYPE}
... ${auth_type}=${TEST_USER.AUTH_TYPE} ${jupyter_login}=${TRUE}
Set Library Search Order SeleniumLibrary
RHOSi Setup
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS}
Login To RHODS Dashboard ${username} ${password} ${auth_type}
Wait For RHODS Dashboard To Load
Launch Jupyter From RHODS Dashboard Link
Login To Jupyterhub ${username} ${password} ${auth_type}
${authorization_required} = Is Service Account Authorization Required
IF ${authorization_required} Authorize jupyterhub service account
Fix Spawner Status
Go To ${ODH_DASHBOARD_URL}
IF ${jupyter_login}
Launch Jupyter From RHODS Dashboard Link
Login To Jupyterhub ${username} ${password} ${auth_type}
${authorization_required}= Is Service Account Authorization Required
IF ${authorization_required} Authorize JupyterLab Service Account
Fix Spawner Status
Go To ${ODH_DASHBOARD_URL}
END

End Web Test
[Arguments] ${username}=${TEST_USER.USERNAME}
Expand Down Expand Up @@ -119,11 +121,21 @@ Get All Text Under Element
${elements}= Get WebElements ${parent_element}
${text_list}= Create List
FOR ${element} IN @{elements}
${text}= Get Element Attribute ${element} textContent
${text}= Run Keyword And Ignore Error
... Get Element Attribute ${element} textContent
Append To List ${text_list} ${text}
END
RETURN ${text_list}

Scroll And Input Text Into Element
[Documentation] Scrolls element into view and inputs text into the element
[Arguments] ${element} ${text}
Scroll Element Into View ${element}
${text_entered}= Run Keyword And Return Status Input Text ${element} ${text}
IF ${text_entered} RETURN
Click Element ${element}
Press Keys NONE ${text}

Get All Strings That Contain
[Documentation] Returns new list of strings, for each item in ${list_of_strings} that contains ${substring_to_search}
[Arguments] ${list_of_strings} ${substring_to_search}
Expand Down Expand Up @@ -589,11 +601,21 @@ Skip If Operator Starting Version Is Not Supported
Skip If condition="${supported}"=="${FALSE}" msg=This test is skipped because starting operator version < ${minimum_version}

Skip If Cluster Type Is Self-Managed
[Documentation] Skips test if cluster type is Self-managed
${cluster_type}= Is Cluster Type Self-Managed
Skip If condition=${cluster_type}==True msg=This test is skipped for Self-managed cluster
[Documentation] Skips test if cluster type is Self-managed
${cluster_type}= Is Cluster Type Managed
Skip If condition=${cluster_type}==False msg=This test is skipped for Self-managed cluster

Skip If Cluster Type Is Managed
[Documentation] Skips test if cluster type is Managed
${cluster_type}= Is Cluster Type Self-Managed
Skip If condition=${cluster_type}==False msg=This test is skipped for Managed cluster
[Documentation] Skips test if cluster type is Managed
${cluster_type}= Is Cluster Type Managed
Skip If condition=${cluster_type}==True msg=This test is skipped for Managed cluster

Delete All ${resource_type} In Namespace By Name
[Documentation] Force delete all ${resource_type} named '${resource_type}' in namespace '${namespace}'
[Arguments] ${namespace} ${resource_name}
${list_resources} = Set Variable oc -n ${namespace} get ${resource_type} -o name | grep /${resource_name}
${xargs_patch} = Set Variable xargs -rt oc -n ${namespace} patch --type=json -p '[{"op": "add", "path": "/metadata/ownerReferences", "value": null}]'
${xargs_delete} = Set Variable xargs -rt oc -n ${namespace} delete
${result} = Run Process ${list_resources} | ${xargs_patch} && ${list_resources} | ${xargs_delete}
... shell=true stderr=STDOUT
Log ${result.stdout} console=yes
33 changes: 22 additions & 11 deletions ods_ci/tests/Resources/OCP.resource
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,28 @@ Wait For Namespace To Be Active
Log ${value}
Should Be Equal As Integers ${rc} 0

Is Cluster Type Self-Managed
[Documentation] Get the value of cluster type depending on the console URL domain
... Returns ${TRUE} if cluster type is Self-Managed
... Returns ${FALSE} if cluster type is Managed
${matches}= Get Regexp Matches ${OCP_CONSOLE_URL} rh-ods
${size}= Get Length ${matches}
IF ${size}>0
${domain}= Get From List ${matches} 0
IF "${domain}" == "rh-ods"
RETURN ${TRUE}
END
Is Cluster Type Managed
[Documentation] Find the cluster type based on output of the infrastructure of the cluster
... Returns ${TRUE} if cluster type is Managed
... Returns ${FALSE} if cluster type is Self-Managed
${rc} ${output}= Run And Return Rc And Output
... oc get infrastructure cluster -o jsonpath='{.status.platformStatus.*.resourceTags[?(@.key=="red-hat-managed")].value}'
Should Be Equal As Integers ${rc} 0
IF "${output}" == "true"
RETURN ${TRUE}
ELSE
RETURN ${FALSE}
END

Is Test Enviroment ROSA-HCP
[Documentation] Find the test environment based on output of the infrastructure of the cluster
... Returns ${TRUE} if test environment is ROSA_HCP
... Returns ${FALSE} if test environment is not ROSA_HCP
${rc} ${output}= Run And Return Rc And Output
... oc get infrastructure cluster -o jsonpath='{.metadata.labels.hypershift\\.openshift\\.io/managed}'
Should Be Equal As Integers ${rc} 0
IF "${output}" == "true"
RETURN ${TRUE}
ELSE
RETURN ${FALSE}
END
6 changes: 4 additions & 2 deletions ods_ci/tests/Resources/Page/Components/Menu.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Settings ***
Library JupyterLibrary
Library String
Resource ../ODH/ODHDashboard/ODHDashboard.robot
Library String
Library JupyterLibrary

*** Keywords ***
Navigate To Page
Expand All @@ -17,6 +18,7 @@ Navigate To Page
IF "${is_menu_expanded}" == "false" Menu.Click Menu ${menu}
Wait Until Page Contains ${submenu}
Menu.Click Submenu ${submenu}
Run Keyword And Ignore Error Wait For Dashboard Page Title ${submenu}

Click Menu
[Arguments]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documentation This is a resource file for Distributed Workloads.
Library OperatingSystem
Library Process
Resource ../../../../tasks/Resources/RHODS_OLM/install/oc_install.robot


*** Variables ***
Expand Down Expand Up @@ -34,8 +35,8 @@ ${NOTEBOOK_IMAGE_3.11} quay.io/modh/odh-generic-data-science-n
${NOTEBOOK_IMAGE_3.9} quay.io/modh/odh-generic-data-science-notebook@sha256:b1066204611b4bcfa6172c3115650a8e8393089d5606458fa0d8c53633d2ce17
${NOTEBOOK_USER_NAME} ${TEST_USER_3.USERNAME}
${NOTEBOOK_USER_PASSWORD} ${TEST_USER_3.PASSWORD}
${KFTO_CORE_BINARY_NAME} kfto
${KFTO_UPGRADE_BINARY_NAME} kfto-upgrade
${FMS_BINARY_NAME} fms
${KFTO_BINARY_NAME} kfto
${ODH_BINARY_NAME} odh
${PIP_INDEX_URL} ${PIP_INDEX_URL}
${PIP_TRUSTED_HOST} ${PIP_TRUSTED_HOST}
Expand Down Expand Up @@ -104,13 +105,13 @@ Cleanup Codeflare-SDK Setup
Log To Console "Removing directory ${CODEFLARE-SDK_DIR}"
Remove Directory ${CODEFLARE-SDK_DIR} recursive=True

Prepare Training Operator E2E Core Test Suite
[Documentation] Prepare Training Operator E2E Core Test Suite
Prepare Training Operator E2E Test Suite ${KFTO_CORE_BINARY_NAME}
Prepare Training Operator KFTO E2E Test Suite
[Documentation] Prepare Training Operator KFTO E2E Test Suite
Prepare Training Operator E2E Test Suite ${KFTO_BINARY_NAME}

Prepare Training Operator E2E Upgrade Test Suite
[Documentation] Prepare Training Operator E2E Upgrade Test Suite
Prepare Training Operator E2E Test Suite ${KFTO_UPGRADE_BINARY_NAME}
Prepare Training Operator FMS E2E Test Suite
[Documentation] Prepare Training Operator FMS E2E Test Suite
Prepare Training Operator E2E Test Suite ${FMS_BINARY_NAME}

Prepare Training Operator E2E Test Suite
[Documentation] Prepare Training Operator E2E Test Suite
Expand All @@ -127,13 +128,13 @@ Prepare Training Operator E2E Test Suite
Enable Component trainingoperator
Wait Component Ready trainingoperator

Teardown Training Operator E2E Core Test Suite
[Documentation] Prepare Training Operator E2E Core Test Suite
Teardown Training Operator E2E Test Suite ${KFTO_CORE_BINARY_NAME}
Teardown Training Operator KFTO E2E Test Suite
[Documentation] Teardown Training Operator KFTO E2E Test Suite
Teardown Training Operator E2E Test Suite ${KFTO_BINARY_NAME}

Teardown Training Operator E2E Upgrade Test Suite
[Documentation] Prepare Training Operator E2E Upgrade Test Suite
Teardown Training Operator E2E Test Suite ${KFTO_UPGRADE_BINARY_NAME}
Teardown Training Operator FMS E2E Test Suite
[Documentation] Teardown Training Operator FMS E2E Test Suite
Teardown Training Operator E2E Test Suite ${FMS_BINARY_NAME}

Teardown Training Operator E2E Test Suite
[Documentation] Teardown Training Operator E2E Test Suite
Expand All @@ -142,27 +143,17 @@ Teardown Training Operator E2E Test Suite
Remove File ${test_binary}
Disable Component trainingoperator

Run Training Operator ODH Core Test
[Documentation] Run Training Operator ODH Core Test
Run Training Operator FMS Test
[Documentation] Run Training Operator FMS Test
[Arguments] ${TEST_NAME}
Run Training Operator ODH Test ${TEST_NAME} ${KFTO_CORE_BINARY_NAME}

Run Training Operator ODH Upgrade Test
[Documentation] Run Training Operator ODH Upgrade Test
[Arguments] ${TEST_NAME}
Run Training Operator ODH Test ${TEST_NAME} ${KFTO_UPGRADE_BINARY_NAME}

Run Training Operator ODH Test
[Documentation] Run Training Operator ODH Test
[Arguments] ${TEST_NAME} ${test_binary}
Log To Console "Running test: ${TEST_NAME}"
${result} = Run Process ./${test_binary} -test.run ${TEST_NAME}
${result} = Run Process ./${FMS_BINARY_NAME} -test.run ${TEST_NAME}
... shell=true
... stderr=STDOUT
... env:CODEFLARE_TEST_TIMEOUT_SHORT=5m
... env:CODEFLARE_TEST_TIMEOUT_MEDIUM=10m
... env:CODEFLARE_TEST_TIMEOUT_LONG=20m
... env:CODEFLARE_TEST_OUTPUT_DIR=%{WORKSPACE}/codeflare-${test_binary}-logs
... env:CODEFLARE_TEST_OUTPUT_DIR=%{WORKSPACE}/codeflare-${FMS_BINARY_NAME}-logs
... env:FMS_HF_TUNING_IMAGE=${FMS_HF_TUNING_IMAGE}
Log To Console ${result.stdout}
Check missing Go test ${result.stdout}
Expand All @@ -174,13 +165,13 @@ Run Training Operator KFTO Test
[Documentation] Run Training Operator KFTO Test
[Arguments] ${TEST_NAME} ${TRAINING_IMAGE}
Log To Console "Running test: ${TEST_NAME}"
${result} = Run Process ./${KFTO_CORE_BINARY_NAME} -test.run ${TEST_NAME}
${result} = Run Process ./${KFTO_BINARY_NAME} -test.run ${TEST_NAME}
... shell=true
... stderr=STDOUT
... env:CODEFLARE_TEST_TIMEOUT_SHORT=5m
... env:CODEFLARE_TEST_TIMEOUT_MEDIUM=10m
... env:CODEFLARE_TEST_TIMEOUT_LONG=20m
... env:CODEFLARE_TEST_OUTPUT_DIR=%{WORKSPACE}/codeflare-${KFTO_CORE_BINARY_NAME}-logs
... env:CODEFLARE_TEST_OUTPUT_DIR=%{WORKSPACE}/codeflare-${KFTO_BINARY_NAME}-logs
... env:CODEFLARE_TEST_TRAINING_IMAGE=${TRAINING_IMAGE}
Log To Console ${result.stdout}
Check missing Go test ${result.stdout}
Expand Down Expand Up @@ -256,3 +247,17 @@ Check missing Go test
[Documentation] Check that upstream Go test is not missing
[Arguments] ${test_run_output}
Should Not Contain ${test_run_output} testing: warning: no tests to run No Go tests were run

Verify container images
[Documentation] Verify container images
[Arguments] ${pod_name} ${container} ${expected_image}
${test_env}= Is Test Enviroment ROSA-HCP
# We use Kyverno custom policies to pull unreleased images from quay registry for hypershift clusters
${registry_name} = Set Variable If ${test_env}==True
... quay.io
... registry.redhat.io
Log To Console Verifying ${pod_name}'s container image is referred from ${registry_name}
${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=${pod_name}
Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} ${container}
... ${registry_name}/rhoai/${expected_image}
Log To Console ${pod_name}'s container image is verified
Loading

0 comments on commit ea81b9d

Please sign in to comment.