Skip to content

Commit

Permalink
Merge branch 'master' into v1.10.0-release
Browse files Browse the repository at this point in the history
  • Loading branch information
axsaucedo authored Aug 17, 2021
2 parents 5d1dbfd + d75ab8c commit 279cf3c
Show file tree
Hide file tree
Showing 9 changed files with 1,312 additions and 688 deletions.
3 changes: 3 additions & 0 deletions doc/source/examples/mlflow_v2_protocol_end_to_end.nblink
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "../../../examples/models/mlflow_v2_protocol_end_to_end/README.ipynb"
}
1 change: 1 addition & 0 deletions doc/source/examples/notebooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Prepackaged Inference Server Examples
Deploy a Scikit-learn Model Binary <../servers/sklearn.md>
Deploy a Tensorflow Exported Model <../servers/tensorflow.md>
MLflow Pre-packaged Model Server A/B Test <mlflow_server_ab_test_ambassador>
MLflow v2 Protocol End to End Workflow (Incubating) <mlflow_v2_protocol_end_to_end>
Deploy a XGBoost Model Binary <../servers/xgboost.md>
Deploy Pre-packaged Model Server with Cluster's MinIO <minio-sklearn>
Custom Pre-packaged LightGBM Server <custom_server>
Expand Down
22 changes: 12 additions & 10 deletions doc/source/servers/mlflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,45 +98,47 @@ MLServer](https://github.com/SeldonIO/MLServer) runtime.
### Create a model using `mlflow` and deploy to `seldon-core`
As an example we are going to use the elasticnet wine model.

1. Create a `conda` environment
- Create a `conda` environment

```bash
$ conda -y create -n python3.8-mlflow-example python=3.8
$ conda activate python3.8-mlflow-example
```

2. Install `mlflow`
- Install `mlflow`

```bash
$ pip install mlflow
```

3. Train the elasticnet wine example
- Train the elasticnet wine example

```bash
$ git clone https://github.com/mlflow/mlflow
$ cd mlflow/examples
$ python sklearn_elasticnet_wine/train.py
```

After the script ends, there will be a models persisted at `mlruns/0/<uuid>/artifacts/model`. This can
be fetched from the ui (`mlflow ui`)

4. Install additional packaged required to deploy and ack the conda environment using [conda-pack](https://conda.github.io/conda-pack/)
- Install additional packaged required to deploy and pack the conda environment using [conda-pack](https://conda.github.io/conda-pack/)

```bash
$ pip install conda-pack
$ pip install mlserver
$ pip install mlserver-mlflow
$ cd mlflow/examples/mlruns/0/<uuid>/artifacts/model
$ conda pack -o environment.tar.gz -f
```

This will pack the current conda environment to `environment.tar.gz`, this will be required by `mlserver` to create the same environment used during train for serving the model.

6. copy the model directory to a Google Storage bucket that is accessible by seldon-core
- copy the model directory to a Google Storage bucket that is accessible by seldon-core

```bash
$ gsutil cp -r ../model gs://seldon-models/test/elasticnet_wine_<uuid>
```

6. deploy the model to seldon-core

- deploy the model to seldon-core
In order to enable support for the V2 KFServing protocol, it's enough to
specify the `protocol` of the `SeldonDeployment` to use `kfserving`.
For example,
Expand All @@ -159,7 +161,7 @@ spec:
replicas: 1
```

7. get predictions from the deployed model
- get predictions from the deployed model using REST

```python
import json
Expand Down
Loading

0 comments on commit 279cf3c

Please sign in to comment.