From df7180f18e85b819576da2e159e2fb9f298f2658 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Thu, 7 Sep 2023 13:21:03 +0200 Subject: [PATCH 1/6] install minimal ros package --- docker/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 599b65a..b901694 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,7 +30,9 @@ RUN apt-get update && \ git \ python3-rosdep \ python3-vcstool \ - && rm -rf /var/lib/apt/lists/* + ros-${ROS_DISTRO}-ros-environment \ + && rm -rf /var/lib/apt/lists/* && \ + source /opt/ros/${ROS_DISTRO}/setup.bash # copy contents of repository COPY . src/target @@ -154,6 +156,7 @@ RUN apt-get update && \ gosu \ python-is-python3 \ python3-pip \ + ros-${ROS_DISTRO}-ros-environment \ && rm -rf /var/lib/apt/lists/* # copy install script from dependencies stage @@ -165,7 +168,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # install ROS CLI tools -RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ +RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \ apt-get update && \ if [[ "$ROS_VERSION" == "1" ]]; then \ apt-get install -y \ From 4976b2f8a28a313cc658a920a16136ba490cd43d Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Thu, 7 Sep 2023 14:15:56 +0200 Subject: [PATCH 2/6] source before rosdep --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index b901694..7a3518f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -62,6 +62,7 @@ RUN /usr/local/bin/recursive_vcs_import.py src src/upstream # create install script with list of rosdep dependencies RUN echo "set -e" >> $WORKSPACE/.install-dependencies.sh && \ + source /opt/ros/${ROS_DISTRO}/setup.bash && \ apt-get update && \ rosdep init || true && \ rosdep update --rosdistro ${ROS_DISTRO} && \ From ffefc693b5be609fd6efd722683cf90363c951a2 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Thu, 7 Sep 2023 14:40:39 +0200 Subject: [PATCH 3/6] remove unnecessary source --- docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7a3518f..a00464c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -31,8 +31,7 @@ RUN apt-get update && \ python3-rosdep \ python3-vcstool \ ros-${ROS_DISTRO}-ros-environment \ - && rm -rf /var/lib/apt/lists/* && \ - source /opt/ros/${ROS_DISTRO}/setup.bash + && rm -rf /var/lib/apt/lists/* # copy contents of repository COPY . src/target From 0b5d294f0cb309adeb449568047a8e147b488049 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Thu, 7 Sep 2023 14:47:09 +0200 Subject: [PATCH 4/6] bump version --- README.md | 18 +++++++++--------- docker/recursive_vcs_import.py | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index fc4248f..4009a47 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ jobs: docker-ros: runs-on: ubuntu-latest steps: - - uses: ika-rwth-aachen/docker-ros@v1.2.3 + - uses: ika-rwth-aachen/docker-ros@v1.2.5 with: base-image: rwthika/ros2:humble command: ros2 run my_pkg my_node @@ -110,7 +110,7 @@ jobs: ```yml include: - - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.3/.gitlab-ci/docker-ros.yml + - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.5/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:humble @@ -129,7 +129,7 @@ jobs: docker-ros: runs-on: ubuntu-latest steps: - - uses: ika-rwth-aachen/docker-ros@v1.2.3 + - uses: ika-rwth-aachen/docker-ros@v1.2.5 with: base-image: rwthika/ros2:humble command: ros2 run my_pkg my_node @@ -142,7 +142,7 @@ jobs: ```yml include: - - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.3/.gitlab-ci/docker-ros.yml + - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.5/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:humble @@ -162,7 +162,7 @@ jobs: docker-ros: runs-on: ubuntu-latest steps: - - uses: ika-rwth-aachen/docker-ros@v1.2.3 + - uses: ika-rwth-aachen/docker-ros@v1.2.5 with: base-image: rwthika/ros2:humble command: ros2 run my_pkg my_node @@ -176,7 +176,7 @@ jobs: ```yml include: - - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.3/.gitlab-ci/docker-ros.yml + - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.5/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:humble @@ -197,7 +197,7 @@ jobs: docker-ros: runs-on: ubuntu-latest steps: - - uses: ika-rwth-aachen/docker-ros@v1.2.3 + - uses: ika-rwth-aachen/docker-ros@v1.2.5 with: base-image: rwthika/ros2:humble command: ros2 run my_pkg my_node @@ -210,7 +210,7 @@ jobs: ```yml include: - - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.3/.gitlab-ci/docker-ros.yml + - remote: https://raw.githubusercontent.com/ika-rwth-aachen/docker-ros/v1.2.5/.gitlab-ci/docker-ros.yml variables: BASE_IMAGE: rwthika/ros2:humble @@ -234,7 +234,7 @@ jobs: platform: [amd64, arm64] runs-on: [self-hosted, "${{ matrix.platform }}"] steps: - - uses: ika-rwth-aachen/docker-ros@v1.2.3 + - uses: ika-rwth-aachen/docker-ros@v1.2.5 with: base-image: rwthika/ros2:humble command: ros2 run my_pkg my_node diff --git a/docker/recursive_vcs_import.py b/docker/recursive_vcs_import.py index 160460a..e8cda6a 100755 --- a/docker/recursive_vcs_import.py +++ b/docker/recursive_vcs_import.py @@ -6,7 +6,7 @@ from typing import List, Optional -def findDotRepos(search_path: str, clone_path: Optional[str]=None) -> List[pathlib.Path]: +def findDotRepos(search_path: str, clone_path: Optional[str] = None) -> List[pathlib.Path]: repos = list(pathlib.Path(search_path).glob("**/*.repos")) if clone_path is not None: @@ -32,11 +32,11 @@ def main(): proc = subprocess.run(["vcs", "import", clone_path, "--recursive"], stdin=f) if proc.returncode != 0: raise RuntimeError("vcs import failed") - + cloned_repos.append(next_repo) - + print(" ".join([str(repo) for repo in set(found_repos)])) if __name__ == "__main__": - main() + main() \ No newline at end of file From 417e381f4530901a7b9f9b5e126d600f04efab9a Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Tue, 12 Sep 2023 20:27:29 +0200 Subject: [PATCH 5/6] source only ros_version.sh out of ros_environment --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a00464c..ff7d7d4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -61,7 +61,7 @@ RUN /usr/local/bin/recursive_vcs_import.py src src/upstream # create install script with list of rosdep dependencies RUN echo "set -e" >> $WORKSPACE/.install-dependencies.sh && \ - source /opt/ros/${ROS_DISTRO}/setup.bash && \ + source $(find /opt/ros/$ROS_DISTRO/share/ros_environment -name "1.ros_version.sh") && \ apt-get update && \ rosdep init || true && \ rosdep update --rosdistro ${ROS_DISTRO} && \ @@ -168,7 +168,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # install ROS CLI tools -RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \ +RUN source $(find /opt/ros/$ROS_DISTRO/share/ros_environment -name "1.ros_version.sh") && \ apt-get update && \ if [[ "$ROS_VERSION" == "1" ]]; then \ apt-get install -y \ From 3928367568dd9d1d4bc44276247fa262641b9045 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Thu, 14 Sep 2023 13:33:20 +0200 Subject: [PATCH 6/6] install ros-core instead of ros-environment --- docker/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ff7d7d4..5d76a97 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && \ git \ python3-rosdep \ python3-vcstool \ - ros-${ROS_DISTRO}-ros-environment \ + ros-${ROS_DISTRO}-ros-core \ && rm -rf /var/lib/apt/lists/* # copy contents of repository @@ -61,7 +61,7 @@ RUN /usr/local/bin/recursive_vcs_import.py src src/upstream # create install script with list of rosdep dependencies RUN echo "set -e" >> $WORKSPACE/.install-dependencies.sh && \ - source $(find /opt/ros/$ROS_DISTRO/share/ros_environment -name "1.ros_version.sh") && \ + source /opt/ros/$ROS_DISTRO/setup.bash && \ apt-get update && \ rosdep init || true && \ rosdep update --rosdistro ${ROS_DISTRO} && \ @@ -156,7 +156,7 @@ RUN apt-get update && \ gosu \ python-is-python3 \ python3-pip \ - ros-${ROS_DISTRO}-ros-environment \ + ros-${ROS_DISTRO}-ros-core \ && rm -rf /var/lib/apt/lists/* # copy install script from dependencies stage @@ -168,7 +168,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # install ROS CLI tools -RUN source $(find /opt/ros/$ROS_DISTRO/share/ros_environment -name "1.ros_version.sh") && \ +RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ apt-get update && \ if [[ "$ROS_VERSION" == "1" ]]; then \ apt-get install -y \