Skip to content
This repository was archived by the owner on Jun 21, 2024. It is now read-only.

Latest commit

 

History

History
48 lines (32 loc) · 1.28 KB

README.md

File metadata and controls

48 lines (32 loc) · 1.28 KB

mlflow-models-deploy-docker

Prebuilt docker image for deploying models via MLflow in docker container.

Build

docker build -t  mlflow_models_deploy_docker .

or - if you want to push image to Docker registry

docker build -t  <username/mlflow_models_deploy_docker> .
docker push <username/mlflow_models_deploy_docker>

Run

With local models storage

docker run -v /path/to/model/on/host:/path/to/model/in/docker \
           -p <port>:<port> \
           mlflow_models_deploy_docker \
           /bin/bash -c \
           "mlflow models serve --no-conda -m /path/to/model/in/docker  --host 0.0.0.0 --port <port> --workers <gunicorn_workers>"

With remote models storage, for example gs://:

docker run -v /host/path/to/google_credentials.json:/docker/path/to/google_credentials.json \
           -p <port>:<port> \
           mlflow_models_deploy_docker \
           /bin/bash -c \
           "export GOOGLE_APPLICATION_CREDENTIALS=/docker/path/to/google_credentials.json && mlflow models serve --no-conda -m <model_uri_in_gs> --host 0.0.0.0 --port <port> --workers <gunicorn_workers>"

Predicting

curl -X POST http://localhost:5000/invocations -H 'Content-Type: application/json; format=pandas-records' -d '[[1,2,3,4,...]]'