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:- Minikube
make minikube
- GKE
gcloud container clusters create demo-cluster-ab-test \ --zone=europe-west3-a \ --cluster-version=1.21.14-gke.5300 --no-enable-autoupgrade \ --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.1 -f Dockerfile.streamlit .
gcloud builds submit --config cloudbuild-modela.yaml
gcloud builds submit --config cloudbuild-modelb.yaml
gcloud builds submit --config cloudbuild-streamlit.yaml
make load
- ambassador
make ambassador
- seldon-core-analytics
make seldon-core-analytics
- seldon-core
make seldon-core
make abtest
make port
make port-grafana
make streamlit
- Model Training: https://github.com/SeldonIO/seldon-core/tree/master/examples/models/sklearn_spacy_text
- Seldon-core installation:
- Install Ambassador: https://docs.seldon.io/projects/seldon-core/en/latest/ingress/ambassador.html
- Install seldon-core operator: https://docs.seldon.io/projects/seldon-core/en/latest/workflow/install.html
- Seldon-core-analytics installation: https://docs.seldon.io/projects/seldon-core/en/latest/charts/seldon-core-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