Deploying a machine learning model built with Apache Spark isn’t as straight forward as the deployment of a PyTorch model or a TF model. Especially when you’re planning on having a REST API for inference requests. One way of going about it is use MLeap, but that would require modifications to training code, as MLeap relies on it’s own serialization.
The best approach that I’ve found is using Openscoring and PMML (Predictive Model Markup Language). PMML is a an XML based markup language that stores your predictive model and openscoring is used to create the inference REST API. The steps for doing so are as follows: