SlideShare a Scribd company logo
1 of 19
Docker
Good development methods
19 July 2021
Brennard Pierce / Vatan Aksoy Tezer
PickNik Robotics
bren.pierce@picknik.ai / vatan@picknik.ai
Outline
● What is docker? (Vatan)
○ Why use docker containers at all?
○ Containers and Images
● Real world advantages for robots? (Bren)
○ For development
○ On real robot
○ CI / Github Actions
○ Pickenv
● Demos
○ Docker command line utilities and getting
started
What is docker and how do I use it?
What is docker?
● Originated from LXC (Linux
Containers)
● Basically a container provider
● OS is virtualized instead of the
hardware (VM)
● Extremely Lightweight
● Native Performance
● Containers share the same host, thus
they can be in MBs of size!
● Can I run Linux docker on other
platforms (Windows, MAC)?
○ Yes, but there is actually a linux VM in
the background on these platforms.
Containers vs Images
● A Dockerfile:
○ Defines the necessary actions that
is going to be used for creating an
image
● A Docker image is:
○ Immutable
○ Contains the source code, libraries,
dependencies, tools etc.
● A Docker container is:
○ Mutable runtime environment
Where to Get Docker Images?
https://github.blog/2021-06-21-github-packages-
container-registry-generally-available/
https://hub.docker.com/
https://hub.docker.com/r/osrf/ros/
https://hub.docker.com/_/ros
https://hub.docker.com/u/moveit
Docker Workflow
Real world advantages
for Robotics
For Development
● 1 container per project.
○ Each project has isolated with regard to the
packages / workspace.
○ You can easily switch between each project.
● Identical workspace.
○ Everyone in the project is developing from
identical software version. Including CI
● 1 dev to figure out installation.
○ For example Realsense / android studio /
tensorflow
● Quick to clean project
○ Easy to test packages
○ Can easily delete container and test what
packages you really need / package updates.
● Fast update of project workspace
○ If there are new packages / changes to the
underlining project. You can pull the new
image quickly.
● Mount you home folder + users +groups
Pull Push
CI / Git Actions. ● Github can produce a image per PR
○ Easy to test PR’s locally or on robot
● CI takes less time
○ have all the software pre-installed.
● AWS robot maker
○ You can now send docker images to AWS so
you can run test in parallel.
○ Can run you simulation on multi cores.
● Make a new dev image
○ Using github action we can check to see if
there are new packages and rebuild the
underlying image.
Pull
Push
Docker on the real robot ● Easy to deploy code
○ Push pull a docker image
● Easy to version control whole system
○ You can version the docker image and pull
the complete system
○ The “Native” linux can have minimal
packages
○ No real need for “salt” / “Ansible”
● Dev can push directly onto robot
● You can develop on your laptop can push to robot.
~1min to push / run
● Every easy to downgrade / test in field
○ As your not changing the native OS you can
switch very easily between software versions.
Example Dockerfile
FROM moveit/moveit2:foxy-source # Inherit from readily available MoveIt 2 docker
# Make tutorial workspace
WORKDIR /root/ws_tutorial
SHELL ["/bin/bash", "-c"]
# Clone MoveIt 2 tutorial repos
RUN git clone https://github.com/ros-planning/moveit2_tutorials 
src/moveit2_tutorials -b main && 
vcs import src < src/moveit2_tutorials/moveit2_tutorials.repos
# Install dependencies and build moveit2_tutorials
RUN apt-get update && rosdep update && 
source /opt/ros/foxy/setup.bash && 
source /root/ws_moveit/install/setup.bash && 
rosdep install -r --from-paths src --ignore-src --rosdistro foxy -y && 
colcon build --event-handlers desktop_notification- status- --cmake-args -
DCMAKE_BUILD_TYPE=Release
# Cleanup and reducing image size
RUN rm -rf /var/lib/apt/lists/*
Demo Time
Docker Workflow
# Pull moveit/moveit2:foxy-source image from dockerhub
docker pull moveit/moveit2:foxy-source
# Push the same docker image to private registry-host on port 5000
docker image push registry-host:5000/moveit/moveit2:foxy-source/
# Build a docker image from a given Dockerfile and tags it as
moveit/moveit2:tutorial
docker build --tag moveit/moveit2:tutorial - < Dockerfile
# Create an interactive container with the given image and runs /bin/bash
docker run -it --name tutorial-container moveit/moveit2:tutorial /bin/bash
# Create an image from the container
docker container commit tutorial-container techtalk:tutorial
# Save a docker image into a tar
docker save moveit/moveit2:foxy-source > moveit2_foxy.tar
# Load a docker image from tarball
docker load < moveit2_foxy.tar
Frequently Used Container Commands
# Create an interactive container with the given image and runs
/bin/bash (Only the first time!)
docker run -it --name tutorial-container
moveit/moveit2:tutorial /bin/bash
# Start an existing container
docker start tutorial-container
# Shoot an interactive terminal in the running container
docker exec -it tutorial-container /bin/bash
# Stop the container
docker stop tutorial-container
# Remove the container (will delete everything inside it)
docker container rm tutorial-container
How to make containers more useful?
xhost +local:root &> /dev/null # Give root access for displays
docker run -it --privileged  # Joysticks and all connected devices
--net=host  # Internet
--gpus all  # GPU
--env=NVIDIA_VISIBLE_DEVICES=all 
--env=NVIDIA_DRIVER_CAPABILITIES=all 
--env=DISPLAY  # Display
--env=QT_X11_NO_MITSHM=1 
-v "/tmp/.X11-unix:/tmp/.X11-unix" 
-v "$VOLUME:$VOLUME:rw"  # Mount Custom Volumes
--name "$CONTAINER_NAME" 
"$IMAGE_NAME" 
/bin/bash
xhost -local:root 1>/dev/null 2>&1
Whoa! Some Documentation
Docker Installation: https://docs.docker.com/engine/install/ubuntu/
Docker Post Install: https://docs.docker.com/engine/install/linux-postinstall/
nvidia-docker2 Installation: https://docs.nvidia.com/datacenter/cloud-native/container-
toolkit/install-guide.html
Docker Documentation: https://docs.docker.com/engine/reference/run/
Install and Start Using Docker Now
and Ease Up Your Development!
Thanks!

More Related Content

Recently uploaded

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Featured

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

PickNik: Docker for MoveIt and ROS Tech Talk 07.19.2021

  • 1. Docker Good development methods 19 July 2021 Brennard Pierce / Vatan Aksoy Tezer PickNik Robotics bren.pierce@picknik.ai / vatan@picknik.ai
  • 2. Outline ● What is docker? (Vatan) ○ Why use docker containers at all? ○ Containers and Images ● Real world advantages for robots? (Bren) ○ For development ○ On real robot ○ CI / Github Actions ○ Pickenv ● Demos ○ Docker command line utilities and getting started
  • 3. What is docker and how do I use it?
  • 4. What is docker? ● Originated from LXC (Linux Containers) ● Basically a container provider ● OS is virtualized instead of the hardware (VM) ● Extremely Lightweight ● Native Performance ● Containers share the same host, thus they can be in MBs of size! ● Can I run Linux docker on other platforms (Windows, MAC)? ○ Yes, but there is actually a linux VM in the background on these platforms.
  • 5. Containers vs Images ● A Dockerfile: ○ Defines the necessary actions that is going to be used for creating an image ● A Docker image is: ○ Immutable ○ Contains the source code, libraries, dependencies, tools etc. ● A Docker container is: ○ Mutable runtime environment
  • 6. Where to Get Docker Images? https://github.blog/2021-06-21-github-packages- container-registry-generally-available/ https://hub.docker.com/ https://hub.docker.com/r/osrf/ros/ https://hub.docker.com/_/ros https://hub.docker.com/u/moveit
  • 9. For Development ● 1 container per project. ○ Each project has isolated with regard to the packages / workspace. ○ You can easily switch between each project. ● Identical workspace. ○ Everyone in the project is developing from identical software version. Including CI ● 1 dev to figure out installation. ○ For example Realsense / android studio / tensorflow ● Quick to clean project ○ Easy to test packages ○ Can easily delete container and test what packages you really need / package updates. ● Fast update of project workspace ○ If there are new packages / changes to the underlining project. You can pull the new image quickly. ● Mount you home folder + users +groups Pull Push
  • 10. CI / Git Actions. ● Github can produce a image per PR ○ Easy to test PR’s locally or on robot ● CI takes less time ○ have all the software pre-installed. ● AWS robot maker ○ You can now send docker images to AWS so you can run test in parallel. ○ Can run you simulation on multi cores. ● Make a new dev image ○ Using github action we can check to see if there are new packages and rebuild the underlying image. Pull Push
  • 11. Docker on the real robot ● Easy to deploy code ○ Push pull a docker image ● Easy to version control whole system ○ You can version the docker image and pull the complete system ○ The “Native” linux can have minimal packages ○ No real need for “salt” / “Ansible” ● Dev can push directly onto robot ● You can develop on your laptop can push to robot. ~1min to push / run ● Every easy to downgrade / test in field ○ As your not changing the native OS you can switch very easily between software versions.
  • 12. Example Dockerfile FROM moveit/moveit2:foxy-source # Inherit from readily available MoveIt 2 docker # Make tutorial workspace WORKDIR /root/ws_tutorial SHELL ["/bin/bash", "-c"] # Clone MoveIt 2 tutorial repos RUN git clone https://github.com/ros-planning/moveit2_tutorials src/moveit2_tutorials -b main && vcs import src < src/moveit2_tutorials/moveit2_tutorials.repos # Install dependencies and build moveit2_tutorials RUN apt-get update && rosdep update && source /opt/ros/foxy/setup.bash && source /root/ws_moveit/install/setup.bash && rosdep install -r --from-paths src --ignore-src --rosdistro foxy -y && colcon build --event-handlers desktop_notification- status- --cmake-args - DCMAKE_BUILD_TYPE=Release # Cleanup and reducing image size RUN rm -rf /var/lib/apt/lists/*
  • 14. Docker Workflow # Pull moveit/moveit2:foxy-source image from dockerhub docker pull moveit/moveit2:foxy-source # Push the same docker image to private registry-host on port 5000 docker image push registry-host:5000/moveit/moveit2:foxy-source/ # Build a docker image from a given Dockerfile and tags it as moveit/moveit2:tutorial docker build --tag moveit/moveit2:tutorial - < Dockerfile # Create an interactive container with the given image and runs /bin/bash docker run -it --name tutorial-container moveit/moveit2:tutorial /bin/bash # Create an image from the container docker container commit tutorial-container techtalk:tutorial # Save a docker image into a tar docker save moveit/moveit2:foxy-source > moveit2_foxy.tar # Load a docker image from tarball docker load < moveit2_foxy.tar
  • 15. Frequently Used Container Commands # Create an interactive container with the given image and runs /bin/bash (Only the first time!) docker run -it --name tutorial-container moveit/moveit2:tutorial /bin/bash # Start an existing container docker start tutorial-container # Shoot an interactive terminal in the running container docker exec -it tutorial-container /bin/bash # Stop the container docker stop tutorial-container # Remove the container (will delete everything inside it) docker container rm tutorial-container
  • 16. How to make containers more useful? xhost +local:root &> /dev/null # Give root access for displays docker run -it --privileged # Joysticks and all connected devices --net=host # Internet --gpus all # GPU --env=NVIDIA_VISIBLE_DEVICES=all --env=NVIDIA_DRIVER_CAPABILITIES=all --env=DISPLAY # Display --env=QT_X11_NO_MITSHM=1 -v "/tmp/.X11-unix:/tmp/.X11-unix" -v "$VOLUME:$VOLUME:rw" # Mount Custom Volumes --name "$CONTAINER_NAME" "$IMAGE_NAME" /bin/bash xhost -local:root 1>/dev/null 2>&1
  • 17. Whoa! Some Documentation Docker Installation: https://docs.docker.com/engine/install/ubuntu/ Docker Post Install: https://docs.docker.com/engine/install/linux-postinstall/ nvidia-docker2 Installation: https://docs.nvidia.com/datacenter/cloud-native/container- toolkit/install-guide.html Docker Documentation: https://docs.docker.com/engine/reference/run/
  • 18. Install and Start Using Docker Now and Ease Up Your Development!