-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fixed unpatched object storage url bug in unit test #340
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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 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 |
---|---|---|
|
@@ -57,7 +57,7 @@ dependencies = [ | |
"asteval>=0.9.25", | ||
"cerberus>=1.3.4", | ||
"cloudpickle>=1.6.0", | ||
"fsspec>=0.8.7", | ||
"fsspec>=0.8.7,<2023.9.1", # v2.9.1 introduced issues, releved by unit tests | ||
"gitpython>=3.1.2", | ||
"jinja2>=2.11.2", | ||
"matplotlib>=3.1.3", | ||
|
@@ -109,7 +109,7 @@ onnx = [ | |
"lightgbm==3.3.1", | ||
"onnx>=1.12.0", | ||
"onnxmltools>=1.10.0", | ||
"onnxruntime>=1.10.0", | ||
"onnxruntime>=1.10.0,<1.16", # v1.16 introduced issues https://github.com/microsoft/onnxruntime/issues/17631, releved by unit tests | ||
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. revealed instead of releved. Not critical, I can update type with my PR in future |
||
"oracle_ads[viz]", | ||
"protobuf<=3.20", | ||
"skl2onnx>=1.10.4", | ||
|
This file contains 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 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 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 |
---|---|---|
|
@@ -279,14 +279,29 @@ def test_prepare_fail(self, mock_handle_model_file_name): | |
"oci://service-conda-packs@ociodscdev/service_pack/cpu/General_Machine_Learning_for_CPUs/1.0/mlcpuv1" | ||
) | ||
|
||
@patch("ads.model.runtime.env_info.get_service_packs") | ||
@patch("ads.common.auth.default_signer") | ||
def test_prepare_both_conda_env(self, mock_signer): | ||
def test_prepare_both_conda_env(self, mock_signer, mock_get_service_packs): | ||
"""prepare a model by only providing inference conda env.""" | ||
inference_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/General_Machine_Learning_for_CPUs/1.0/mlcpuv1" | ||
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. Can it be used more dummy values, something like this:
|
||
inference_python_version="3.6" | ||
training_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/Oracle_Database_for_CPU_Python_3.7/1.0/database_p37_cpu_v1" | ||
training_python_version="3.7" | ||
mock_get_service_packs.return_value = ( | ||
{ | ||
inference_conda_env : ("mlcpuv1", inference_python_version), | ||
training_conda_env : ("database_p37_cpu_v1", training_python_version) | ||
}, | ||
{ | ||
"mlcpuv1" : (inference_conda_env, inference_python_version), | ||
"database_p37_cpu_v1" : (training_conda_env, training_python_version) | ||
} | ||
) | ||
self.generic_model.prepare( | ||
inference_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/General_Machine_Learning_for_CPUs/1.0/mlcpuv1", | ||
inference_python_version="3.6", | ||
training_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/Oracle_Database_for_CPU_Python_3.7/1.0/database_p37_cpu_v1", | ||
training_python_version="3.7", | ||
inference_conda_env=inference_conda_env, | ||
inference_python_version=inference_python_version, | ||
training_conda_env=training_conda_env, | ||
training_python_version=training_python_version, | ||
model_file_name="fake_model_name", | ||
force_overwrite=True, | ||
) | ||
|
@@ -349,8 +364,19 @@ def test_reload(self): | |
|
||
@patch.object(GenericModel, "_random_display_name", return_value="test_name") | ||
@patch.object(DataScienceModel, "create") | ||
def test_save(self, mock_dsc_model_create, mock__random_display_name): | ||
@patch("ads.model.runtime.env_info.get_service_packs") | ||
def test_save(self, mock_get_service_packs, mock_dsc_model_create, mock__random_display_name): | ||
"""test saving a model to artifact.""" | ||
inference_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/Data_Exploration_and_Manipulation_for_CPU_Python_3.7/3.0/dataexpl_p37_cpu_v3" | ||
inference_python_version="3.7" | ||
mock_get_service_packs.return_value = ( | ||
{ | ||
inference_conda_env : ("dataexpl_p37_cpu_v3", inference_python_version), | ||
}, | ||
{ | ||
"dataexpl_p37_cpu_v3" : (inference_conda_env, inference_python_version), | ||
} | ||
) | ||
mock_dsc_model_create.return_value = MagicMock(id="fake_id") | ||
self.generic_model.prepare( | ||
inference_conda_env="dataexpl_p37_cpu_v3", | ||
|
@@ -360,7 +386,7 @@ def test_save(self, mock_dsc_model_create, mock__random_display_name): | |
force_overwrite=True, | ||
training_id=None, | ||
) | ||
self.generic_model.save() | ||
self.generic_model.save(ignore_introspection=True) | ||
assert self.generic_model.model_id is not None and isinstance( | ||
self.generic_model.model_id, str | ||
) | ||
|
@@ -371,8 +397,19 @@ def test_save(self, mock_dsc_model_create, mock__random_display_name): | |
parallel_process_count=utils.DEFAULT_PARALLEL_PROCESS_COUNT, | ||
) | ||
|
||
def test_save_not_implemented_error(self): | ||
@patch("ads.model.runtime.env_info.get_service_packs") | ||
def test_save_not_implemented_error(self, mock_get_service_packs): | ||
"""test saving a model to artifact.""" | ||
inference_conda_env="oci://service-conda-packs@ociodscdev/service_pack/cpu/Data_Exploration_and_Manipulation_for_CPU_Python_3.7/3.0/dataexpl_p37_cpu_v3" | ||
inference_python_version="3.7" | ||
mock_get_service_packs.return_value = ( | ||
{ | ||
inference_conda_env : ("dataexpl_p37_cpu_v3", inference_python_version), | ||
}, | ||
{ | ||
"dataexpl_p37_cpu_v3" : (inference_conda_env, inference_python_version), | ||
} | ||
) | ||
self.generic_model._serialize = False | ||
self.generic_model.prepare( | ||
inference_conda_env="dataexpl_p37_cpu_v3", | ||
|
This file contains 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 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 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 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
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.
revealed instead of releved. Not critical, I can update type with my PR in future