Skip to content

Commit

Permalink
Rename APIs for model serving framework (#159) (#167)
Browse files Browse the repository at this point in the history
* renaming APIs for OS 2.7

Signed-off-by: Alibi Zhenis <[email protected]>

* updating tests

Signed-off-by: Alibi Zhenis <[email protected]>

* linting

Signed-off-by: Alibi Zhenis <[email protected]>

* adding new methods and marking old ones as deprecated

Signed-off-by: Alibi Zhenis <[email protected]>

* fixing tests

Signed-off-by: Alibi Zhenis <[email protected]>

* updating documentation

Signed-off-by: Alibi Zhenis <[email protected]>

* partially fixing tests for codecov/patch

Signed-off-by: Alibi Zhenis <[email protected]>

* adding comments

Signed-off-by: Alibi Zhenis <[email protected]>

* change constant name

Signed-off-by: Alibi Zhenis <[email protected]>

* linting

Signed-off-by: Alibi Zhenis <[email protected]>

* fixing tests

Signed-off-by: Alibi Zhenis <[email protected]>

---------

Signed-off-by: Alibi Zhenis <[email protected]>
(cherry picked from commit 7d01104)

Co-authored-by: Alibi Zhenis <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and AlibiZhenis authored May 31, 2023
1 parent 60c98c8 commit 45299b6
Show file tree
Hide file tree
Showing 13 changed files with 454 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
cluster: ["opensearch"]
secured: ["true"]
entry:
- { opensearch_version: 2.6.0 }
- { opensearch_version: 2.7.0 }

steps:
- name: Checkout
Expand Down
6 changes: 6 additions & 0 deletions docs/source/reference/api/ml_commons_deploy_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Deploy Model
==================

.. currentmodule:: opensearch_py_ml

.. autofunction:: opensearch_py_ml.ml_commons.MLCommonClient.deploy_model
6 changes: 6 additions & 0 deletions docs/source/reference/api/ml_commons_register_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Register Model
==================

.. currentmodule:: opensearch_py_ml

.. autofunction:: opensearch_py_ml.ml_commons.MLCommonClient.register_model
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Register Pretrained Model
==============================

.. currentmodule:: opensearch_py_ml

.. autofunction:: opensearch_py_ml.ml_commons.MLCommonClient.register_pretrained_model
6 changes: 6 additions & 0 deletions docs/source/reference/api/ml_commons_undeploy_model_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Undeploy Model
==================

.. currentmodule:: opensearch_py_ml

.. autofunction:: opensearch_py_ml.ml_commons.MLCommonClient.undeploy_model
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Upload Pretrained Model
==================
===========================

.. currentmodule:: opensearch_py_ml

Expand Down
46 changes: 37 additions & 9 deletions docs/source/reference/mlcommons.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,91 @@ MLCommons Support
.. currentmodule:: opensearch_py_ml

Upload Model
~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_upload_api

Register Model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_register_api

Upload Pretrained Model
~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_upload_pretrained_api

Register Pretrained Model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_register_pretrained_api

Load Model
~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_load_api

Deploy Model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_deploy_api

Get Task Info
~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_get_task_info_api

Get Model Info
~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_get_model_info_api

Generate Embedding
~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_generate_embedding_api

Unload Model
~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_unload_model_api

Undeploy Model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_undeploy_model_api

Delete Model
~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

api/ml_commons_delete_model_api

Delete Task
~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. toctree::
:maxdepth: 2

Expand Down
2 changes: 1 addition & 1 deletion opensearch_py_ml/ml_commons/ml_common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# GitHub history for details.

ML_BASE_URI = "/_plugins/_ml"
MODEL_UPLOAD_CHUNK_SIZE = 10_000_000
MODEL_CHUNK_MAX_SIZE = 10_000_000
MODEL_MAX_SIZE = 4_000_000_000
BUF_SIZE = 65536 # lets read stuff in 64kb chunks!
TIMEOUT = 120 # timeout for synchronous method calls in seconds
Loading

0 comments on commit 45299b6

Please sign in to comment.