-
Notifications
You must be signed in to change notification settings - Fork 63
Add new test for maistra error #181
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
985bb9f
Add new test for maistra
ad5f4d4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9dd2fc0
Add new test for maistra
3db1836
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 748ea33
Add new test for maistra
67e5c14
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f3355e7
Merge branch 'main' into 19967
mwaykole 21f83e6
Add new test for maistra
8ff0af4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 51826b5
Merge branch 'main' into 19967
mwaykole 73f5223
Add new test for maistra
e55bef2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 25cd1da
Add new test for maistra
1a2d432
Merge branch 'main' into 19967
mwaykole d8a6868
Merge branch 'main' into 19967
mwaykole 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
79 changes: 79 additions & 0 deletions
79
...l_serving/model_server/serverless/test_odh_model_controller_failing_while_deleted_isvc.py
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 |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import pytest | ||
| from ocp_utilities.infra import get_pods_by_name_prefix | ||
| from pytest_testconfig import py_config | ||
| from simple_logger.logger import get_logger | ||
| from timeout_sampler import TimeoutSampler, TimeoutExpiredError | ||
|
|
||
| from tests.model_serving.model_server.utils import verify_inference_response | ||
| from utilities.constants import ( | ||
| ModelFormat, | ||
| ModelInferenceRuntime, | ||
| ModelVersion, | ||
| Protocols, | ||
| Timeout, | ||
| ) | ||
| from utilities.exceptions import PodLogMissMatchError | ||
| from utilities.inference_utils import Inference | ||
| from utilities.manifests.onnx import ONNX_INFERENCE_CONFIG | ||
|
|
||
| pytestmark = [ | ||
| pytest.mark.serverless, | ||
| pytest.mark.sanity, | ||
| pytest.mark.usefixtures("valid_aws_config"), | ||
| ] | ||
|
|
||
| LOGGER = get_logger(name=__name__) | ||
|
|
||
|
|
||
| @pytest.mark.serverless | ||
mwaykole marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| @pytest.mark.parametrize( | ||
| "model_namespace, openvino_kserve_serving_runtime, ovms_serverless_inference_service", | ||
| [ | ||
| pytest.param( | ||
| {"name": "serverless-maistra"}, | ||
| { | ||
| "runtime-name": ModelInferenceRuntime.ONNX_RUNTIME, | ||
| "model-format": {ModelFormat.ONNX: ModelVersion.OPSET13}, | ||
| }, | ||
| { | ||
| "name": ModelFormat.ONNX, | ||
| "model-version": ModelVersion.OPSET13, | ||
| "model-dir": "test-dir", | ||
| }, | ||
| ) | ||
| ], | ||
| indirect=True, | ||
| ) | ||
| class TestLogForOdHModelController: | ||
| def test_odh_model_controller_failing_while_deleted_isvc(self, ovms_serverless_inference_service): | ||
mwaykole marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """Verify model can be queried""" | ||
| verify_inference_response( | ||
| inference_service=ovms_serverless_inference_service, | ||
| inference_config=ONNX_INFERENCE_CONFIG, | ||
| inference_type=Inference.INFER, | ||
| protocol=Protocols.HTTPS, | ||
| use_default_query=True, | ||
| ) | ||
|
|
||
| def test_moniter_odh_logs_doe_maistra(self, deleted_isvc, admin_client): | ||
| """Delete isvc and check pod logs for unexpected 'Maistra' string""" | ||
| search_string = "maistra.io" | ||
| pod = get_pods_by_name_prefix( | ||
| client=admin_client, namespace=py_config["applications_namespace"], pod_prefix="odh-model-controller" | ||
| )[0] | ||
|
|
||
| try: | ||
| log_sampler = TimeoutSampler( | ||
| wait_timeout=Timeout.TIMEOUT_1MIN, | ||
| sleep=5, | ||
| func=lambda: pod.log(container="manager", tail_lines=100, timestamps=True), | ||
mwaykole marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
|
|
||
| for log_output in log_sampler: | ||
| LOGGER.info("Log output fetched during sampling:") | ||
| if search_string in log_output: | ||
| raise PodLogMissMatchError(f"'{search_string}' was found in pod logs") | ||
| LOGGER.info(f"'{search_string}' was not found in pod logs within timeout") | ||
mwaykole marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| except TimeoutExpiredError as e: | ||
| LOGGER.error(f"Timeout while sampling logs: {str(e)}") | ||
mwaykole marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.