Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rosdep install for non-ROS base images #8

Merged
merged 6 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()