Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mlflow update 2209 #367

Merged
11 commits merged into from
Sep 22, 2022
27 changes: 14 additions & 13 deletions models/mlflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ Example:
mkdir -p /opt/triton_models
```

## Download Morpheus reference models

The Morpheus reference models can be found in the [Morpheus](https://github.com/NVIDIA/Morpheus) repo. A script is provided to fetch the models using git-lfs due to size.
Before running the MLflow plugin container, you can fetch the models and mount them to the local path on your host (for example, `/opt/triton_models`).

```bash
git clone https://github.com/NVIDIA/Morpheus.git morpheus
cd morpheus
scripts/fetch_data.py fetch models
cp -RL models /opt/triton_models
pdmack marked this conversation as resolved.
Show resolved Hide resolved
```

## Start Triton Inference Server in EXPLICIT mode

Use the following command to run Triton with our model
Expand Down Expand Up @@ -62,7 +74,7 @@ docker run -it -v /opt/triton_models:/triton_models \
--gpus '"device=0"' \
--net=host \
--rm \
-d mlflow-morpheus:latest
-d mlflow-triton-plugin:latest
```

Open Bash shell in container:
Expand All @@ -77,17 +89,6 @@ docker exec -it <container_name> bash
nohup mlflow server --backend-store-uri sqlite:////tmp/mlflow-db.sqlite --default-artifact-root /mlflow/artifacts --host 0.0.0.0 &
```


## Download Morpheus reference models

The Morpheus reference models can be found in the [Morpheus](https://github.com/NVIDIA/Morpheus) repo.

```bash
git clone https://github.com/NVIDIA/Morpheus.git morpheus
cd morpheus
scripts/fetch_data.py fetch models
```

## Publish reference models to MLflow

The `publish_model_to_mlflow` script is used to publish `triton` flavor models to MLflow. A `triton` flavor model is a directory containing the model files following the [model layout](https://github.com/triton-inference-server/server/blob/main/docs/model_repository.md#repository-layout). Below is an example usage:
Expand All @@ -102,7 +103,7 @@ python publish_model_to_mlflow.py \
## Deployments

The Triton `mlflow-triton-plugin` is installed on this container and can be used to deploy your models from MLflow to Triton Inference Server. The following are examples of how the plugin is used with the `sid-minibert-onnx` model that we published to MLflow above. For more information about the
`mlflow-triton-plugin`, please see Triton's [documentation](https://github.com/triton-inference-server/server/tree/r21.12/deploy/mlflow-triton-plugin)
`mlflow-triton-plugin`, please see Triton's [documentation](https://github.com/triton-inference-server/server/tree/r22.09/deploy/mlflow-triton-plugin)

### Create Deployment

Expand Down
8 changes: 5 additions & 3 deletions models/mlflow/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
# limitations under the License.

ARG FROM_IMAGE=gpuci/miniforge-cuda
ARG CUDA_VER=11.4
ARG CUDA_VER=11.5
ARG LINUX_VER=ubuntu20.04
ARG TRITON_VER=r22.02
FROM ${FROM_IMAGE}:${CUDA_VER}-runtime-${LINUX_VER} AS base

WORKDIR /mlflow
Expand All @@ -31,7 +30,7 @@ RUN sed -i 's/conda activate base/conda activate mlflow/g' ~/.bashrc
SHELL ["/opt/conda/bin/conda", "run", "-n", "mlflow", "/bin/bash", "-c"]

ARG TRITON_DIR=/mlflow/triton-inference-server
ARG TRITON_VER=r21.12
ARG TRITON_VER=r22.07

RUN mkdir ${TRITON_DIR} && \
cd ${TRITON_DIR} && \
Expand All @@ -43,6 +42,9 @@ RUN mkdir ${TRITON_DIR} && \
RUN ln -sf ${TRITON_DIR}/server/deploy/mlflow-triton-plugin/scripts/publish_model_to_mlflow.py /mlflow && \
mkdir /mlflow/artifacts

# remedy for CVE-2015-20107
RUN find / -name '*mailcap*.*py*' | xargs rm

ENV MLFLOW_MODEL_REPO=/mlflow/artifacts
ENV MLFLOW_TRACKING_URI=sqlite:////tmp/mlflow-db.sqlite

Expand Down
5 changes: 3 additions & 2 deletions models/mlflow/docker/conda/mlflow-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ dependencies:
- python=3.8
- pip
- onnx
- openssl>=1.1.1o
- openssl>=1.1.1q
- psycopg2<3
- pip:
- boto3
- mlflow