From 290464954c592c03497c015d45e08c9c54c233f2 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Wed, 4 Sep 2024 12:59:26 -0700 Subject: [PATCH 1/7] Move apt-gets up in Dockerfile --- .docker/Dockerfile | 66 ++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 85540dee..277687a0 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,11 +1,10 @@ +# syntax=docker/dockerfile:1.7-labs +# Above must be the first line in Dockerfile. It enables the "copy --parents" syntax ARG ROS_DISTRO=rolling FROM ros:$ROS_DISTRO-ros-base AS ci ENV DEBIAN_FRONTEND=noninteractive -WORKDIR /root/ws_blue -COPY . src/blue - # Install apt packages needed for CI RUN apt-get -q update \ && apt-get -q -y upgrade \ @@ -27,11 +26,17 @@ RUN apt-get -q update \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* -# Install all ROS dependencies for _just_ blue -# (we have not imported other repos from .repos files) +# Pull in _just_ the */package.xml files from blue's subdirectories +# Install rosdeps for all of those sub-packages +WORKDIR /root/ws_blue/src/blue +COPY --parents */package.xml . +COPY blue.repos . +WORKDIR /root/ws_blue + RUN apt-get -q update \ && apt-get -q -y upgrade \ && rosdep update \ + && vcs import src < src/blue/blue.repos \ && rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false \ && rm -rf src \ && apt-get autoremove -y \ @@ -48,6 +53,29 @@ RUN apt-get -q update \ # FROM ci AS robot +# Install gstreamer, plus geographiclib-tools for install_geographiclib_datasets +RUN apt-get -q update \ + && apt-get -q -y upgrade \ + && apt-get -q install --no-install-recommends -y \ + python3-gi \ + gstreamer1.0-tools \ + gir1.2-gstreamer-1.0 \ + gir1.2-gst-plugins-base-1.0 \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-ugly \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-libav \ + libgstreamer1.0-dev \ + gstreamer1.0-gl \ + libgstreamer-plugins-base1.0-dev \ + geographiclib-tools \ + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Install MAVROS dependencies +RUN wget -O - https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh | sh + # # Ubuntu 24.04 "Noble", which is used as the base image for # jazzy and rolling images, now includes a user "ubuntu" at UID 1000 @@ -76,12 +104,6 @@ ENV VIRTUAL_ENV=/home/$USERNAME/.venv/blue RUN python3 -m venv --system-site-packages --symlinks $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" -# Install MAVROS dependencies -WORKDIR /home/$USERNAME -RUN wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \ - && chmod +x install_geographiclib_datasets.sh \ - && sudo ./install_geographiclib_datasets.sh - ENV USER_WORKSPACE=/home/$USERNAME/ws_blue WORKDIR $USER_WORKSPACE COPY --chown=$USER_UID:$USER_GID . src/blue @@ -89,25 +111,6 @@ COPY --chown=$USER_UID:$USER_GID . src/blue # Install the Python requirements that aren't available as rosdeps RUN python3 -m pip install -r $(pwd)/src/blue/requirements-build.txt -# Install gstreamer -RUN sudo apt-get -q update \ - && sudo apt-get -q -y upgrade \ - && sudo apt-get -q install --no-install-recommends -y \ - python3-gi \ - gstreamer1.0-tools \ - gir1.2-gstreamer-1.0 \ - gir1.2-gst-plugins-base-1.0 \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-libav \ - libgstreamer1.0-dev \ - gstreamer1.0-gl \ - libgstreamer-plugins-base1.0-dev \ - && sudo apt-get autoremove -y \ - && sudo apt-get clean -y \ - && sudo rm -rf /var/lib/apt/lists/* - # Manually install MAVROS from source in the ws_blue/ workspace WORKDIR $USER_WORKSPACE/src/ ARG MAVROS_RELEASE=ros2 @@ -141,8 +144,7 @@ RUN sudo apt-get -q update \ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \ && colcon build -RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \ - && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc \ +RUN echo "if [ -f ${USER_WORKSPACE}/install/setup.bash ]; then source ${USER_WORKSPACE}/install/setup.bash; else source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc \ && echo "source $VIRTUAL_ENV/bin/activate" >> /home/$USERNAME/.bashrc \ && echo "\n# Ensure colcon is run in the venv\nalias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc From fe50526e0b441f2e6d2d7d8b2a2054f96e7501a4 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Wed, 4 Sep 2024 16:08:27 -0700 Subject: [PATCH 2/7] Explicitly ignore mavros and mavlinke packages when installing dependencies. --- .docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 277687a0..e3df6eef 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -37,7 +37,7 @@ RUN apt-get -q update \ && apt-get -q -y upgrade \ && rosdep update \ && vcs import src < src/blue/blue.repos \ - && rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false \ + && rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false --skip-keys="mavros mavlink" \ && rm -rf src \ && apt-get autoremove -y \ && apt-get clean -y \ From 6aa54c3d0b382daba4c85ae3c36d6ac54583cea7 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Wed, 4 Sep 2024 16:23:55 -0700 Subject: [PATCH 3/7] Set ROSDEP_SKIP_KEYS in ROS-Industrial CI --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e8ff75ad..e378033e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,6 +37,7 @@ jobs: - name: Run ROS Industrial CI uses: ros-industrial/industrial_ci@master env: + ROSDEP_SKIP_KEYS: mavlink mavros DOCKER_IMAGE: ghcr.io/robotic-decision-making-lab/blue:${{ matrix.env.IMAGE }} CXXFLAGS: >- -Wall -Wextra -Wpedantic -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls From c787703164cb6c961ac49a467365ff04eaf75c58 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Wed, 4 Sep 2024 16:26:01 -0700 Subject: [PATCH 4/7] Also skip mavros-extras in ROS-Industrial CI --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e378033e..351081c9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,7 +37,7 @@ jobs: - name: Run ROS Industrial CI uses: ros-industrial/industrial_ci@master env: - ROSDEP_SKIP_KEYS: mavlink mavros + ROSDEP_SKIP_KEYS: mavlink mavros mavros-extras DOCKER_IMAGE: ghcr.io/robotic-decision-making-lab/blue:${{ matrix.env.IMAGE }} CXXFLAGS: >- -Wall -Wextra -Wpedantic -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls From 67ec373afccc871df8017871282eb8d527bb06b2 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Thu, 5 Sep 2024 09:50:25 -0700 Subject: [PATCH 5/7] As a test, run Industrial ROS CI in humble rather than rolling. --- .docker/Dockerfile | 2 +- .github/workflows/ci.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index e3df6eef..277687a0 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -37,7 +37,7 @@ RUN apt-get -q update \ && apt-get -q -y upgrade \ && rosdep update \ && vcs import src < src/blue/blue.repos \ - && rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false --skip-keys="mavros mavlink" \ + && rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false \ && rm -rf src \ && apt-get autoremove -y \ && apt-get clean -y \ diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 351081c9..a45a1e7b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,8 +19,8 @@ jobs: fail-fast: false matrix: env: - - IMAGE: rolling-ci - ROS_DISTRO: rolling + - IMAGE: hmuble-ci + ROS_DISTRO: humble steps: - name: Checkout repository uses: actions/checkout@v4 From 78f2c0303a969a93d924828ec6e2bcdf6d081388 Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Thu, 5 Sep 2024 10:32:55 -0700 Subject: [PATCH 6/7] Darnit, learn to spell --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a45a1e7b..3f60c6e9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: env: - - IMAGE: hmuble-ci + - IMAGE: humble-ci ROS_DISTRO: humble steps: - name: Checkout repository From 63e254dc535a201d0f30eaaca33ce4e31e8f8d4e Mon Sep 17 00:00:00 2001 From: Aaron Marburg Date: Thu, 5 Sep 2024 10:33:26 -0700 Subject: [PATCH 7/7] Remove rosdep skip keys --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3f60c6e9..83dcee5c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,7 +37,6 @@ jobs: - name: Run ROS Industrial CI uses: ros-industrial/industrial_ci@master env: - ROSDEP_SKIP_KEYS: mavlink mavros mavros-extras DOCKER_IMAGE: ghcr.io/robotic-decision-making-lab/blue:${{ matrix.env.IMAGE }} CXXFLAGS: >- -Wall -Wextra -Wpedantic -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls