Advertisement
Advertisement

More Related Content

Slideshows for you(20)

Similar to Delivering Container-based Apps to IoT Edge devices(20)

Advertisement

More from Ajeet Singh Raina(20)

Advertisement

Delivering Container-based Apps to IoT Edge devices

  1. Ajeet Singh Raina Delivering Container-based Apps to IoT Edge devices Developer Relations Manager, Redis Labs @ajeetsraina
  2. - Docker Captain - ARM Innovator - Author @ collabnix.com - Docker Community Leader - DevRel at Redis Labs - Worked in Dell, VMware & CGI About Me Ajeet Singh Raina
  3. - The Rise of Docker for AI - Autonomous Robotic Platform - Docker on IoT Edge - IoT Edge Sensor Analytics - Real-time video analytics - Real-time Crowd Mask detection Agenda
  4. Around 94% of AI Adopters are using or plan to use containers within 1 year time. Source: 451 Research
  5. A Food Delivery Robot - An autonomous robot system - Camera - Sensors - GPS - NVIDIA Jetson TX2 A Food Delivery Robot - An autonomous robot system - Camera - Sensors - GPS - NVIDIA Jetson board
  6. NVIDIA Jetson Nano Edge - AI Computer 2 GB / 4 GB $59 / $99
  7. But how shall I build app for such robotic platform in a faster pace?
  8. 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
  9. Docker access to NVIDIA GPU Build on Open Source ● Pre-requisite $ apt-get install nvidia-container-runtime ● Expose GPU for use $ docker run -it --rm --gpus all ubuntu nvidia-smi ● Specify the GPUs $ docker run -it --rm --gpus device=GPU-3a23c669-1f69-c64e-cf85-44e9b07e7a2a ubuntu nvidia-smi ● Set NVIDIA capabilities $ docker run --gpus 'all,capabilities=utility' --rm ubuntu nvidia-smi
  10. 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 ● Specify the GPUs $ 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 | |-------------------------------+--------------------- -+----------------------+ ====================================================== ==============|
  11. Interesting? How shall I build those apps from scratch? - -
  12. A Generic Docker Workflow BUILD SHIP RUN
  13. A Generic Docker Workflow BUILD SHIP RUN $ docker run ajeetraina/hellowhale:latest
  14. 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
  15. A Generic Docker Workflow (Edge) BUILD SHIP RUN
  16. A Generic Docker Workflow (Edge) BUILD SHIP RUN $ docker run hello-world Hello from Docker !
  17. 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
  18. Do I need ARM-based devices to build ARM-based images? Not necessarily.
  19. Buildx - A CLI Plugin to build Multi-arch Docker Images BUILD SHIP RUN $ docker buildx build --platform linux/arm/v7, linux/arm/v8 -t
  20. IoT Sensor Analytics BME680 Sensors + Docker + RedisTimeSeries + Grafana on Jetson Nano Real-Time Video Analytics Docker + Computer Vision + RedisEdge Smart Camera system for Real-Time Crowd Face Mask detection Docker + Edge AI + Camera Real-time Implementations
  21. Building IoT Sensor Analytics Ingest UI App RedisTimeSeries Sensors/IoT Redis Data Source for Grafana
  22. Hardware ~ Pimoroni BME680 Sensors Build on Open Source
  23. Plotting Temperature, Pressure & Humidity
  24. It’s Demo time..
  25. Real-Time Crowd Face Mask detection Docker + Edge AI + Camera
  26. Running Mask detection system Build on Open Source ● Open the daemon.json ( /etc/docker/daemon.json) { "runtimes": { "nvidia": { "path": "/usr/bin/nvidia-container-runtime", "runtimeArgs": [] } } } ● Restart docker $ systemctl restart docker You also need to install nvidia-container-runtime $ sudo apt install nvidia-container-runtime $ sudo docker pull maskcam/maskcam-beta $ 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
  27. Mask Detection System
  28. References https://github.com/collabnix/ioetplanet https://collabnix.com https://github.com/redis-developer/redis-datasets https://github.com/collabnix/redisedge-grafana
  29. Thank You.
Advertisement