Deploy A/B testing infrastructure in a containerized microservice architecture for Machine Learning applications.
This repository uses Kubernetes, helm, ambassador, seldon-core, and seldon-core-analytics.
-
Install helm
brew install helm
-
Create a Kubernetes cluster: AKS, EKS, GKE or local cluster. For local clusters, one can use
minikube
,kind
, ork3s
. For instance:- GKE
gcloud container clusters create demo-cluster-ab-test \ --zone=europe-west3-a \ --disk-size=30GB \ --cluster-version=1.24.12-gke.1000 \ --machine-type=e2-highcpu-4
Prepare the model artifacts:
make train
One can build the images locally, or use Cloud Submit:
docker build -t ab-test:a -f Dockerfile.a .
docker build -t ab-test:b -f Dockerfile.b .
docker build -t streamlit-app:v1.0.0 -f Dockerfile.streamlit .
sh build-modela.sh
sh build-modelb.sh
sh build-streamlit.sh
- emissary-ingress
make emissary
- Prometheus
make prometheus
- Grafana
make grafana
- seldon-core
make seldon-core
- podmonitor
make podmonitor
make abtest
make streamlit
make port-grafana
Sadik Bakiu (sadik [at] data-max.io)
Developed with ❤ at Data Max
- Model Training: https://github.com/SeldonIO/seldon-core/tree/master/examples/models/sklearn_spacy_text
- Seldon-core installation:
- Install Emissary Ingress: https://www.getambassador.io/docs/emissary/latest/topics/install
- Install seldon-core operator: https://docs.seldon.io/projects/seldon-core/en/latest/workflow/install.html
- PodMonitor with Prometheus installation: https://docs.seldon.io/projects/seldon-core/en/latest/analytics/analytics.html
- Custom metrics: https://docs.seldon.io/projects/seldon-core/en/latest/examples/runtime_metrics_tags.html
- Streamlit: https://docs.streamlit.io/library/cheatsheet