SlideShare a Scribd company logo
Delivering Docker & K3s to IoT
Edge device
Ajeet S Raina
- Docker Captain
- ARM Innovator
- Author @ collabnix.com
- Docker Community Leader
- DevRel at Redis Labs
- Worked in Dell, VMware & CGI
$whoami
@ajeetsraina
Cloud-Native on IoT Edge (Jetson Nano)
- Cloud-Native technologies offer the flexibility and
agility needed for rapid product development and
continual product upgrades.
- Jetson brings Cloud-Native to the edge and
enables technologies like containers and
container orchestration which revolutionized
cloud applications.
- NVIDIA JetPack includes NVIDIA Container
Runtime with Docker integration, enabling GPU
accelerated containerized applications on Jetson
platform.
- Developers can package their applications for
Jetson with all its dependencies into a single
container that is guaranteed to work in any
deployment environment.
NVIDIA Jetson Nano Edge - AI Computer
2 GB / 4 GB
$59 / $99
Jetson Software for AI Edge Device
Getting Started
● microSD card (32GB UHS-1 minimum recommended) - used as a boot device & for main storage
● USB keyboard and mouse
● Computer display (HDMI or DP)
● Micro-USB power supply
● SD Card image - https://developer.nvidia.com/jetson-nano-sd-card-image
Delivering Docker & K3s worloads to IoT Edge devices
Docker support for NVIDIA Jetson Nano
Docker comes with
Jetson Nano, by
default
Docker on NVIDIA Jetson Nano
Build on Open Source
● Install the latest version of Docker
curl https://get.docker.com | sh 
&& sudo systemctl --now enable docker
● Setting NVIDIA Container Toolkit
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) 
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - 
&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
● Install nvidia-docker2 package
$ sudo apt-get install -y nvidia-docker2
$ sudo systemctl restart docker
● Running Ubuntu ARM container
docker run -it arm64v8/ubuntu /bin/bash
Docker Compose support for NVIDIA Jetson Nano
$ export DOCKER_COMPOSE_VERSION=1.27.4
$ sudo apt-get install libhdf5-dev
$ sudo apt-get install libssl-dev
$ sudo pip3 install 
docker-compose=="${DOCKER_COMPOSE_VERSION}"
$ apt install python3
$ apt install python3-pip
$ pip install docker-compose
Enabling GPU access with Compose
Build on Open Source
● Compose services can define GPU device reservations
services:
test:
image: nvidia/cuda:10.2-base
command: nvidia-smi
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu, utility]
ia-smi
● Bring up GPU-enabled Docker container
$ docker-compose up
Creating network "gpu_default" with the default driver
Creating gpu_test_1 ... done
Attaching to gpu_test_1
test_1 |
+-----------------------------------------------------
------------------------+
test_1 | | NVIDIA-SMI 450.80.02 Driver Version:
450.80.02 CUDA Version: 11.1 |
test_1 |
|-------------------------------+---------------------
-+----------------------+
======================================================
==============|
If nvidia-smi is no longer available, use
tegrastats/jtop
$ sudo docker run --rm -it --gpus all 
-v /run/jtop.sock:/run/jtop.sock ajeetraina/jetson-stats-nano jtop
Checking the Jetson CUDA Information
- Hardware
- OS version
- CUDA version
- CUDA arch
- OpenCV
- TensorRT
- Linux Kernel Version
There is no support for CUDA
11 for Jetson board as of now
CUDA is an API created by NVIDIA to talk to NVIDIA GPU devices
CUDA Compiler & Libraries
CUDA is an API created by NVIDIA to talk to NVIDIA GPU devices
Interesting? How shall I build those
apps from scratch?
-
-
A Generic Docker Workflow
BUILD SHIP RUN
A Generic Docker Workflow
BUILD SHIP RUN
$ docker run ajeetraina/hellowhale:latest
Identifying
the
Docker
Image
Arch
> terminal
$ docker run --rm mplatform/mquery ajeetraina/hellowhale:latest
Image: ajeetraina/hellowhale:latest (digest:
sha256:50e5d8b034ff3a0d537224e332da0ee74e393df36acefa6859daba5
8712ad1f4)
* Manifest List: No (Image type:
application/vnd.docker.distribution.manifest.v2+json)
* Supports: linux/amd64
A Generic Docker Workflow (Edge)
BUILD SHIP RUN
A Generic Docker Workflow (Edge)
BUILD SHIP RUN
$ docker run hello-world
Hello from Docker !
Support
for
Multi-arch
Platform
> terminal
$ docker run --rm mplatform/mquery hello-world:latest
Image: hello-world:latest (digest:
sha256:5122f6204b6a3596e048758cabba3c46b1c937a46b5be6225b835d091b90e46c
)
* Manifest List: Yes (Image type:
application/vnd.docker.distribution.manifest.list.v2+json)
* Supported platforms:
- linux/amd64
- linux/arm/v5
- linux/arm/v7
- linux/arm64/v8
- linux/386
- linux/mips64le
- linux/ppc64le
- linux/s390x
- windows/amd64:10.0.17763.1935
Support
for
Multi-arch
Platform
Docker Compose v2.0
$ docker compose --project-name demo up
[+] Running 3/4
⠿ Network demo_default Created
4.0s
⠿ Volume "demo_db_data" Created
0.0s
⠿ Container demo_db_1 Started
2.2s
⠿ Container demo_wordpress_1 Starting
Do I need ARM-based devices to
build ARM-based images?
Not necessarily.
Buildx - A CLI Plugin to build Multi-arch Docker Images
BUILD SHIP RUN
$ docker buildx build --platform linux/arm/v7, linux/arm/v8 -t
Delivering Docker & K3s worloads to IoT Edge devices
K3s - A Lightweight Kubernetes
Build on Open Source
● Fully compliant Kubernetes distribution
● Easy to install, half the memory
● Lightweight storage backend based on sqlite3
● Support etcd3, MySQL, PostgreSQL
● All in a binary of less than 100 MB
● Install K3s on Edge
$ curl -sfL https://get.k3s.io | sh -
● Add worker nodes
$ sudo curl -sfL https://get.k3s.io |
K3S_URL=https://pico1:6443 K3S_TOKEN=
**K3s support both Docker & Containerd as runtime
Running deviceQuery on Docker with GPU Support
Running deviceQuery on Docker with GPU Support
Running deviceQuery on Containerd with GPU
Support
Running deviceQuery on K3 Cluster
Running deviceQuery on K3 Cluster
Smart Camera system for Real-Time Crowd Face Mask detection
Docker + Edge AI + Camera
Real-time Implementations
Mask Detection System running on Jetson Nano
[Confidential]
- A Jetson Nano Dev Kit running JetPack 4.4.1 or 4.5
- An external DC 5 volt, 4 amp power supply connected through the Dev Kit's
barrel jack connector (J25). (See these instructions on how to enable barrel
jack power.) This software makes full use of the GPU, so it will not run with
USB power.
- A USB webcam attached to your Nano
- Another computer with a program that can display RTSP streams -- we
suggest VLC or QuickTime.
$ sudo docker run --runtime nvidia 
--privileged --rm -it 
--env MASKCAM_DEVICE_ADDRESS=<your-jetson-ip> 
-p 1883:1883 
-p 8080:8080 
-p 8554:8554 
maskcam/maskcam-beta
Delivering Docker & K3s worloads to IoT Edge devices
CherryBot Systems - AI-Powered Payload Delivery System
[Confidential]
- AI-based payload delivery robot
- Low-cost autonomous robot system
- Equipped with NVIDIA Jetson Nano
board, a low-powered AI deployed as
Edge device, a sensor suite that
includes multiple cameras, GPS and
swappable batteries
- Uses deep learning to correctly
interpret data gathered from its
sensors and to make intelligent
decisions that ensure a fast, safe and
cost efficient delivery.
- It can correctly identify objects or
people or detect objects and
obstacles to avoid collisions in a safe
reliable manner.
CherryBot Systems - AI-Powered Payload Delivery System
[Confidential]
CherryBot Systems
[Confidential]
Food Delivery Swag Distribution Medicine Delivery
Delivering Docker & K3s worloads to IoT Edge devices
References
https://github.com/collabnix/ioetplanet
https://collabnix.com
Thank You

