Skip to content

Commit 0953362

Browse files
authored
Merge pull request #28 from oracle/release_2021-07-16
Added Python version check
2 parents f681f5a + d4d7c33 commit 0953362

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

model_catalog_examples/artifact_boilerplate/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ MODEL_DEPLOYMENT:
7171
INFERENCE_CONDA_ENV:
7272
INFERENCE_ENV_SLUG: <insert-the-environment-slug> # for example mlcpuv1 see: https://docs.oracle.com/en-us/iaas/data-science/using/conda-gml-fam.htm
7373
INFERENCE_ENV_TYPE: <env-type> # can either be "published" or "data_science"
74-
INFERENCE_ENV_PATH: <conda-environment-path-on-object-storage> # For example:
74+
INFERENCE_ENV_PATH: <conda-environment-path-on-object-storage> # For example: "oci://service_conda_packs@ociodscdev/service_pack/cpu/General Machine Learning for CPUs/1.0/mlcpuv1"
7575
INFERENCE_PYTHON_VERSION: '3.7' #
7676
```
7777

78-
Go to this page(link to https://docs.oracle.com/en-us/iaas/data-science/using/model_runtime_yaml.htm) for a definition of all the parameters that can be included in `runtime.yaml`.
78+
Go to this page [link](https://docs.oracle.com/en-us/iaas/data-science/using/model_runtime_yaml.htm) for a definition of all the parameters that can be included in `runtime.yaml`.
7979

8080
As an example, here's a complete `runtime.yaml` for a data_science conda environment (mlcpuv1) used as a runtime environment for model deployment.
8181
In most cases the runtime environment for model deployment should be the same as the conda environment used to train the model.
@@ -110,14 +110,14 @@ Python version > 3.5 is required to run the tests. Before running the tests loca
110110
namely `pyyaml` and `requests`. This installation step is a one-time operation. Go to your artifact directory and run the following command:
111111

112112
```
113-
python3 -m pip install --user -r model-artifact-validation/requirements.txt
113+
python3 -m pip install --user -r artifact_introspection_test/requirements.txt
114114
```
115115

116116
### Running the Tests Locally
117117

118118
Next, replace `<artifact-path>` with the path to your model artifact directory
119119
```
120-
python3 model-artifact-validation/model_artifact_validate.py --artifact <artifact-path>
120+
python3 artifact_introspection_test/model_artifact_validate.py --artifact <artifact-path>
121121
```
122122

123123
The script automatically generates a report of the test results in the same folder . Two files are generated containing the test results in different formats:
Binary file not shown.

model_catalog_examples/artifact_boilerplate/artifact_introspection_test/model_artifact_validate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ def model_deployment_find_fields(cfg) -> None:
6767
TESTS['runtime_env_path']['success'] = True
6868
TESTS['runtime_env_path']['value'] = value
6969
elif key == 'INFERENCE_PYTHON_VERSION':
70-
TESTS['runtime_env_python']['success'] = True
71-
TESTS['runtime_env_python']['value'] = value
70+
m = re.match(PYTHON_VER_PATTERN, str(value))
71+
if m and m.group():
72+
TESTS['runtime_env_python']['success'] = True
73+
TESTS['runtime_env_python']['value'] = value
7274
else:
7375
model_deployment_find_fields(value)
7476

0 commit comments

Comments
 (0)