Skip to content

Commit a93374c

Browse files
committed
try from base image
1 parent bc84622 commit a93374c

File tree

3 files changed

+68
-29
lines changed

3 files changed

+68
-29
lines changed

.github/workflows/debian-packages.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ jobs:
5959
runs-on: ubuntu-latest
6060
needs: [determine-distros]
6161
container:
62-
image: ros:${{ matrix.ros_distro }}-ros-base-${{ matrix.ubuntu_distro }}
63-
credentials:
64-
username: ${{ secrets.DOCKERHUB_USERNAME }}
65-
password: ${{ secrets.DOCKERHUB_TOKEN }}
62+
image: ubuntu:${{ matrix.ubuntu_distro }}
6663

6764
strategy:
6865
fail-fast: false
@@ -84,11 +81,24 @@ jobs:
8481
- name: Checkout code
8582
uses: actions/checkout@v4
8683

84+
- name: Setup ROS repository
85+
run: |
86+
apt-get update -qq
87+
apt-get install -y curl gnupg lsb-release
88+
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
89+
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" > /etc/apt/sources.list.d/ros2.list
90+
apt-get update -qq
91+
shell: bash
92+
env:
93+
DEBIAN_FRONTEND: noninteractive
94+
8795
- name: Build Debian packages
8896
run: |
8997
chmod +x scripts/build_debian_packages.sh
9098
./scripts/build_debian_packages.sh ${{ matrix.ros_distro }} ${{ matrix.ubuntu_distro }}
9199
shell: bash
100+
env:
101+
DEBIAN_FRONTEND: noninteractive
92102

93103
- name: Upload Debian packages
94104
uses: actions/upload-artifact@v4
@@ -102,10 +112,7 @@ jobs:
102112
runs-on: ubuntu-latest
103113
needs: [determine-distros, generate-debian]
104114
container:
105-
image: ros:${{ matrix.ros_distro }}-ros-base-${{ matrix.ubuntu_distro }}
106-
credentials:
107-
username: ${{ secrets.DOCKERHUB_USERNAME }}
108-
password: ${{ secrets.DOCKERHUB_TOKEN }}
115+
image: ubuntu:${{ matrix.ubuntu_distro }}
109116

110117
strategy:
111118
fail-fast: false
@@ -124,9 +131,16 @@ jobs:
124131
ubuntu_distro: noble
125132

126133
steps:
127-
- name: Setup environment
134+
- name: Setup ROS repository
128135
run: |
129136
apt-get update -qq
137+
apt-get install -y curl gnupg lsb-release
138+
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
139+
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" > /etc/apt/sources.list.d/ros2.list
140+
apt-get update -qq
141+
shell: bash
142+
env:
143+
DEBIAN_FRONTEND: noninteractive
130144

131145
- name: Download Debian packages
132146
uses: actions/download-artifact@v4
@@ -140,12 +154,14 @@ jobs:
140154
echo "Smoke testing install on ROS2 ${{ matrix.ros_distro }}"
141155
ls -la debian_packages/${{ matrix.ros_distro }}/
142156
143-
# Install the debian packages
157+
# Install the debian packages (apt will pull in ROS dependencies automatically)
144158
apt-get install -y ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-greenwave-monitor-interfaces_*.deb ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-greenwave-monitor_*.deb ./debian_packages/${{ matrix.ros_distro }}/ros-${{ matrix.ros_distro }}-r2s-gw_*.deb
145159
146160
# Verify packages are installed
147161
dpkg -s ros-${{ matrix.ros_distro }}-r2s-gw ros-${{ matrix.ros_distro }}-greenwave-monitor ros-${{ matrix.ros_distro }}-greenwave-monitor-interfaces
148162
shell: bash
163+
env:
164+
DEBIAN_FRONTEND: noninteractive
149165

150166
- name: Test ncurses_dashboard execution (no extra dependencies)
151167
run: |

.github/workflows/ros-tests.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ jobs:
3030
name: Test ROS2 ${{ matrix.ros_distro }}
3131
runs-on: ubuntu-latest
3232
container:
33-
image: ros:${{ matrix.ros_distro }}-ros-base-${{ matrix.ubuntu_distro }}
34-
credentials:
35-
username: ${{ secrets.DOCKERHUB_USERNAME }}
36-
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
image: ubuntu:${{ matrix.ubuntu_distro }}
3734

3835
strategy:
3936
fail-fast: false
@@ -54,11 +51,24 @@ jobs:
5451
- name: Checkout code
5552
uses: actions/checkout@v4
5653