More Related Content

PDF
Docker Registry V2
Docker, Inc.
 
PDF
Kubernetes 101
Winton Winton
 
PPTX
Introduction to k3s and k3sup
Saiyam Pathak
 
PDF
Kubernetes - A Comprehensive Overview
Bob Killen
 
PDF
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
PPTX
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能について
NTT DATA Technology & Innovation
 
PDF
Kubernetes Basics
Eueung Mulyana
 
PPTX
Kubernetes 101 for Beginners
Oktay Esgul
 
Docker Registry V2
Docker, Inc.
 
Kubernetes 101
Winton Winton
 
Introduction to k3s and k3sup
Saiyam Pathak
 
Kubernetes - A Comprehensive Overview
Bob Killen
 
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Deep Dive into the Linux Kernel - メモリ管理におけるCompaction機能について
NTT DATA Technology & Innovation
 
Kubernetes Basics
Eueung Mulyana
 
Kubernetes 101 for Beginners
Oktay Esgul
 

What's hot (20)

PDF
CKA Certified Kubernetes Administrator Notes
Adnan Rashid
 
PPTX
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
PDF
Unit 1: Apply the Twelve-Factor App to Microservices Architectures
NGINX, Inc.
 
PPTX
Kubernetes Basics
Rishabh Kumar
 
