ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
1

Docker or snap for ROS projects

asked 2019-09-06 13:35:45 -0600

mugetsu gravatar image

Hi guys, recently I had to deal with issues in my project with different computers having slightly different environment.

Ideally I want all the developers and robot to have the identical environment for both development and production. I read a little about docker as well as snap but kind of confused on which one is better fit for this.

What does the general ROS community use? Is there any gotchas and limitations to either? I'm concerned it may require significant work to reconfigure my setup.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2019-09-06 22:26:53 -0600

updated 2019-09-07 01:32:59 -0600

This sentence alone

I want all the developers and robot to have the identical environment for both development and production

Docker. I'm a fan of snaps for deployment of certain assets but you cannot develop inside of a snap, they're read only and take a bunch of time to generate each snap (think 20-30 minutes).

Snaps are for deployment (usually in the cloud, but also on robots/IoT) and cannot be used for development from their read-only state packaging up the entire code/dependencies around Ubuntu Core. The general community uses Docker by in large and OSRF even provides base images on DockerHub to pull from for base, desktop, and specialty installs https://hub.docker.com/_/ros.

Docker is pretty easy to get started with, here's an example of building one of my packages in docker: https://github.com/SteveMacenski/slam.... As you can see, its < 25 lines. Launch the container and then you can run your ROS packages (and/or create an entry point so its automatic).

Edit: More info on snaps and ROS can be found here https://snapcraft.io/docs/catkin-plugin. Analogous to my docker example, here's a snapcraft yaml I use for deployment of the same project https://github.com/SteveMacenski/slam.... Feel free to use those two as testing grounds to get the hang of it since I happen to use both in this particular case

edit flag offensive delete link more

Comments

so basically, docker for dev and snap for deployment. Why use snap for deployment over docker?

mugetsu gravatar image mugetsu  ( 2019-09-09 18:49:08 -0600 )edit

If you want to use docker to deploy as well, theres nothing stopping you. Its just a different philosophy

stevemacenski gravatar image stevemacenski  ( 2019-09-09 19:04:27 -0600 )edit

The snapcraft yaml link is a 404, would be helpful if still available :)

abhishek47 gravatar image abhishek47  ( 2021-04-05 09:05:27 -0600 )edit

how can snap be installed inside the docker container and what benefit does it provides for deployment purpose. https://answers.ros.org/question/3757...

dinesh gravatar image dinesh  ( 2021-04-08 12:31:45 -0600 )edit
2

answered 2022-11-17 16:16:23 -0600

Gabriel_Aguiar gravatar image

During the 2022 Ubuntu Summit, I was pointed to this link. To help developers I want to add on the previous answer:

  • Docker is for development. If you want people to access your code and dev environment, use Docker.
  • Snaps are for deployment. If you DON'T want people testing and debugging your source code, use Snaps.

Simple. Is your ROS application ready for the market/final user? You don't want users playing/changing your code? If yes, you can use snaps.

Want to try it? just sudo snap install foxglove-studio or sudo snap install turtlebot3c or sudo snap install plotjuggler or ....

They are also not meant to be used in cloud web service applications. They were designed for embedded Linux devices.

Why are snaps being used for ROS deployment? As a container for Linux, it comes with several benefits compared to containers designed for the cloud (i.e. Docker). For instance:

  • Interfaces to access host machine and resources (you are not an IP - not another abstraction layer)
  • Field features as transactional updates, start with machine boot, delta updates,...
  • Manage fleet updates (Kubernetes, no. Kubernetes is designed for an aggregate of compute).
  • ROS integration - plugins and extensions for several ROS distributions. This improves the build and run time of ROS applications.

Here you can find the documentation: https://snapcraft.io/docs/ros-applica...
PS. You can also snap your ROS application in less than 25 lines

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-09-06 13:35:45 -0600

Seen: 845 times

Last updated: Nov 17