oracle / accelerated-data-science

ADS is the Oracle Data Science Cloud Service's python SDK supporting, model ops (train/eval/deploy), along with running workloads on Jobs and Pipeline resources.
https://accelerated-data-science.readthedocs.io/
Universal Permissive License v1.0
87 stars 43 forks source link

Update config and fix model cache delete method #967

Open VipulMascarenhas opened 2 hours ago

VipulMascarenhas commented 2 hours ago

Description

This PR covers the following:

  1. adds protected_namespace to Config in UIConfig class to avoid the warning message in ads cli.
> ads aqua model list

WARNING:py.warnings:/Users/<user>/miniconda3/envs/<env>/lib/python3.8/site-packages/pydantic/_internal/_fields.py:160: UserWarning: Field "model_params" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
  warnings.warn(
{
    "compartment_id": "ocid1.compartment.oc1..<ocid>",
...
...

After the fix:

{
    "compartment_id": "ocid1.compartment.oc1..<ocid>",
...
...
  1. Allow user to delete model cache using command line. Now user can run the following to clear Aqua model cache.
oci raw-request --http-method DELETE  --target-uri  https://cell-01.datascience.<region>.oci.oc-test.com/ocid1.datasciencenotebooksession.oc1.<region_code>.<OCID>/aqua/model/cache  --auth <auth_type>

Unit Tests

> python -m pytest -q tests/unitary/with_extras/aqua/test_*
================================================================================== test session starts ===================================================================================
platform darwin -- Python 3.8.19, pytest-7.4.4, pluggy-1.0.0
rootdir: /Users/<user>/workspace/git/accelerated-data-science
configfile: pytest.ini
plugins: Faker-26.0.0, cov-5.0.0, anyio-4.2.0, xdist-3.6.1
collected 230 items

tests/unitary/with_extras/aqua/test_cli.py ..............                                                                                                                          [  6%]
tests/unitary/with_extras/aqua/test_common_handler.py ...                                                                                                                          [  7%]
tests/unitary/with_extras/aqua/test_config.py .                                                                                                                                    [  7%]
tests/unitary/with_extras/aqua/test_decorator.py ..........                                                                                                                        [ 12%]
tests/unitary/with_extras/aqua/test_deployment.py .....................                                                                                                            [ 21%]
tests/unitary/with_extras/aqua/test_deployment_handler.py ..s......                                                                                                                [ 25%]
tests/unitary/with_extras/aqua/test_evaluation.py .............................                                                                                                    [ 37%]
tests/unitary/with_extras/aqua/test_evaluation_handler.py .........                                                                                                                [ 41%]
tests/unitary/with_extras/aqua/test_evaluation_service_config.py .....................                                                                                             [ 50%]
tests/unitary/with_extras/aqua/test_finetuning.py .......                                                                                                                          [ 53%]
tests/unitary/with_extras/aqua/test_finetuning_handler.py .....                                                                                                                    [ 56%]
tests/unitary/with_extras/aqua/test_global.py ...                                                                                                                                  [ 57%]
tests/unitary/with_extras/aqua/test_handlers.py .................                                                                                                                  [ 64%]
tests/unitary/with_extras/aqua/test_model.py .......................                                                                                                               [ 74%]
tests/unitary/with_extras/aqua/test_model_handler.py ..............                                                                                                                [ 80%]
tests/unitary/with_extras/aqua/test_ui.py ...............                                                                                                                          [ 87%]
tests/unitary/with_extras/aqua/test_ui_handler.py ..............                                                                                                                   [ 93%]
tests/unitary/with_extras/aqua/test_ui_websocket_handler.py ....                                                                                                                   [ 95%]
tests/unitary/with_extras/aqua/test_utils.py ...........                                                                                                                           [100%]

============================================================================ 229 passed, 1 skipped in 30.52s =============================================================================
github-actions[bot] commented 1 hour ago

📌 Cov diff with main:

Coverage-100%

📌 Overall coverage:

Coverage-59.07%