Code Monkey home page Code Monkey logo

bionet's Introduction

bionet

Running the app

Docker compose

# DEBUG MODE
# buid docker images based on docker-compose config; running on port 7800
docker compose -f docker-compose.dev.yml up --build

# stop running container
docker compose -f docker-compose.dev.yml down

# to restart on detach mode
docker compose -f docker-compose.dev.yml up -d

# PROD MODE
# buid docker images based on docker-compose config; running on port 7800
docker compose -f docker-compose.prod.yml up --build

# stop running container
docker compose -f docker-compose.prod.yml down

# to restart on detach mode
docker compose -f docker-compose.prod.yml up -d

# check images
docker images

# clean slate
docker system prune -a && docker images prune -a && docker volume prune -a

Kubernetes

# build the app images and ensure the the app runs on dockerize mode before running K8s
cd bionet-ui/ && docker build -t aiotrope/bionet-ui -f ./k8s.Dockerfile .

# check images
docker images

# tag the image
docker tag aiotrope/bionet-ui aiotrope/bionet-ui

# push to docker hub
docker push aiotrope/bionet-ui

# check if dockerized app will run at port specified port e.g 8000
docker run -d -p 8000:4321 aiotrope/bionet-ui:latest
docker ps

# stop running dockerized app
docker stop $(docker ps -a -q)

# start minikube
cd kubernetes/ && minikube start

# start a new terminal, and leave this running
minikube dashboard

# enable metric server
minikube addons enable metrics-server
# check if metric server is running
kubectl get pods -n kube-system

# create new namespace & set it as a default namespace
kubectl create namespace bionet-namespace && kubectl config set-context --current --namespace=bionet-namespace

# deploy to k8s
kubectl apply -f bionet-ui-deployment.yml
kubectl apply -f bionet-ui-service.yml
kubectl apply -f bionet-ui-deployment-hpa.yml

# check deployment
kubectl get deployments

# check services
kubectl get services
kubectl get svc

# check hpa
kubectl get hpa

# check and ensure the pods are running with no errors
kubectl get pods

# check resource usage of the pods
kubectl top pod

# check auto-scaling
minikube service bionet-ui-service -n bionet-namespace --url
# e.g http://127.0.0.1:50766

# access k86 deployed service
minikube service -n bionet-namespace bionet-ui-service

# auto scaling without config file
kubectl autoscale -f bionet-ui-deployment.yml --min=2 --max=5 --cpu-percent=5
# check hpa
kubectl get hpa
# delete auto scaling
kubectl delete hpa bionet-ui-deployment

# delete and cleanup
kubectl delete -f bionet-ui-deployment.yml
kubectl delete -f bionet-ui-service.yml
kubectl delete -f bionet-ui-deployment-hpa.yml
# stop cluster but no deletion
minikube stop

# delete all 
kubectl delete pods --all -A
kubectl delete deploy --all -A
kubectl delete all --all -A # all resources
minikube delete

bionet's People

Contributors

aiotrope avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.