diff --git a/models/mlflow/README.md b/models/mlflow/README.md index 766461c821..97e8c7d5e5 100644 --- a/models/mlflow/README.md +++ b/models/mlflow/README.md @@ -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 +``` + ## Start Triton Inference Server in EXPLICIT mode Use the following command to run Triton with our model @@ -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: @@ -77,17 +89,6 @@ docker exec -it 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: @@ -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 diff --git a/models/mlflow/docker/Dockerfile b/models/mlflow/docker/Dockerfile index 404e8f5df4..e9b66514e3 100644 --- a/models/mlflow/docker/Dockerfile +++ b/models/mlflow/docker/Dockerfile @@ -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 @@ -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.08 RUN mkdir ${TRITON_DIR} && \ cd ${TRITON_DIR} && \ @@ -43,8 +42,10 @@ RUN mkdir ${TRITON_DIR} && \ RUN ln -sf ${TRITON_DIR}/server/deploy/mlflow-triton-plugin/scripts/publish_model_to_mlflow.py /mlflow && \ mkdir /mlflow/artifacts -ENV MLFLOW_MODEL_REPO=/mlflow/artifacts -ENV MLFLOW_TRACKING_URI=sqlite:////tmp/mlflow-db.sqlite +# remedy for CVE-2015-20107 +RUN find / -name '*mailcap*.*py*' | xargs rm + +EXPOSE 5000 # Set the entrypoint to use the entrypoint.sh script which sets the conda env ENTRYPOINT [ "/opt/conda/bin/tini", "--", "docker/entrypoint.sh" ] diff --git a/models/mlflow/docker/conda/mlflow-env.yml b/models/mlflow/docker/conda/mlflow-env.yml index a465e85769..693cffbf28 100644 --- a/models/mlflow/docker/conda/mlflow-env.yml +++ b/models/mlflow/docker/conda/mlflow-env.yml @@ -21,7 +21,9 @@ dependencies: - python=3.8 - pip - onnx - - openssl>=1.1.1o + - openssl>=1.1.1q + - psycopg2<3 - pip: - - mlflow - + - boto3 + - mlflow<1.29.0 + - pymysql