From 835ede095385cb570fde8e1db20049da012da139 Mon Sep 17 00:00:00 2001 From: cesar Date: Wed, 18 Sep 2024 11:08:06 +0200 Subject: [PATCH 1/2] fix: include modelregistry in the dsc template --- ods_ci/tasks/Resources/Files/dsc_template.yml | 4 ++++ ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot | 6 ++++++ ods_ci/tasks/Tasks/rhods_olm.robot | 2 ++ ods_ci/tests/Resources/RHOSi.resource | 2 ++ 4 files changed, 14 insertions(+) diff --git a/ods_ci/tasks/Resources/Files/dsc_template.yml b/ods_ci/tasks/Resources/Files/dsc_template.yml index 973b951da..ec1a0b2fc 100644 --- a/ods_ci/tasks/Resources/Files/dsc_template.yml +++ b/ods_ci/tasks/Resources/Files/dsc_template.yml @@ -35,4 +35,8 @@ spec: workbenches: devFlags: managementState: + modelregistry: + devFlags: + managementState: + registriesNamespace: diff --git a/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot b/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot index 46d6f3b28..2759f222b 100644 --- a/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot +++ b/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot @@ -19,6 +19,7 @@ ${DSCI_NAME} = default-dsci ... trainingoperator ... trustyai ... workbenches +... modelregistry ${SERVERLESS_OP_NAME}= serverless-operator ${SERVERLESS_SUB_NAME}= serverless-operator ${SERVERLESS_NS}= openshift-serverless @@ -319,6 +320,11 @@ Create DataScienceCluster CustomResource Using Test Variables ELSE IF '${COMPONENTS.${cmp}}' == 'Removed' Run sed -i'' -e 's/<${cmp}_value>/Removed/' ${file_path}dsc_apply.yml END + + # The model registry component needs to set the namespace used, so adding this special statement just for it + IF '${cmp}' == 'modelregistry' + Run sed -i'' -e 's/<${cmp}_namespace>/${MODEL_REGISTRY_NAMESPACE}/' ${file_path}dsc_apply.yml + END END Apply Custom Manifest in DataScienceCluster CustomResource Using Test Variables diff --git a/ods_ci/tasks/Tasks/rhods_olm.robot b/ods_ci/tasks/Tasks/rhods_olm.robot index 354934417..7f86548e6 100644 --- a/ods_ci/tasks/Tasks/rhods_olm.robot +++ b/ods_ci/tasks/Tasks/rhods_olm.robot @@ -24,6 +24,7 @@ Can Install RHODS Operator IF "${PRODUCT}" == "ODH" Set Global Variable ${OPERATOR_NAMESPACE} opendatahub-operators Set Global Variable ${OPERATOR_NAME_LABEL} opendatahub-operator + Set Global Variable ${MODEL_REGISTRY_NAMESPACE} odh-model-registries IF "${UPDATE_CHANNEL}" == "odh-nightlies" Set Global Variable ${OPERATOR_NAME} rhods-operator ELSE @@ -32,6 +33,7 @@ Can Install RHODS Operator ELSE Set Global Variable ${OPERATOR_NAME} rhods-operator Set Global Variable ${OPERATOR_NAME_LABEL} rhods-operator + Set Global Variable ${MODEL_REGISTRY_NAMESPACE} rhoai-model-registries END Given Selected Cluster Type ${cluster_type} When Installing RHODS Operator ${image_url} diff --git a/ods_ci/tests/Resources/RHOSi.resource b/ods_ci/tests/Resources/RHOSi.resource index 34109880f..b04c80b25 100644 --- a/ods_ci/tests/Resources/RHOSi.resource +++ b/ods_ci/tests/Resources/RHOSi.resource @@ -104,6 +104,7 @@ Assign Vars According To Product Set Suite Variable ${DASHBOARD_DEPLOYMENT_NAME} rhods-dashboard Set Suite Variable ${DASHBOARD_LABEL_SELECTOR} app.kubernetes.io/part-of=rhods-dashboard Set Suite Variable ${APPLICATIONS_NAMESPACE} redhat-ods-applications + Set Suite Variable ${MODEL_REGISTRY_NAMESPACE} rhoai-model-registries ELSE IF "${PRODUCT}" == "ODH" Set Suite Variable ${OPERATOR_APPNAME} Open Data Hub Operator Set Suite Variable ${OPERATOR_NAME} Open Data Hub Operator @@ -115,6 +116,7 @@ Assign Vars According To Product Set Suite Variable ${DASHBOARD_DEPLOYMENT_NAME} odh-dashboard Set Suite Variable ${DASHBOARD_LABEL_SELECTOR} app.kubernetes.io/part-of=dashboard Set Suite Variable ${APPLICATIONS_NAMESPACE} opendatahub + Set Suite Variable ${MODEL_REGISTRY_NAMESPACE} odh-model-registries END Gather Release Attributes From DSC And DSCI From 7f673758b12ae586474bb810fd70cf5905c6698c Mon Sep 17 00:00:00 2001 From: Noam Manos Date: Mon, 23 Sep 2024 18:22:24 +0300 Subject: [PATCH 2/2] Set DSCInitialization timeout to 3 minutes if TEST_ENV is CRC (#1845) Also refactor the `Wait For DSCInitialization CustomResource To Be Ready` Keyword to use `oc wait` instead of a FOR loop. Signed-off-by: manosnoam --- .../RHODS_OLM/install/oc_install.robot | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot b/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot index 46d6f3b28..597656e0b 100644 --- a/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot +++ b/ods_ci/tasks/Resources/RHODS_OLM/install/oc_install.robot @@ -89,7 +89,12 @@ Verify RHODS Installation IF "${UPDATE_CHANNEL}" == "odh-nightlies" or "${cluster_type}" != "managed" IF "${PRODUCT}" == "ODH" Apply DSCInitialization CustomResource dsci_name=${DSCI_NAME} - Wait For DSCInitialization CustomResource To Be Ready timeout=30 + IF "${TEST_ENV.lower()}" == "crc" + ${timeout_in_seconds} = Set Variable 180 + ELSE + ${timeout_in_seconds} = Set Variable 30 + END + Wait For DSCInitialization CustomResource To Be Ready timeout=${timeout_in_seconds} END Apply DataScienceCluster CustomResource dsc_name=${DSC_NAME} END @@ -256,22 +261,14 @@ Create DSCInitialization CustomResource Using Test Variables Run sed -i'' -e 's//${MONITORING_NAMESPACE}/' ${file_path}dsci_apply.yml Wait For DSCInitialization CustomResource To Be Ready - [Documentation] Wait for DSCInitialization CustomResource To Be Ready - [Arguments] ${timeout} - Log To Console Waiting for DSCInitialization CustomResource To Be Ready - ${status} Set Variable False - FOR ${counter} IN RANGE ${timeout} - ${return_code} ${output} = Run And Return Rc And Output oc get DSCInitialization --no-headers -o custom-columns=":status.phase" - IF '${output}' == 'Ready' - ${status} = Set Variable True - Log To Console DSCInitialization CustomResource is Ready - BREAK - END - Sleep 1 sec - END - IF '${status}' == 'False' - Run Keyword And Continue On Failure FAIL Timeout- DSCInitialization CustomResource is not Ready - END + [Documentation] Wait ${timeout} seconds for DSCInitialization CustomResource To Be Ready + [Arguments] ${timeout} + Log To Console Waiting ${timeout} seconds for DSCInitialization CustomResource To Be Ready + ${result} = Run Process oc wait DSCInitialization --timeout\=${timeout}s --for jsonpath\='{.status.phase}'\=Ready --all + ... shell=true stderr=STDOUT + IF ${result.rc} != 0 + Run Keyword And Continue On Failure FAIL ${result.stdout} + END Apply DataScienceCluster CustomResource [Documentation]