Skip to content

Commit

Permalink
Add MLflowDeploymentClient
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy committed Nov 17, 2023
1 parent ee8daca commit d898106
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
pytest pytest-timeout pytest-asyncio httpx psutil
- name: Run tests
run: |
pytest tests/deployments/databricks
pytest tests/deployments/databricks tests/deployments/mlflow
81 changes: 81 additions & 0 deletions mlflow/deployments/mlflow/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
from mlflow.deployments import BaseDeploymentClient


class MLflowDeploymentClient(BaseDeploymentClient):
def create_deployment(self, name, model_uri, flavor=None, config=None, endpoint=None):
"""
.. warning::
This method is not implemented for `MLflowDeploymentClient`.
"""
raise NotImplementedError

def update_deployment(self, name, model_uri=None, flavor=None, config=None, endpoint=None):
"""
.. warning::
This method is not implemented for `MLflowDeploymentClient`.
"""
raise NotImplementedError

def delete_deployment(self, name, config=None, endpoint=None):
"""
.. warning::
This method is not implemented for `MLflowDeploymentClient`.
"""
raise NotImplementedError

def list_deployments(self, endpoint=None):
"""
.. warning::
This method is not implemented for `MLflowDeploymentClient`.
"""
raise NotImplementedError

def get_deployment(self, name, endpoint=None):
"""
TODO
"""
raise NotImplementedError

def predict(self, deployment_name=None, inputs=None, endpoint=None):
"""
TODO
"""
raise NotImplementedError("TODO")

def create_endpoint(self, name, config=None):
"""
TODO
"""
raise NotImplementedError("TODO")

def update_endpoint(self, endpoint, config=None):
"""
TODO
"""
raise NotImplementedError("TODO")

def delete_endpoint(self, endpoint):
"""
TODO
"""
raise NotImplementedError("TODO")

def list_endpoints(self):
"""
TODO
"""
raise NotImplementedError("TODO")

def get_endpoint(self, endpoint):
"""
TODO
"""
raise NotImplementedError("TODO")


def run_local(name, model_uri, flavor=None, config=None):
pass


def target_help():
pass
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ def run(self):
[mlflow.deployments]
databricks=mlflow.deployments.databricks
http=mlflow.deployments.mlflow
https=mlflow.deployments.mlflow
""",
cmdclass={
"dependencies": ListDependencies,
Expand Down
7 changes: 7 additions & 0 deletions tests/deployments/mlflow/test_mlflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from mlflow.deployments import get_deploy_client
from mlflow.deployments.mlflow import MLflowDeploymentClient


def test_get_deploy_client():
client = get_deploy_client("http://localhost:5000")
assert isinstance(client, MLflowDeploymentClient)

0 comments on commit d898106

Please sign in to comment.