Project to demonstrate a Kafka deployment in a local Kubernetes environment that simulates streaming videos, classifies the frames images using a machine learning model and uploads the predictions to a MongoDB collection
- Docker
- Minikube
- Kafka
- MongoDB
- OpenCV
- Tensorflow
- Docker: open platform for developing, shipping, and running applications
- Minikube: local Kubernetes, focusing on making it easy to learn and develop
-
Clone the repository
https://github.com/felipeall/streaming-video-classifier.git
-
Put videos files in the following folder:
streaming-video-classifier/apps/video-producer/videos
Supported formats are:
avi
,mp4
andwebm
tl;dr: make run
-
Start minikube service
minikube start
-
Deploy Zookeeper and Kafka Broker
kubectl apply -f kubernetes/zookeeper.yaml kubectl wait $(kubectl get pods -o name) --for=condition=Ready --timeout=600s kubectl apply -f kubernetes/kafka-broker.yaml
-
Deploy MongoDB
kubectl apply -f kubernetes/mongodb.yaml
-
Build and deploy Video Consumer
docker build -t video-consumer -f apps/video-consumer/Dockerfile apps/video-consumer minikube image load video-consumer kubectl apply -f kubernetes/video-consumer.yaml
-
Build and deploy Video Producer
docker build -t video-producer -f apps/video-producer/Dockerfile apps/video-producer minikube image load video-producer kubectl apply -f kubernetes/video-producer.yaml
In order to check the output, enable MongoDB port forwarding:
make mongodb-local
And connect to the database locally via:
mongodb://localhost:27017