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

Add ModelRegistry Namespace Check #1862

Conversation

mattmahoneyrh
Copy link
Contributor

@mattmahoneyrh mattmahoneyrh commented Sep 26, 2024

Add ModelRegistry check to validate the appropriate namespace is created for ODH and RHOAI.
Validate that namespace is not deleted when management state is set to Removed.

RHOAIENG-12703

@mattmahoneyrh mattmahoneyrh added needs testing Needs to be tested in Jenkins enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes) do not merge Do not merge this yet please labels Sep 26, 2024

# 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"}"

Check warning

Code scanning / Robocop

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

Line is too long (135/120)
Copy link
Contributor

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
545 0 0 545 100


# Get actual namespace
${rc} ${actual_namespace}= Run And Return Rc And Output
... oc get deployments -A | grep ${MODELREGISTRY_CONTROLLER_DEPLOYMENT_NAME} | awk '{print$1}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use label instead of doing grep that will be more K8s way

@mattmahoneyrh mattmahoneyrh added verified This PR has been tested with Jenkins and removed needs testing Needs to be tested in Jenkins do not merge Do not merge this yet please labels Sep 30, 2024
@mattmahoneyrh
Copy link
Contributor Author

Refactored namespace check based on clarification of expected feature behavior.

Copy link

[Teardown] Restore DSC Component State modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.MODELREGISTRY}

Validate ModelRegistry Removed State
[Documentation] Validate that ModelRegistry management state Removed does remove relevant resources.
[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
[Setup] Set DSC Component Managed State And Wait For Completion modelregistry ${MODELREGISTRY_CONTROLLER__DEPLOYMENT_NAME} ${MODELREGISTRY_CONTROLLER__LABEL_SELECTOR}

Check warning

Code scanning / Robocop

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

Line is too long (180/120)
... 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}"

Check warning

Code scanning / Robocop

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

Line is too long (161/120)

${rc} ${output}= Run And Return Rc And Output
... oc get namespace -A ${MODEL_REGISTRY_NAMESPACE}
Should Be Equal As Integers ${rc} 0 msg=${output}

Check warning

Code scanning / Robocop

File has too many lines ({{ lines_count }}/{{max_allowed_count }}) Warning test

File has too many lines (428/400)
@mattmahoneyrh mattmahoneyrh merged commit 35a5700 into red-hat-data-services:master Oct 1, 2024
8 checks passed
Copy link
Contributor

@MarianMacik MarianMacik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@CFSNM CFSNM deleted the modelregistry-namespace-check branch October 1, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes) verified This PR has been tested with Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants