Skip to content

Commit

Permalink
Merge pull request #8 from ika-rwth-aachen/fix/rosdep-no-ros-base-image
Browse files Browse the repository at this point in the history
Fix rosdep install for non-ROS base images
  • Loading branch information
lreiher authored Sep 15, 2023
2 parents b1ad47c + 3928367 commit 4df1a11
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
docker-ros:
runs-on: ubuntu-latest
steps:
- uses: ika-rwth-aachen/[email protected].3
- uses: ika-rwth-aachen/[email protected].5
with:
base-image: rwthika/ros2:humble
command: ros2 run my_pkg my_node
Expand All @@ -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
Expand All @@ -129,7 +129,7 @@ jobs:
docker-ros:
runs-on: ubuntu-latest
steps:
- uses: ika-rwth-aachen/[email protected].3
- uses: ika-rwth-aachen/[email protected].5
with:
base-image: rwthika/ros2:humble
command: ros2 run my_pkg my_node
Expand All @@ -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
Expand All @@ -162,7 +162,7 @@ jobs:
docker-ros:
runs-on: ubuntu-latest
steps:
- uses: ika-rwth-aachen/[email protected].3
- uses: ika-rwth-aachen/[email protected].5
with:
base-image: rwthika/ros2:humble
command: ros2 run my_pkg my_node
Expand All @@ -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
Expand All @@ -197,7 +197,7 @@ jobs:
docker-ros:
runs-on: ubuntu-latest
steps:
- uses: ika-rwth-aachen/[email protected].3
- uses: ika-rwth-aachen/[email protected].5
with:
base-image: rwthika/ros2:humble
command: ros2 run my_pkg my_node
Expand All @@ -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
Expand All @@ -234,7 +234,7 @@ jobs:
platform: [amd64, arm64]
runs-on: [self-hosted, "${{ matrix.platform }}"]
steps:
- uses: ika-rwth-aachen/[email protected].3
- uses: ika-rwth-aachen/[email protected].5
with:
base-image: rwthika/ros2:humble
command: ros2 run my_pkg my_node
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN apt-get update && \
git \
python3-rosdep \
python3-vcstool \
ros-${ROS_DISTRO}-ros-core \
&& rm -rf /var/lib/apt/lists/*

# copy contents of repository
Expand Down Expand Up @@ -60,6 +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 && \
apt-get update && \
rosdep init || true && \
rosdep update --rosdistro ${ROS_DISTRO} && \
Expand Down Expand Up @@ -154,6 +156,7 @@ RUN apt-get update && \
gosu \
python-is-python3 \
python3-pip \
ros-${ROS_DISTRO}-ros-core \
&& rm -rf /var/lib/apt/lists/*
# copy install script from dependencies stage
Expand Down
8 changes: 4 additions & 4 deletions docker/recursive_vcs_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()

0 comments on commit 4df1a11

Please sign in to comment.