Skip to content

Example how to perform full stack deployment for prediction ML model on kubernetes (k8s) platform.

License

Notifications You must be signed in to change notification settings

atrakic/ml-model-house-pricing

Repository files navigation

ml-model-house-pricing

Example how to build and run a Machine Learning (ML) models using Scikit-Learn and Flask.

predict

Docker deployment

  • ML image:
$ docker run -it --rm -v $(PWD)/data/prices.csv:/data/prices.csv \
    ghcr.io/atrakic/ml-house-pricing-model:latest /data/prices.csv
  • Web
$ docker run -it --rm -e MODEL_FILE=/date/model.pkl \
    -v $(PWD)/model/model.pkl:/data/model.pkl \
    -p 8080:8080 \
    ghcr.io/atrakic/ml-house-pricing-web:latest

Docker-compose

$ docker-compose up --build --no-deps --remove-orphans -d

# Test
$ curl -d '{"rooms":2, "distance":20}' -H "Content-Type: application/json" \
    -X POST http://localhost:5000/api

Kubernetes deployment

$ kubectl apply -f ./k8s/web.yml

# Test
$ kubectl describe -f k8s-manifests/web.yml
$ kubectl run -it --rm --image=curlimages/curl --restart=Never curl-test -- \
    -d '{"rooms":2, "distance":20}' -H "Content-Type: application/json" \
    -X POST http://$(kubectl get svc ml-house-pricing-web --output=jsonpath='{.spec.clusterIPs[0]}'):80/api

LICENSE

See LICENSE for details.

About

Example how to perform full stack deployment for prediction ML model on kubernetes (k8s) platform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages