From 4c138899b913325dd8f2e5578f19d330b1a7b2ba Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Thu, 1 May 2025 13:20:21 -0700 Subject: [PATCH 1/4] Try separating arm and x86 builds onto separate runners --- .github/workflows/build.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d06509..5e74518 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,23 +13,28 @@ jobs: strategy: fail-fast: false matrix: + platform: [linux/amd64, linux/arm64] include: - - source_tag: focal - target_tag: focal + - platform: linux/amd64 + runner: ubuntu-24.04 + - platform: linux/arm64 + runner: ubuntu-24.04-arm + - base_image_tag: focal + output_image_tag: focal ros_version: ros - - source_tag: jammy - target_tag: jammy + - base_image_tag: jammy + output_image_tag: jammy ros_version: ros2 - - source_tag: noble - target_tag: noble + - base_image_tag: noble + output_image_tag: noble ros_version: ros2 - - source_tag: noble - target_tag: noble-testing + - base_image_tag: noble + output_image_tag: noble-testing ros_version: ros2-testing - name: "ubuntu-${{ matrix.target_tag }}" + name: "ubuntu-${{ matrix.output_image_tag }} ${{ matrix.platform }}" # always use latest linux worker, as it should not have any impact # when it comes to building docker images. - runs-on: ubuntu-latest + runs-on: "${{ matrix.runner }}" steps: - name: Checkout repository @@ -55,17 +60,17 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64,linux/arm64 + platforms: "${{ matrix.platform }}" push: ${{ github.event_name != 'pull_request' }} build-args: | BASE_IMAGE_NAME=ubuntu - BASE_IMAGE_TAG=${{ matrix.source_tag }} + BASE_IMAGE_TAG=${{ matrix.base_image_tag }} VCS_REF=${{ github.sha }} ROS_DISTRO=none ROS_VERSION=${{ matrix.ros_version }} tags: | - rostooling/setup-ros-docker:ubuntu-${{ matrix.target_tag }}-latest - ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.target_tag }}:latest + rostooling/setup-ros-docker:ubuntu-${{ matrix.output_image_tag }}-latest + ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.output_image_tag }}:latest ros_variant: strategy: From d8197bc8aa7e0c5f972c7ca75462592b9d965b57 Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Thu, 1 May 2025 13:33:27 -0700 Subject: [PATCH 2/4] Reconfigure matrix to be better maybe --- .github/workflows/build.yml | 30 ++++++++++-------------------- Dockerfile | 4 ++-- setup-ros.sh | 23 ++++++++++++----------- 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e74518..c81e450 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,27 +14,17 @@ jobs: fail-fast: false matrix: platform: [linux/amd64, linux/arm64] - include: - - platform: linux/amd64 - runner: ubuntu-24.04 - - platform: linux/arm64 - runner: ubuntu-24.04-arm + base_image_tag: [focal, jammy, noble] + ros_testing: [false, true] + exclude: - base_image_tag: focal - output_image_tag: focal - ros_version: ros + ros_testing: true - base_image_tag: jammy - output_image_tag: jammy - ros_version: ros2 - - base_image_tag: noble - output_image_tag: noble - ros_version: ros2 - - base_image_tag: noble - output_image_tag: noble-testing - ros_version: ros2-testing - name: "ubuntu-${{ matrix.output_image_tag }} ${{ matrix.platform }}" + ros_testing: true + name: "ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing'}} ${{ matrix.platform }}" # always use latest linux worker, as it should not have any impact # when it comes to building docker images. - runs-on: "${{ matrix.runner }}" + runs-on: ubuntu-24.04${{ matrix.platform == 'linux/arm64' && '-arm' || '' }} steps: - name: Checkout repository @@ -67,10 +57,10 @@ jobs: BASE_IMAGE_TAG=${{ matrix.base_image_tag }} VCS_REF=${{ github.sha }} ROS_DISTRO=none - ROS_VERSION=${{ matrix.ros_version }} + ROS_TESTING=${{ matrix.ros_testing && 'true' || '' }} tags: | - rostooling/setup-ros-docker:ubuntu-${{ matrix.output_image_tag }}-latest - ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.output_image_tag }}:latest + rostooling/setup-ros-docker:ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing'}}-latest + ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing'}}:latest ros_variant: strategy: diff --git a/Dockerfile b/Dockerfile index 227d1fe..b897796 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ ARG VCS_REF # The ROS distribution being targeted by this image ARG ROS_DISTRO -# Override default APT sources, "ros", "ros2, or "ros2-testing" -ARG ROS_VERSION='' +# Use ros testing apt repositories instead of main +ARG ROS_TESTING='' # Additional APT packages to be installed # diff --git a/setup-ros.sh b/setup-ros.sh index 810e59b..2cd9e38 100755 --- a/setup-ros.sh +++ b/setup-ros.sh @@ -35,17 +35,18 @@ curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr RTI_CONNEXT_DDS="" -if [ -z $ROS_VERSION ]; then - ROS_VERSION='ros2' - case ${ROS_DISTRO} in - "noetic") - ROS_VERSION="ros" - ;; - *) - RTI_CONNEXT_DDS="rti-connext-dds-6.0.1" - ROS_VERSION="ros2" - ;; - esac +ROS_VERSION='ros2' +case ${ROS_DISTRO} in + "noetic") + ROS_VERSION="ros" + ;; + *) + RTI_CONNEXT_DDS="rti-connext-dds-6.0.1" + ROS_VERSION="ros2" + ;; +esac +if [ "${ROS_TESTING}" = "true" ]; then + ROS_VERSION="${ROS_VERSION}-testing" fi echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/${ROS_VERSION}/ubuntu $(lsb_release -sc) main" |\ From a7028297ec231683c2d6acf7e44ce1de5c2fc0b9 Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Thu, 1 May 2025 13:34:08 -0700 Subject: [PATCH 3/4] Disable variants for now --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c81e450..b052062 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,6 +63,7 @@ jobs: ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing'}}:latest ros_variant: + if: false strategy: fail-fast: false matrix: From f667924514326eeb87da00349a58e1ae0f0e7422 Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Thu, 1 May 2025 13:35:08 -0700 Subject: [PATCH 4/4] Need the or case --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b052062..abac038 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: ros_testing: true - base_image_tag: jammy ros_testing: true - name: "ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing'}} ${{ matrix.platform }}" + name: "ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing' || ''}} ${{ matrix.platform }}" # always use latest linux worker, as it should not have any impact # when it comes to building docker images. runs-on: ubuntu-24.04${{ matrix.platform == 'linux/arm64' && '-arm' || '' }} @@ -59,8 +59,8 @@ jobs: ROS_DISTRO=none ROS_TESTING=${{ matrix.ros_testing && 'true' || '' }} tags: | - rostooling/setup-ros-docker:ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing'}}-latest - ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing'}}:latest + rostooling/setup-ros-docker:ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing' || ''}}-latest + ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing' || ''}}:latest ros_variant: if: false