From c784b0e152b2479382d28db6e26d5fad251d8b00 Mon Sep 17 00:00:00 2001 From: mattmahoneyrh Date: Thu, 26 Sep 2024 14:44:12 -0400 Subject: [PATCH 1/4] Add ModelRegistry Namespace Check --- .../0113__dsc_components.robot | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot index 96331f13e..a1423bef4 100644 --- a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot +++ b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot @@ -193,6 +193,9 @@ Validate ModelRegistry Managed State Set DSC Component Managed State And Wait For Completion modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} + # Check if Deployment exists in expected namespace + Check Model Registry Deployment Namespace + [Teardown] Restore DSC Component State modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.MODELREGISTRY} Validate ModelRegistry Removed State @@ -382,3 +385,19 @@ Check Image Pull Path Is Redhatio ELSE Fail Deployment image ${deployment_name} does not contain pull path registry.redhat.io END + +Check Model Registry Deployment Namespace + [Documentation] Check that Model Registry is deployed into namespace as defined in DSC modelregistry.registriesNamespace + + # Get expected namespace + ${rc} ${expected_namespace}= Run And Return Rc And Output + ... oc get DataScienceCluster/${DSC_NAME} -n ${OPERATOR_NS} -o "jsonpath={".spec.components.modelregistry.registriesNamespace"}" + Should Be Equal As Integers ${rc} 0 msg=${expected_namespace} + + # Get actual namespace + ${rc} ${actual_namespace}= Run And Return Rc And Output + ... oc get deployments -A | grep ${MODELREGISTRY_CONTROLLER_DEPLOYMENT_NAME} | awk '{print$1}' + Should Be Equal As Integers ${rc} 0 msg=${actual_namespace} + + Log To Console Model Registry Namespace: Actual "${actual_namespace}" Expected: "${expected_namespace} + Should Be Equal ${actual_namespace} ${expected_namespace} From d498f03729ec2fa39af39348a70a171518d2989d Mon Sep 17 00:00:00 2001 From: mattmahoneyrh Date: Mon, 30 Sep 2024 13:26:28 -0400 Subject: [PATCH 2/4] RHOAIENG-12703- Add ModelRegistry Namespace Check --- .../0113__dsc_components.robot | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot index a1423bef4..42b682683 100644 --- a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot +++ b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot @@ -193,8 +193,7 @@ Validate ModelRegistry Managed State Set DSC Component Managed State And Wait For Completion modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} - # Check if Deployment exists in expected namespace - Check Model Registry Deployment Namespace + Check Model Registry Namespace [Teardown] Restore DSC Component State modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.MODELREGISTRY} @@ -202,8 +201,15 @@ Validate ModelRegistry Removed State [Documentation] Validate that ModelRegistry management state Removed does remove relevant resources. [Tags] Operator Tier1 RHOAIENG-10404 modelregistry-removed ExcludeOnRHOAI + # Properly validate Removed state by first setting to Manged, which will ensure that namspace + # was created as needed for later validating that namespace persisted when component is Removed + [Setup] Set DSC Component Managed State And Wait For Completion modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} + Set DSC Component Removed State And Wait For Completion modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} + # Note: Model Registry namespace will not be deleted when component state changed from Manged to Removed + Check Model Registry Namespace + [Teardown] Restore DSC Component State modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.MODELREGISTRY} Validate KServe Controller Manager Managed State @@ -386,18 +392,16 @@ Check Image Pull Path Is Redhatio Fail Deployment image ${deployment_name} does not contain pull path registry.redhat.io END -Check Model Registry Deployment Namespace - [Documentation] Check that Model Registry is deployed into namespace as defined in DSC modelregistry.registriesNamespace +Check Model Registry Namespace + [Documentation] Check that DSC modelregistry.registriesNamespace is correct for ODH/RHOAI + ... Validate that namespace exists. - # Get expected namespace - ${rc} ${expected_namespace}= Run And Return Rc And Output + ${rc} ${namespace}= Run And Return Rc And Output ... oc get DataScienceCluster/${DSC_NAME} -n ${OPERATOR_NS} -o "jsonpath={".spec.components.modelregistry.registriesNamespace"}" - Should Be Equal As Integers ${rc} 0 msg=${expected_namespace} + Should Be Equal As Integers ${rc} 0 msg=${namespace} - # Get actual namespace - ${rc} ${actual_namespace}= Run And Return Rc And Output - ... oc get deployments -A | grep ${MODELREGISTRY_CONTROLLER_DEPLOYMENT_NAME} | awk '{print$1}' - Should Be Equal As Integers ${rc} 0 msg=${actual_namespace} + Should Be Equal ${namespace} ${MODEL_REGISTRY_NAMESPACE} msg=Model Registry Namespace: Actual "${namespace}" Expected: "${MODEL_REGISTRY_NAMESPACE} - Log To Console Model Registry Namespace: Actual "${actual_namespace}" Expected: "${expected_namespace} - Should Be Equal ${actual_namespace} ${expected_namespace} + ${rc} ${output}= Run And Return Rc And Output + ... oc get namespace -A ${MODEL_REGISTRY_NAMESPACE} + Should Be Equal As Integers ${rc} 0 msg=${output} From 0e8ac929805f3d34cd6a325f3173849ab54433aa Mon Sep 17 00:00:00 2001 From: mattmahoneyrh Date: Thu, 19 Sep 2024 09:14:38 -0400 Subject: [PATCH 3/4] RHOAIENG-12022 - Enable Modelregistry For RHOAI --- .../0104__rhods_operator/0113__dsc_components.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot index 42b682683..e78b24b0a 100644 --- a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot +++ b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot @@ -189,7 +189,7 @@ Validate Modelmeshserving Removed State Validate ModelRegistry Managed State [Documentation] Validate that the DSC ModelRegistry component Managed state creates the expected resources, ... check that ModelRegistry deployment is created and pod is in Ready state - [Tags] Operator Tier1 RHOAIENG-10404 modelregistry-managed ExcludeOnRHOAI + [Tags] Operator Tier1 RHOAIENG-10404 modelregistry-managed Set DSC Component Managed State And Wait For Completion modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} @@ -199,7 +199,7 @@ Validate ModelRegistry Managed State Validate ModelRegistry Removed State [Documentation] Validate that ModelRegistry management state Removed does remove relevant resources. - [Tags] Operator Tier1 RHOAIENG-10404 modelregistry-removed ExcludeOnRHOAI + [Tags] Operator Tier1 RHOAIENG-10404 modelregistry-removed # Properly validate Removed state by first setting to Manged, which will ensure that namspace # was created as needed for later validating that namespace persisted when component is Removed From da53f9654756a5a804d1b406fb8382594145279c Mon Sep 17 00:00:00 2001 From: mattmahoneyrh Date: Mon, 30 Sep 2024 13:34:43 -0400 Subject: [PATCH 4/4] RHOAIENG-12703- Add ModelRegistry Namespace Check --- .../0104__rhods_operator/0113__dsc_components.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot index e78b24b0a..bf2edd984 100644 --- a/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot +++ b/ods_ci/tests/Tests/0100__platform/0101__deploy/0104__operators/0104__rhods_operator/0113__dsc_components.robot @@ -400,7 +400,7 @@ Check Model Registry Namespace ... oc get DataScienceCluster/${DSC_NAME} -n ${OPERATOR_NS} -o "jsonpath={".spec.components.modelregistry.registriesNamespace"}" Should Be Equal As Integers ${rc} 0 msg=${namespace} - Should Be Equal ${namespace} ${MODEL_REGISTRY_NAMESPACE} msg=Model Registry Namespace: Actual "${namespace}" Expected: "${MODEL_REGISTRY_NAMESPACE} + Should Be Equal ${namespace} ${MODEL_REGISTRY_NAMESPACE} msg=Model Registry Namespace: Actual "${namespace}" Expected: "${MODEL_REGISTRY_NAMESPACE}" ${rc} ${output}= Run And Return Rc And Output ... oc get namespace -A ${MODEL_REGISTRY_NAMESPACE}