From 61cd87442efef4ba4563e14f89149531099a1589 Mon Sep 17 00:00:00 2001 From: jmackay Date: Fri, 28 Jul 2023 00:21:14 -0400 Subject: [PATCH 1/3] Add ROS 2 humble. Update ROS 2 dockerfile to take args for the ros version and base image. Update rolling to jammy. --- .github/workflows/docker_builds.yml | 38 ++++++++- ...ockerfile_ros2-rolling => Dockerfile_ros2} | 18 ++--- docker/Dockerfile_ros2-galactic | 78 ------------------- 3 files changed, 44 insertions(+), 90 deletions(-) rename docker/{Dockerfile_ros2-rolling => Dockerfile_ros2} (85%) delete mode 100644 docker/Dockerfile_ros2-galactic diff --git a/.github/workflows/docker_builds.yml b/.github/workflows/docker_builds.yml index c8e77c5..e29f628 100644 --- a/.github/workflows/docker_builds.yml +++ b/.github/workflows/docker_builds.yml @@ -442,10 +442,36 @@ jobs: tag_names: true workdir: docker + px4-dev-ros2-humble: + name: "ROS2 Humble" + runs-on: ubuntu-latest + needs: px4-dev-base-jammy + steps: + - uses: actions/checkout@v3 + - name: Build container + if: github.event_name == 'pull_request' + run: | + cd docker + make px4-dev-ros2-humble + - name: Build & Publish container + if: github.event_name == 'push' && (contains(github.ref, '/heads/master') || contains(github.ref, '/tags/')) + uses: julianoes/Publish-Docker-Github-Action@master + with: + name: px4io/px4-dev-ros2-humble + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: Dockerfile_ros2 + cache: false + tag_names: true + workdir: docker + build-args: | + ROS_DISTRO=humble + BASE=px4io/px4-dev-base-jammy + px4-dev-ros2-rolling: name: "ROS2 Rolling" runs-on: ubuntu-latest - needs: px4-dev-base-focal + needs: px4-dev-base-jammy steps: - uses: actions/checkout@v3 - name: Build container @@ -460,10 +486,13 @@ jobs: name: px4io/px4-dev-ros2-rolling username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: Dockerfile_ros2-rolling + dockerfile: Dockerfile_ros2 cache: false tag_names: true workdir: docker + build-args: | + ROS_DISTRO=rolling + BASE=px4io/px4-dev-base-jammy px4-dev-ros2-galactic: name: "ROS2 Galactic" @@ -483,10 +512,13 @@ jobs: name: px4io/px4-dev-ros2-galactic username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - dockerfile: Dockerfile_ros2-galactic + dockerfile: Dockerfile_ros2 cache: false tag_names: true workdir: docker + build-args: | + ROS_DISTRO=galactic + BASE=px4io/px4-dev-base-focal px4-docs: name: "Ubuntu Docs" diff --git a/docker/Dockerfile_ros2-rolling b/docker/Dockerfile_ros2 similarity index 85% rename from docker/Dockerfile_ros2-rolling rename to docker/Dockerfile_ros2 index 5e6f770..fdda71d 100644 --- a/docker/Dockerfile_ros2-rolling +++ b/docker/Dockerfile_ros2 @@ -7,12 +7,12 @@ # and by maintainers who want their packages released and ready for the next # stable distribution." - in https://docs.ros.org/en/foxy/Releases/Release-Rolling-Ridley.html # - -FROM px4io/px4-dev-base-focal:2021-09-08 +ARG BASE=px4io/px4-dev-base-jammy +FROM ${BASE} LABEL maintainer="Nuno Marques " # setup environment -ENV ROS_DISTRO rolling +ARG ROS_DISTRO=rolling # setup ros2 keys RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg @@ -67,13 +67,13 @@ RUN colcon mixin add default \ https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml \ && colcon metadata update -# Install Fast-DDS 2.3.1 -RUN rm -rf /usr/local/include/fastrtps /usr/local/share/fastrtps /usr/local/lib/libfastrtps* \ - && git clone --recursive https://github.com/eProsima/Fast-DDS.git -b v2.3.1 /tmp/FastRTPS-2.3.1 \ - && cd /tmp/FastRTPS-2.3.1 \ +# Install Micro-XRCE-DDS-Agent +RUN git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git /tmp/micro-xrce-dds-agent \ + && cd /tmp/micro-xrce-dds-agent \ && mkdir build && cd build \ - && cmake -DTHIRDPARTY=ON -DSECURITY=ON .. \ - && cmake --build . --target install -- -j $(nproc) \ + && cmake .. \ + && make -j $(nproc) && make install \ + && ldconfig /usr/local/lib \ && rm -rf /tmp/* # create and start as LOCAL_USER_ID diff --git a/docker/Dockerfile_ros2-galactic b/docker/Dockerfile_ros2-galactic deleted file mode 100644 index b344888..0000000 --- a/docker/Dockerfile_ros2-galactic +++ /dev/null @@ -1,78 +0,0 @@ -# -# PX4 ROS2 Galactic development environment -# Based from container under https://github.com/osrf/docker_images/tree/master/ros2/source/devel -# - -FROM px4io/px4-dev-base-focal:2021-09-08 -LABEL maintainer="Nuno Marques " - -# setup environment -ENV ROS_DISTRO galactic - -# setup ros2 keys -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg - -# setup sources.list -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - -# install bootstrap tools -RUN apt-get update \ - && apt-get install --quiet -y \ - python3-colcon-common-extensions \ - python3-colcon-mixin \ - python3-rosdep \ - python3-vcstool \ - && apt-get -y autoremove \ - && apt-get clean autoclean \ - && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* - -# install ros2 desktop -RUN apt-get install --quiet --no-install-recommends -y \ - ros-$ROS_DISTRO-desktop \ - ros-$ROS_DISTRO-launch-testing-ament-cmake \ - ros-$ROS_DISTRO-ros2bag \ - ros-$ROS_DISTRO-rosidl-generator-dds-idl \ - && apt-get -y autoremove \ - && apt-get clean autoclean \ - && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* - -# Install Python 3 packages needed for testing -RUN pip3 install -U \ - argcomplete \ - flake8 \ - flake8-blind-except \ - flake8-builtins \ - flake8-class-newline \ - flake8-comprehensions \ - flake8-deprecated \ - flake8-docstrings \ - flake8-import-order \ - flake8-quotes \ - pytest-repeat \ - pytest-rerunfailures - -# bootstrap rosdep -RUN rosdep init && rosdep update - -# setup colcon mixin and metadata -RUN colcon mixin add default \ - https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml \ - && colcon mixin update \ - && colcon metadata add default \ - https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml \ - && colcon metadata update - -# Install Fast-DDS 2.3.1 -RUN rm -rf /usr/local/include/fastrtps /usr/local/share/fastrtps /usr/local/lib/libfastrtps* \ - && git clone --recursive https://github.com/eProsima/Fast-DDS.git -b v2.3.1 /tmp/FastRTPS-2.3.1 \ - && cd /tmp/FastRTPS-2.3.1 \ - && mkdir build && cd build \ - && cmake -DTHIRDPARTY=ON -DSECURITY=ON .. \ - && cmake --build . --target install -- -j $(nproc) \ - && rm -rf /tmp/* - -# create and start as LOCAL_USER_ID -COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] - -CMD ["/bin/bash"] From 791b209ac071dfbb74d6c9c6bfdb17d73ee929c8 Mon Sep 17 00:00:00 2001 From: jmackay Date: Mon, 14 Aug 2023 06:06:22 -0400 Subject: [PATCH 2/3] Update Makefile for galactic, humble, and rolling --- docker/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 7d7698c..a0e22cf 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -65,11 +65,14 @@ px4-dev-ros2-eloquent: px4-dev-ros-melodic px4-dev-ros2-foxy: px4-dev-ros-noetic docker build -t px4io/px4-dev-ros2-foxy . -f Dockerfile_ros2-foxy -px4-dev-ros2-rolling: px4-dev-base-focal - docker build -t px4io/px4-dev-ros2-rolling . -f Dockerfile_ros2-rolling +px4-dev-ros2-humble: px4-dev-base-jammy + docker build -t px4io/px4-dev-ros2-humble -f Dockerfile_ros2 --build-arg="ROS_DISTRO=humble" --build-arg="BASE=px4io/px4-dev-base-jammy" . + +px4-dev-ros2-rolling: px4-dev-base-jammy + docker build -t px4io/px4-dev-ros2-rolling -f Dockerfile_ros2 --build-arg="ROS_DISTRO=rolling" --build-arg="BASE=px4io/px4-dev-base-jammy" . px4-dev-ros2-galactic: px4-dev-base-focal - docker build -t px4io/px4-dev-ros2-galactic . -f Dockerfile_ros2-galactic + docker build -t px4io/px4-dev-ros2-galactic -f Dockerfile_ros2 --build-arg="ROS_DISTRO=galactic" --build-arg="BASE=px4io/px4-dev-base-focal" . px4-dev-simulation-bionic: px4-dev-base-bionic docker build -t px4io/px4-dev-simulation-bionic . -f Dockerfile_simulation-bionic From 2375316a991895ee56c8aad9638841f1c4907768 Mon Sep 17 00:00:00 2001 From: jmackay Date: Sat, 14 Oct 2023 23:25:50 -0400 Subject: [PATCH 3/3] Add ros 2 iron --- .github/workflows/docker_builds.yml | 26 ++++++++++++++++++++++++++ docker/Makefile | 11 +++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_builds.yml b/.github/workflows/docker_builds.yml index e29f628..6e28410 100644 --- a/.github/workflows/docker_builds.yml +++ b/.github/workflows/docker_builds.yml @@ -468,6 +468,32 @@ jobs: ROS_DISTRO=humble BASE=px4io/px4-dev-base-jammy + px4-dev-ros2-iron: + name: "ROS2 Iron" + runs-on: ubuntu-latest + needs: px4-dev-base-jammy + steps: + - uses: actions/checkout@v3 + - name: Build container + if: github.event_name == 'pull_request' + run: | + cd docker + make px4-dev-ros2-iron + - name: Build & Publish container + if: github.event_name == 'push' && (contains(github.ref, '/heads/master') || contains(github.ref, '/tags/')) + uses: julianoes/Publish-Docker-Github-Action@master + with: + name: px4io/px4-dev-ros2-iron + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + dockerfile: Dockerfile_ros2 + cache: false + tag_names: true + workdir: docker + build-args: | + ROS_DISTRO=iron + BASE=px4io/px4-dev-base-jammy + px4-dev-ros2-rolling: name: "ROS2 Rolling" runs-on: ubuntu-latest diff --git a/docker/Makefile b/docker/Makefile index a0e22cf..b4add64 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -2,16 +2,16 @@ px4-dev-base-focal, px4-dev-base-jammy, px4-dev-clang, px4-dev-nuttx-bionic, \ px4-dev-nuttx-focal, px4-dev-nuttx-jammy, px4-dev-nuttx-clang, px4-dev-raspi, \ px4-dev-ros-melodic, px4-dev-ros-noetic, px4-dev-ros2-dashing, \ - px4-dev-ros2-eloquent, px4-dev-ros2-foxy, px4-dev-ros2-galactic, \ - px4-dev-ros2-rolling, px4-dev-simulation-bionic, px4-dev-simulation-focal, \ + px4-dev-ros2-eloquent, px4-dev-ros2-foxy, px4-dev-ros2-galactic, px4-dev-ros2-humble, \ + px4-dev-ros2-iron, px4-dev-ros2-rolling, px4-dev-simulation-bionic, px4-dev-simulation-focal, \ px4-docs all: px4-dev-armhf, px4-dev-base-archlinux, px4-dev-base-bionic, \ px4-dev-base-focal, px4-dev-base-jammy, px4-dev-clang, px4-dev-nuttx-bionic, \ px4-dev-nuttx-focal, px4-dev-nuttx-jammy, px4-dev-nuttx-clang, px4-dev-raspi, \ px4-dev-ros-melodic, px4-dev-ros-noetic, px4-dev-ros2-dashing,\ - px4-dev-ros2-eloquent, px4-dev-ros2-foxy, px4-dev-ros2-galactic, \ - px4-dev-ros2-rolling, px4-dev-simulation-bionic, px4-dev-simulation-focal, \ + px4-dev-ros2-eloquent, px4-dev-ros2-foxy, px4-dev-ros2-galactic, px4-dev-ros2-humble, \ + px4-dev-ros2-iron, px4-dev-ros2-rolling, px4-dev-simulation-bionic, px4-dev-simulation-focal, \ px4-docs px4-dev-armhf: @@ -68,6 +68,9 @@ px4-dev-ros2-foxy: px4-dev-ros-noetic px4-dev-ros2-humble: px4-dev-base-jammy docker build -t px4io/px4-dev-ros2-humble -f Dockerfile_ros2 --build-arg="ROS_DISTRO=humble" --build-arg="BASE=px4io/px4-dev-base-jammy" . +px4-dev-ros2-iron: px4-dev-base-jammy + docker build -t px4io/px4-dev-ros2-iron -f Dockerfile_ros2 --build-arg="ROS_DISTRO=iron" --build-arg="BASE=px4io/px4-dev-base-jammy" . + px4-dev-ros2-rolling: px4-dev-base-jammy docker build -t px4io/px4-dev-ros2-rolling -f Dockerfile_ros2 --build-arg="ROS_DISTRO=rolling" --build-arg="BASE=px4io/px4-dev-base-jammy" .