57-
- name: Setup ROS environment
54+
- name: Setup ROS repository and install rosdep
5855
run: |
59-
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
60-
apt-get update -qq && apt-get install -y build-essential python3-pip
56+
apt-get update -qq
57+
apt-get install -y curl gnupg lsb-release
58+
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
59+
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" > /etc/apt/sources.list.d/ros2.list
60+
apt-get update -qq
61+
apt-get install -y python3-rosdep python3-colcon-common-extensions build-essential cmake git python3-pip
62+
shell: bash
63+
64+
- name: Initialize rosdep and install dependencies
65+
run: |
66+
rosdep init
67+
rosdep update --include-eol-distros
68+
rosdep install --from-paths . --rosdistro ${{ matrix.ros_distro }} --ignore-src -r -y
6169
shell: bash
70+
env:
71+
DEBIAN_FRONTEND: noninteractive
6272

6373
- name: Install Python dependencies
6474
run: |

scripts/build_debian_packages.sh

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
# Docker Usage (Recommended):
3131
# docker run -it --rm -v $(pwd):/workspace -w /workspace \
32-
# ros:humble-ros-base-jammy ./scripts/build_debian_packages.sh humble jammy
32+
# ubuntu:jammy ./scripts/build_debian_packages.sh humble jammy
3333
#
3434
# Supported combinations:
3535
# humble/jammy, iron/jammy, jazzy/noble, kilted/noble, rolling/noble
@@ -71,19 +71,17 @@ esac
7171

7272
echo "Building Debian packages for ROS $ROS_DISTRO on Ubuntu $UBUNTU_DISTRO"
7373

74-
# Check if running in ROS container or local system
75-
if [ ! -f "/opt/ros/$ROS_DISTRO/setup.bash" ]; then
76-
echo "Error: ROS $ROS_DISTRO not found at /opt/ros/$ROS_DISTRO/setup.bash"
77-
echo "Please run this script in a ROS $ROS_DISTRO container or install ROS $ROS_DISTRO locally"
74+
# Check if running in a container (recommended) or warn user
75+
if [ ! -f "/.dockerenv" ] && [ ! -f "/run/.containerenv" ]; then
76+
echo "WARNING: Not running in a container. This script is designed to run in a clean Ubuntu container."
7877
echo ""
79-
echo "To run in Docker:"
80-
echo " docker run -it --rm -v \$(pwd):/workspace -w /workspace ros:$ROS_DISTRO-ros-base-$UBUNTU_DISTRO ./scripts/build_debian_packages.sh $ROS_DISTRO $UBUNTU_DISTRO"
81-
exit 1
78+
echo "Recommended: Run in Docker with:"
79+
echo " docker run -it --rm -v \$(pwd):/workspace -w /workspace ubuntu:$UBUNTU_DISTRO ./scripts/build_debian_packages.sh $ROS_DISTRO $UBUNTU_DISTRO"
80+
echo ""
81+
echo "Press Ctrl+C to cancel, or Enter to continue anyway (not recommended)..."
82+
read -r
8283
fi
8384

84-
# Source ROS environment
85-
source /opt/ros/$ROS_DISTRO/setup.bash
86-
8785
# Install dependencies
8886
echo "Installing build dependencies..."
8987
apt-get update -qq
@@ -95,7 +93,8 @@ if [[ "$ROS_DISTRO" == "jazzy" || "$ROS_DISTRO" == "kilted" || "$ROS_DISTRO" ==
9593
fi
9694

9795
# Install system dependencies
98-
apt-get install -y build-essential python3-pip python3-bloom python3-rosdep git lsb-release devscripts debhelper fakeroot
96+
export DEBIAN_FRONTEND=noninteractive
97+
apt-get install -y build-essential python3-pip python3-bloom python3-rosdep git lsb-release devscripts debhelper fakeroot python3-colcon-common-extensions cmake
9998

10099
# Install Python dependencies
101100
if [ -f "requirements.txt" ]; then
@@ -108,6 +107,20 @@ if [ -f "requirements.txt" ]; then
108107
fi
109108
fi
110109

110+
# Initialize rosdep and install all build dependencies
111+
echo "Initializing rosdep and resolving dependencies..."
112+
rosdep init 2>/dev/null || true
113+
rosdep update --include-eol-distros
114+
rosdep install --from-paths . --rosdistro "$ROS_DISTRO" --ignore-src -r -y
115+
116+
# Source ROS environment (now installed via rosdep)
117+
if [ ! -f "/opt/ros/$ROS_DISTRO/setup.bash" ]; then
118+
echo "Error: ROS $ROS_DISTRO not found after rosdep install"
119+
echo "This should have been installed by rosdep. Check package.xml dependencies."
120+
exit 1
121+
fi
122+
source /opt/ros/$ROS_DISTRO/setup.bash
123+
111124
# Build workspace first
112125
echo "Building workspace..."
113126
colcon build --packages-up-to r2s_gw

0 commit comments

Comments
 (0)