Giter Club home page Giter Club logo

ml-k8s's Introduction

Deploying Pet-Bokeh using Kubernetes with Nvidia Triton on EC2

Deployment on EC2

Create EC2 Instance

Install dependencies

  • Get the ip address of the instance
  • Change key permissions to 400 (chmod 400 key.pem)
  • SSH into the machine ssh -i key.pem [email protected]
  • Install git if needed (sudo apt install git for ubuntu based distros, sudo yum install git for amazon linux)
  • Install Docker (sudo apt install docker for ubuntu based distros, sudo yum install docker for amazon linux)
  • Start Docker (sudo systemctl start docker)
  • Add user to docker group (sudo usermod -aG docker ${USER})
  • Logout and Login again through SSH to take the group changes into account
  • Check if docker installed correctly (docker run hello-world)
  • Install minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

  • Start a minikube cluster (minikube start)
  • Set an alias for kubectl (alias kubectl="minikube kubectl --")
  • For triton we need to add the credentials as secrets
kubectl create secret generic aws-env --from-literal='AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY' --from-literal='AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY' --from-literal='AWS_DEFAULT_REGION=us-east-1'

Locally built images

  • Use minikube's docker (eval $(minikube docker-env))
  • Pull the triton image (docker pull nvcr.io/nvidia/tritonserver:22.06-py3)
  • Build all the docker images
docker build -t main .
docker build -t face-emotion face-emotion/
docker build -t pet-bokeh pet-bokeh/
  • Load all the kubernetes resources (kubectl apply -f K8s/)
  • Forward the main port (kubectl port-forward svc/main 8004:8004 --address 0.0.0.0)

Pulling from ECR

  • Configure credentials (minikube addons configure registry-creds)
  • Enable the addon (minikube addons enable registry-creds)
  • Edit K8s/ECR/*.yaml to use your ECRs
  • Load all the kubernetes resources (kubectl apply -f K8s/)
  • Forward the main port (kubectl port-forward svc/main 8004:8004 --address 0.0.0.0)

ml-k8s's People

Contributors

narenb7 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.