PDF
日本OpenStackユーザ会 第37回勉強会
Yushiro Furukawa
 
PDF
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
XavierPestel
 
PDF
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Open Source Consulting
 
PPTX
Rancher and Kubernetes Best Practices
Avinash Patil
 
PPTX
Docker Swarm for Beginner
Shahzad Masud
 
PPTX
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
PPTX
DevOps with Kubernetes
EastBanc Tachnologies
 
PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PPTX
Navigating Disaster Recovery in Kubernetes and CNCF Crossplane
Carlos Santana
 
PPTX
MySQL Monitoring using Prometheus & Grafana
YoungHeon (Roy) Kim
 
PDF
Kubernetes Networking
CJ Cullen
 
PDF
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Edureka!
 
PDF
Kubernetes
erialc_w
 
PDF
Introduction and Deep Dive Into Containerd
Kohei Tokunaga
 
PDF
Getting Started with Kubernetes
VMware Tanzu
 
PDF
Docker (Compose) 활용 - 개발 환경 구성하기
raccoony
 
CKA Certified Kubernetes Administrator Notes
Adnan Rashid
 
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
Unit 1: Apply the Twelve-Factor App to Microservices Architectures
NGINX, Inc.
 
Kubernetes Basics
Rishabh Kumar
 
日本OpenStackユーザ会 第37回勉強会
Yushiro Furukawa
 
Pipeline Devops - Intégration continue : ansible, jenkins, docker, jmeter...
XavierPestel
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Open Source Consulting
 
Rancher and Kubernetes Best Practices
Avinash Patil
 
Docker Swarm for Beginner
Shahzad Masud
 
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
DevOps with Kubernetes
EastBanc Tachnologies
 
Introduction to Kubernetes Workshop
Bob Killen
 
Navigating Disaster Recovery in Kubernetes and CNCF Crossplane
Carlos Santana
 
MySQL Monitoring using Prometheus & Grafana
YoungHeon (Roy) Kim
 
Kubernetes Networking
CJ Cullen
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Edureka!
 
Kubernetes
erialc_w
 
Introduction and Deep Dive Into Containerd
Kohei Tokunaga
 
Getting Started with Kubernetes
VMware Tanzu
 
Docker (Compose) 활용 - 개발 환경 구성하기
raccoony
 
Ad

Similar to Delivering Docker & K3s worloads to IoT Edge devices (20)

PDF
Quantifying Your World with AI & Docker on the Edge | OSCONF 2020 Jaipur
Ajeet Singh Raina
 
PDF
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
PDF
Docker 進階實務班
Philip Zheng
 
PDF
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
Docker, Inc.
 
PDF
Tensorflow in Docker
Eric Ahn
 
PPTX
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
PDF
Introducing Docker
Francesco Pantano
 
PPTX
Develop with docker 2014 aug
Vincent De Smet
 
PPTX
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Patrick Chanezon
 
PPTX
Docker Ecosystem on Azure
Patrick Chanezon
 
PPTX
Real World Experience of Running Docker in Development and Production
Ben Hall
 
PDF
桃園市教育局Docker技術入門與實作
Philip Zheng
 
PDF
Docker security
Janos Suto
 
PDF
Docker for mere mortals
Henryk Konsek
 
PDF
Docker, Kubernetes, and Google Cloud
Samuel Chow
 
PPTX
Docker
Mutlu Okuducu
 
PPTX
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
PPTX
Dockerizing a Symfony2 application
Roman Rodomansky
 
PDF
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
PDF
Docker in everyday development
Justyna Ilczuk
 
