You need a Ubuntu Linux to do this.
An Ubuntu in Virtual Machine is okay.
- Install docker
sudo apt install docker.io
# start docker daemon
sudo systemctl start docker
- Install minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start
- Train the model
Install dependencies first
sudo apt install python3-pip
pip install tensorflow numpy mnist keras
create train.py file.
train the model
python3 train.py
- Create an API service
Install FastAPI dependencies
pip install fastapi "uvicorn[standard]" Pillow
create api.py file.
- Build Docker image
First create an account on Docker Hub
And Create a repository called digitreader
.
Notice that zigzigcheers
shown below is my Docker Hub account name, be sure to replace it with your account name
docker build -t zigzigcheers/digitreader:v1 .
test if it works
docker run -d -p 8080:8080 zigzigcheers/digitreader:v1
ok, let's push it to Docker Hub
docker push zigzigcheers/digitreader:v1
- Deploy to Kubernetes Cluster
kubectl create deployment digitreader --image=zigzigcheers/digitreader:v1
kubectl expose deployment digitreader --type=LoadBalancer --port=8080
- Next steps
Using AWS service to make it better
- Amazon Polly - Text to Speach service
- Amazon Translate - Translation service