Automated Containerization of ROS Applications for Development and Deployment

At the Institute for Automotive Engineering at RWTH Aachen University, we have moved to a more and more containerized stack of ROS applications over the years. We use ROS containers for the development and deployment of our automated driving functions for connected intelligent transport systems.

We are happy to announce that we have open-sourced multiple tools that support our container-driven development and deployment workflow and would like to share these with the ROS community!

Our tooling suite consists of three independent tools that are each presented in more detail at the bottom of this post:

  • docker-ros automatically builds minimal container images of ROS applications, either manually or as part of automated GitHub or GitLab CI pipelines;
  • docker-ros-ml-images provides machine learning-enabled ROS base container images, including CUDA, TensorFlow, and/or PyTorch for both Python and C++;
  • docker-run is a CLI tool for simplified interaction with container images during development, built on top of the official Docker CLI.

Feel free to check out more detailed instructions and quick start guides in the GitHub READMEs. We would be very happy to receive any kind of feedback or answer any questions you may have!

Below you can also see an illustration of how these tools contribute to our overall container-driven development and deployment workflow.


docker-ros – Automated Containerization of ROS Applications

docker-ros automatically builds minimal Docker images of your ROS-based repositories for development and deployment. Some of you might have already heard of docker-ros from a weekly ROS news update earlier last month.

Main Features

  • Automated containerization of ROS/ROS2 applications based on generic Dockerfile
  • Minimal dependency installation based on any ROS or even non-ROS base image
  • CI/CD integration for fully automated containerization using GitHub Actions or GitLab CI
  • Option to build development image or deployment image that only contains binaries
  • Support for multi-arch images
  • Extensive customization options

Quick Demo

# github-workflow.yml
on: push
jobs:
  docker-ros:
    runs-on: ubuntu-latest
    steps:
      - uses: ika-rwth-aachen/docker-ros@v1.2.3
        with:
          base-image: rwthika/ros2:humble
          command: ros2 run my_pkg my_node

docker-ros-ml-images – Machine Learning-Enabled ROS Docker Images

docker-ros-ml-images is a collection of lightweight multi-arch machine learning-enabled ROS/ROS2 Docker images. Each of the provided Docker images includes support for popular machine learning frameworks (PyTorch and/or TensorFlow) in addition to a ROS distribution.

Main Features

  • Variations cover ROS distributions, ROS package stacks, and ML frameworks
  • Inclusion of Python and C++ APIs of TensorFlow and PyTorch
  • Multi-arch support for amd64 and arm64
  • More than 100 images publicly available on DockerHub

Quick Demo

docker run --rm rwthika/ros2-ml:rolling \
    python -c 'import os; import tensorflow as tf; import torch; e="ROS_DISTRO"; print(f"Hello from ROS {os.environ[e]}, PyTorch {torch.__version__}, and TensorFlow {tf.__version__}!")'

docker-run – ‘docker run’ and ‘docker exec’ with Useful Defaults

docker-run is a CLI tool for simplified interaction with Docker images. Use it to easily start and attach to Docker containers with useful predefined arguments. Note that docker-run is not limited to ROS-based containers or robotics in general, but can add value to any container-driven workflow. More details can be found in this dedicated Discourse post.

9 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.