Quantifying Your World with AI & Docker on the Edge | OSCONF 2020 Jaipur
Ajeet Singh Raina
 
廣宣學堂: 容器進階實務 - Docker進深研究班
Paul Chao
 
Docker 進階實務班
Philip Zheng
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
Docker, Inc.
 
Tensorflow in Docker
Eric Ahn
 
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Introducing Docker
Francesco Pantano
 
Develop with docker 2014 aug
Vincent De Smet
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Patrick Chanezon
 
Docker Ecosystem on Azure
Patrick Chanezon
 
Real World Experience of Running Docker in Development and Production
Ben Hall
 
桃園市教育局Docker技術入門與實作
Philip Zheng
 
Docker security
Janos Suto
 
Docker for mere mortals
Henryk Konsek
 
Docker, Kubernetes, and Google Cloud
Samuel Chow
 
[Codelab 2017] Docker 기초 및 활용 방안
양재동 코드랩
 
Dockerizing a Symfony2 application
Roman Rodomansky
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
Docker in everyday development
Justyna Ilczuk
 
Ad

More from Ajeet Singh Raina (20)

PDF
Delivering Container-based Apps to IoT Edge devices
Ajeet Singh Raina
 
PDF
Docker Trends & Statistics - A 20 Minutes Overview
Ajeet Singh Raina
 
PDF
Real time Object Detection and Analytics using RedisEdge and Docker
Ajeet Singh Raina
 
PDF
OSCONF Jaipur 2020 | Virtual Conference | Oct 10 | Ajeet Singh Raina
Ajeet Singh Raina
 
PDF
Keynote Slides | Ajeet Singh Raina | OSCONF 2020 Hyderabad
Ajeet Singh Raina
 
PDF
IoET Conference 2020 | Keynote Slides | Ajeet Singh Raina
Ajeet Singh Raina
 
PDF
OSCONF 2020 Kochi Conference | KubeZilla | 27 June 2020
Ajeet Singh Raina
 
PDF
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...
Ajeet Singh Raina
 
PDF
OSCONF 2020 Bengaluru | Powered by Collabnix | Keynote Slides
Ajeet Singh Raina
 
PDF
Top 5 Helpful Tips to Grow Your Local Docker Community
Ajeet Singh Raina
 
PDF
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Ajeet Singh Raina
 
PDF
Demystifying the Nuts & Bolts of Kubernetes Architecture
Ajeet Singh Raina
 
PDF
Introduction to Docker Compose
Ajeet Singh Raina
 
PDF
Kubernetes Monitoring & Best Practices
Ajeet Singh Raina
 
PDF
Current State of Docker Platform - Nov 2019
Ajeet Singh Raina
 
PDF
Collabnix Online Webinar: Integrated Log Analytics & Monitoring using Docker ...
Ajeet Singh Raina
 
PDF
Introduction to Docker Compose | Docker Intermediate Workshop
Ajeet Singh Raina
 
PDF
Simplifying Real Time Data Analytics with Docker, IoT & Cloud
Ajeet Singh Raina
 
PDF
Introducing Pico - Object Detection & Analytics using Docker, IoT & Amazon Re...
Ajeet Singh Raina
 
PDF
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Ajeet Singh Raina
 
Delivering Container-based Apps to IoT Edge devices
Ajeet Singh Raina
 
Docker Trends & Statistics - A 20 Minutes Overview
Ajeet Singh Raina
 
Real time Object Detection and Analytics using RedisEdge and Docker
Ajeet Singh Raina
 
OSCONF Jaipur 2020 | Virtual Conference | Oct 10 | Ajeet Singh Raina
Ajeet Singh Raina
 
Keynote Slides | Ajeet Singh Raina | OSCONF 2020 Hyderabad
Ajeet Singh Raina
 
IoET Conference 2020 | Keynote Slides | Ajeet Singh Raina
Ajeet Singh Raina
 
OSCONF 2020 Kochi Conference | KubeZilla | 27 June 2020
Ajeet Singh Raina
 
Accelerate Your Automation Testing Effort using TestProject & Docker | Docker...
Ajeet Singh Raina
 
OSCONF 2020 Bengaluru | Powered by Collabnix | Keynote Slides
Ajeet Singh Raina
 
Top 5 Helpful Tips to Grow Your Local Docker Community
Ajeet Singh Raina
 
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Ajeet Singh Raina
 
