Skip to content

Deploy A/B testing infrastructure in a containerized microservice architecture for Machine Learning applications.

License

Notifications You must be signed in to change notification settings

savadev/ab-testing-in-ml

 
 

Repository files navigation

A/B Testing for ML applications

Deploy A/B testing infrastructure in a containerized microservice architecture for Machine Learning applications.

Requirements

This repository uses Kubernetes, helm, ambassador, seldon-core, and seldon-core-analytics.

Getting started

Install prerequisites

  1. Install helm
brew install helm
  1. Create a Kubernetes cluster: AKS, EKS, GKE or local cluster. For local clusters, one can use minikube, kind, or k3s. For instance:
    1. Minikube
    make minikube
    1. 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

Train model

Prepare the model artifacts:

make train

Build container images

One can build the images locally, or use Cloud Submit:

Locally

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 .

Cloud Submit

gcloud builds submit --config cloudbuild-modela.yaml
gcloud builds submit --config cloudbuild-modelb.yaml
gcloud builds submit --config cloudbuild-streamlit.yaml

(minikube only) Load models on minikube's registry

make load

Deploy required components

  • ambassador
make ambassador
  • seldon-core-analytics
make seldon-core-analytics
  • seldon-core
make seldon-core

Deployment

make abtest

Port-forward ambassador

make port

Port-forward Grafana

make port-grafana

Start Streamlit App

make streamlit

References

About

Deploy A/B testing infrastructure in a containerized microservice architecture for Machine Learning applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 78.9%
  • Makefile 17.5%
  • Brainfuck 3.6%