As part of a Cloud and Distributed Systems lecture, we developed a scalable application in the form of an image classifier meant for deployment on Kubernetes. We also created our own Kubernetes infrastructure bare metal server, complete with loadbalancing and ingress-support.
python -m venv .venv
./.venv/bin/activate
To install backend use:
pip install -e ./backend -e ./frontend
Or for dev install:
pip install -e "./backend[dev]" -e "./frontend[dev]"
-
Run backend locally with flask dev-server
python -m meds_cloud.backend.app
-
Predict an image using webapi (here using curl):
curl \ --request POST 'localhost:5000/predict' \ --form 'image=@"../classifier_model/dog.jpg"'
- Run backend locally with flask dev-server
python -m meds_cloud.backend.app
- Run frontend locally with flask dev-server
python -m meds_cloud.frontend.app
- Navigate to frontend-webendpoint
Buildkit is necessary for caching pip packages. To build the image use:
DOCKER_BUILDKIT=1 docker build -t meds_cloud:backend-latest ./backend/
DOCKER_BUILDKIT=1 docker build -t meds_cloud:frontend-latest ./frontend/
In the folder deployments there are three kubectl-files for the frontend-service, the backend-service, and an ingress. You can use these files to install the complete application to a Kubernetes cluster. Mind you need to change the image-url for frontend and backend if you want to use your own images
You can use latexmk -pdf main.tex
to build the documentation pdf. The documentation contains detailed explanations on how to build a Kubernetes cluster from the ground up, as well as deploying the service into said cluster.