Integrating MLflow with the Ray platform
The Ray framework (https://docs.ray.io/en/master/) is a distributed platform that allows you to quickly scale the deployment infrastructure.
With Ray, you can add arbitrary logic when running an ML platform that needs to scale in the same way as model serving. It's basically a web framework.
We preloaded the model and contents that will be used into the following folder of the repository: https://github.com/PacktPublishing/Machine-Learning-Engineering-with-MLflow/tree/master/Chapter10/mlflow-ray-serve-integration.
In order to execute your model serving into Ray, execute the following steps:
- Install the Ray package by running the following command:
pip install -U ray
- Install MLflow in your environment.
- Import the needed libraries, as follows:
import ray from ray import serve import mlflow.pyfunc
- Implement the model backend, which basically means wrapping up the model-serving function into your Ray serving environment...