-
Notifications
You must be signed in to change notification settings - Fork 67
Add image validation for TrustyAI Operator and service image #334
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
Closed
sheltoncyril
wants to merge
6
commits into
opendatahub-io:main
from
sheltoncyril:test-model-explainability-images
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5f414a0
feat: add validation for TrustyAI Operator image
sheltoncyril 09f9a9e
docs: added docstring for validate method
sheltoncyril d36c1d0
Update tests/model_explainability/trustyai_service/utils.py
sheltoncyril f9a68ac
feat: add service and operator image validation with MR checks
sheltoncyril 84497fa
feat: remove unnecessary check for none
sheltoncyril e683c01
feat: fix model registry wait_for_pods_by_labels
sheltoncyril File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,17 +222,17 @@ def wait_for_pods_by_labels( | |
| namespace: str, | ||
| label_selector: str, | ||
| expected_num_pods: int, | ||
| ) -> list[Pod]: | ||
| ) -> list[Pod] | Pod: | ||
| """ | ||
| Get pods by label selector in a namespace. | ||
| Get pods or a pod by label selector in a namespace. | ||
|
|
||
| Args: | ||
| admin_client: The admin client to use for pod retrieval | ||
| namespace: The namespace to search in | ||
| label_selector: The label selector to filter pods | ||
| expected_num_pods: The expected number of pods to be found | ||
| Returns: | ||
| List of matching pods | ||
| List of matching pods or a single pod if expected_num_pods is 1 | ||
|
|
||
| Raises: | ||
| ResourceNotFoundError: If no pods are found | ||
|
|
@@ -247,8 +247,8 @@ def wait_for_pods_by_labels( | |
| if not pods: | ||
| raise ResourceNotFoundError(f"No pods found with label selector {label_selector} in namespace {namespace}") | ||
| if len(pods) != expected_num_pods: | ||
| raise UnexpectedResourceCountError(f"Expected {expected_num_pods} pods, found {len(pods)}") | ||
| return pods | ||
| raise UnexpectedResourceCountError(f"Expected {expected_num_pods} pod(s), found {len(pods)}") | ||
| return pods[0] if expected_num_pods == 1 else pods | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lugi0 will this change be a problem? return the pod if only 1 is required and list of pods if many. I've changed your usages as well. Please LMK if it's a bad idea, I'll revert it. |
||
|
|
||
|
|
||
| def validate_container_images( | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these tests should go under trustyai_service/test_trustyai_service.py, since we're checking the operator images as well. I would create a new directory for all the tests that are "transversal", maybe
model_explainability/trustyai_operator/test_trustyai_images.py, wdyt?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do this but it would involve a lot of refactoring fixtures to a higher level especially for the service, do you recommend doing this for both or should I split the operator related fixtures and move it up?