Demystifying the Nuts & Bolts of Kubernetes Architecture
Ajeet Singh Raina
 
Introduction to Docker Compose
Ajeet Singh Raina
 
Kubernetes Monitoring & Best Practices
Ajeet Singh Raina
 
Current State of Docker Platform - Nov 2019
Ajeet Singh Raina
 
Collabnix Online Webinar: Integrated Log Analytics & Monitoring using Docker ...
Ajeet Singh Raina
 
Introduction to Docker Compose | Docker Intermediate Workshop
Ajeet Singh Raina
 
Simplifying Real Time Data Analytics with Docker, IoT & Cloud
Ajeet Singh Raina
 
Introducing Pico - Object Detection & Analytics using Docker, IoT & Amazon Re...
Ajeet Singh Raina
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Ajeet Singh Raina
 

Recently uploaded (20)

PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Software Development Methodologies in 2025
KodekX
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 

Delivering Docker & K3s worloads to IoT Edge devices

  • 1. Delivering Docker & K3s to IoT Edge device Ajeet S Raina
  • 2. - Docker Captain - ARM Innovator - Author @ collabnix.com - Docker Community Leader - DevRel at Redis Labs - Worked in Dell, VMware & CGI $whoami @ajeetsraina
  • 3. Cloud-Native on IoT Edge (Jetson Nano) - Cloud-Native technologies offer the flexibility and agility needed for rapid product development and continual product upgrades. - Jetson brings Cloud-Native to the edge and enables technologies like containers and container orchestration which revolutionized cloud applications. - NVIDIA JetPack includes NVIDIA Container Runtime with Docker integration, enabling GPU accelerated containerized applications on Jetson platform. - Developers can package their applications for Jetson with all its dependencies into a single container that is guaranteed to work in any deployment environment.
  • 4. NVIDIA Jetson Nano Edge - AI Computer 2 GB / 4 GB $59 / $99
  • 5. Jetson Software for AI Edge Device
  • 6. Getting Started ● microSD card (32GB UHS-1 minimum recommended) - used as a boot device & for main storage ● USB keyboard and mouse ● Computer display (HDMI or DP) ● Micro-USB power supply ● SD Card image - https://developer.nvidia.com/jetson-nano-sd-card-image
  • 8. Docker support for NVIDIA Jetson Nano Docker comes with Jetson Nano, by default
  • 9. Docker on NVIDIA Jetson Nano Build on Open Source ● Install the latest version of Docker curl https://get.docker.com | sh && sudo systemctl --now enable docker ● Setting NVIDIA Container Toolkit distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list ● Install nvidia-docker2 package $ sudo apt-get install -y nvidia-docker2 $ sudo systemctl restart docker ● Running Ubuntu ARM container docker run -it arm64v8/ubuntu /bin/bash
  • 10. Docker Compose support for NVIDIA Jetson Nano $ export DOCKER_COMPOSE_VERSION=1.27.4 $ sudo apt-get install libhdf5-dev $ sudo apt-get install libssl-dev $ sudo pip3 install docker-compose=="${DOCKER_COMPOSE_VERSION}" $ apt install python3 $ apt install python3-pip $ pip install docker-compose
  • 11. Enabling GPU access with Compose Build on Open Source ● Compose services can define GPU device reservations services: test: image: nvidia/cuda:10.2-base command: nvidia-smi deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu, utility] ia-smi ● Bring up GPU-enabled Docker container $ docker-compose up Creating network "gpu_default" with the default driver Creating gpu_test_1 ... done Attaching to gpu_test_1 test_1 | +----------------------------------------------------- ------------------------+ test_1 | | NVIDIA-SMI 450.80.02 Driver Version: 450.80.02 CUDA Version: 11.1 | test_1 | |-------------------------------+--------------------- -+----------------------+ ====================================================== ==============|
  • 12. If nvidia-smi is no longer available, use tegrastats/jtop $ sudo docker run --rm -it --gpus all -v /run/jtop.sock:/run/jtop.sock ajeetraina/jetson-stats-nano jtop
  • 13. Checking the Jetson CUDA Information - Hardware - OS version - CUDA version - CUDA arch - OpenCV - TensorRT - Linux Kernel Version There is no support for CUDA 11 for Jetson board as of now CUDA is an API created by NVIDIA to talk to NVIDIA GPU devices
  • 14. CUDA Compiler & Libraries CUDA is an API created by NVIDIA to talk to NVIDIA GPU devices
  • 15. Interesting? How shall I build those apps from scratch? - -
  • 16. A Generic Docker Workflow BUILD SHIP RUN
  • 17. A Generic Docker Workflow BUILD SHIP RUN $ docker run ajeetraina/hellowhale:latest
  • 18. Identifying the Docker Image Arch > terminal $ docker run --rm mplatform/mquery ajeetraina/hellowhale:latest Image: ajeetraina/hellowhale:latest (digest: sha256:50e5d8b034ff3a0d537224e332da0ee74e393df36acefa6859daba5 8712ad1f4) * Manifest List: No (Image type: application/vnd.docker.distribution.manifest.v2+json) * Supports: linux/amd64
  • 19. A Generic Docker Workflow (Edge) BUILD SHIP RUN
  • 20. A Generic Docker Workflow (Edge) BUILD SHIP RUN $ docker run hello-world Hello from Docker !
  • 21. Support for Multi-arch Platform > terminal $ docker run --rm mplatform/mquery hello-world:latest Image: hello-world:latest (digest: sha256:5122f6204b6a3596e048758cabba3c46b1c937a46b5be6225b835d091b90e46c ) * Manifest List: Yes (Image type: application/vnd.docker.distribution.manifest.list.v2+json) * Supported platforms: - linux/amd64 - linux/arm/v5 - linux/arm/v7 - linux/arm64/v8 - linux/386 - linux/mips64le - linux/ppc64le - linux/s390x - windows/amd64:10.0.17763.1935
  • 22. Support for Multi-arch Platform Docker Compose v2.0 $ docker compose --project-name demo up [+] Running 3/4 ⠿ Network demo_default Created 4.0s ⠿ Volume "demo_db_data" Created 0.0s ⠿ Container demo_db_1 Started 2.2s ⠿ Container demo_wordpress_1 Starting
  • 23. Do I need ARM-based devices to build ARM-based images? Not necessarily.
  • 24. Buildx - A CLI Plugin to build Multi-arch Docker Images BUILD SHIP RUN $ docker buildx build --platform linux/arm/v7, linux/arm/v8 -t
  • 26. K3s - A Lightweight Kubernetes Build on Open Source ● Fully compliant Kubernetes distribution ● Easy to install, half the memory ● Lightweight storage backend based on sqlite3 ● Support etcd3, MySQL, PostgreSQL ● All in a binary of less than 100 MB ● Install K3s on Edge $ curl -sfL https://get.k3s.io | sh - ● Add worker nodes $ sudo curl -sfL https://get.k3s.io | K3S_URL=https://pico1:6443 K3S_TOKEN= **K3s support both Docker & Containerd as runtime
  • 27. Running deviceQuery on Docker with GPU Support
  • 28. Running deviceQuery on Docker with GPU Support
  • 29. Running deviceQuery on Containerd with GPU Support
  • 32. Smart Camera system for Real-Time Crowd Face Mask detection Docker + Edge AI + Camera Real-time Implementations
  • 33. Mask Detection System running on Jetson Nano [Confidential] - A Jetson Nano Dev Kit running JetPack 4.4.1 or 4.5 - An external DC 5 volt, 4 amp power supply connected through the Dev Kit's barrel jack connector (J25). (See these instructions on how to enable barrel jack power.) This software makes full use of the GPU, so it will not run with USB power. - A USB webcam attached to your Nano - Another computer with a program that can display RTSP streams -- we suggest VLC or QuickTime. $ sudo docker run --runtime nvidia --privileged --rm -it --env MASKCAM_DEVICE_ADDRESS=<your-jetson-ip> -p 1883:1883 -p 8080:8080 -p 8554:8554 maskcam/maskcam-beta
  • 35. CherryBot Systems - AI-Powered Payload Delivery System [Confidential] - AI-based payload delivery robot - Low-cost autonomous robot system - Equipped with NVIDIA Jetson Nano board, a low-powered AI deployed as Edge device, a sensor suite that includes multiple cameras, GPS and swappable batteries - Uses deep learning to correctly interpret data gathered from its sensors and to make intelligent decisions that ensure a fast, safe and cost efficient delivery. - It can correctly identify objects or people or detect objects and obstacles to avoid collisions in a safe reliable manner.
  • 36. CherryBot Systems - AI-Powered Payload Delivery System [Confidential]
  • 37. CherryBot Systems [Confidential] Food Delivery Swag Distribution Medicine Delivery