Requirements: You should have:
- Docker up and running. Docker Installation Tutorial
- kubectl and Minikube up and running. Kubernetes Installation Tutorial.
Clone Kipoi Webapp Backend, Kipoi Webapp Frontend and Kipoi Webapp Router repositories. Ideally, they should be in the same
Copy the kubernetes folder inside kipoi-webapp-backend directory into the same parent folder.
Since there are two Kipoi environments, we have two different Flask apps to use those. Another app does the routing between them.
- Navigate into
kipoi-webapp-backend - Build the keras2 environment app:
docker build -f Dockerfile -t YOUR_DOCKER_USERNAME/kipoi-backend-keras2:latest . - Push the keras2 environment app:
docker push YOUR_DOCKER_USERNAME/kipoi-backend-keras2:latest - Build the keras1 environment app:
docker build -f Dockerfile2 -t YOUR_DOCKER_USERNAME/kipoi-backend-keras1:latest . - Push the keras1 environment app:
docker push YOUR_DOCKER_USERNAME/kipoi-backend-keras1:latest
- Navigate into
kubernetesfolder. - Change
goktugerceinkipoi-backend-keras1-deployment.yamlandkipoi-backend-keras2-deployment.yamlwithYOUR_DOCKER_USERNAME. - Deploy the Flask apps on pods:
kubectl apply -f kipoi-backend-keras2-deployment.yaml --recordkubectl apply -f kipoi-backend-keras1-deployment.yaml --record
- Check container statuses with
kubectl get podsand wait until both containers are running. - Deploy the load balancer services:
kubectl apply -f service-kipoi-backend-keras2-lb.yamlkubectl apply -f service-kipoi-backend-keras1-lb.yaml
- Find the IPs of services with
minikube service list
- Navigate into
kipoi-webapp-router - Build the Docker image:
docker build -f Dockerfile -t YOUR_DOCKER_USERNAME/kipoi-router:latest .
- Publish the Docker image:
docker push YOUR_DOCKER_USERNAME/kipoi-router:latest
- Edit
kipoi-backend-router.yamlaccordingly with IPs of environment services. - Replace
goktugercewithYOUR_DOCKER_USERNAMEin the same file. - Deploy it in a pod:
kubectl apply -f kipoi-backend-router.yaml --record
- Deploy the load balancer service:
kubectl apply -f service-kipoi-router-lb.yaml
- Find the IP of service with
minikube service list
- Navigate into
demo-webapp-frontendfolder. - Edit
src/helpers/URL.jsfile with IP address of the router service. - Run
yarn installto install necessary packages. - Run
yarn buildto package the frontend app. - Build the Docker image:
docker build -f Dockerfile -t YOUR_DOCKER_USERNAME/kipoi-frontend:latest .
- Publish the Docker image:
docker push YOUR_DOCKER_USERNAME/kipoi-frontend
- Deploy the frontend app in a pod:
kubectl apply -f kipoi-frontend-deployment.yaml --record
- Deploy the load balancer service
kubectl apply -f service-kipoi-frontend-lb.yaml
- Find the IP of frontend app with
minikube service list - Navigate to the IP and start using the app.
