Skip to content

Commit 09ec444

Browse files
authored
Merge pull request #189 from space-ros/adjust-demos-for-new-base
Fix remaining issues in applications and demos from the updated spaceros base image
2 parents 588d5a9 + 2279408 commit 09ec444

File tree

9 files changed

+52
-16
lines changed

9 files changed

+52
-16
lines changed

.github/workflows/docker-build.yml

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
# free up a lot of stuff from /usr/local
2121
sudo rm -rf /usr/local
2222
df -h
23+
- name: Login to ghcr
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
2329
- name: Checkout
2430
uses: actions/checkout@v2
2531
- name: Set up buildx
@@ -33,6 +39,8 @@ jobs:
3339
cache-from: type=gha
3440
cache-to: type=gha,mode=max
3541
no-cache: false
42+
build-args: |
43+
SPACE_ROS_IMAGE=osrf/space-ros:main
3644
outputs: type=docker,dest=/tmp/moveit2.tar
3745
- name: Build space robots demo image
3846
run: |
@@ -55,3 +63,5 @@ jobs:
5563
cache-from: type=gha
5664
cache-to: type=gha,mode=max
5765
no-cache: false
66+
build-args: |
67+
SPACE_ROS_IMAGE=osrf/space-ros:main

moveit2/Dockerfile

+10-7
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
#
1717
# The script provides the following build arguments:
1818
#
19-
# VCS_REF - The git revision of the Space ROS source code (no default value).
20-
# VERSION - The version of Space ROS (default: "preview")
19+
# VCS_REF - The git revision of the Space ROS source code (no default value).
20+
# VERSION - The version of Space ROS (default: "preview")
21+
# SPACE_ROS_IMAGE - The base Space ROS image to build on
2122

22-
FROM osrf/space-ros:latest
23+
ARG SPACE_ROS_IMAGE=osrf/space-ros:latest
24+
25+
FROM ${SPACE_ROS_IMAGE}
2326

2427
# Define arguments used in the metadata definition
2528
ARG VCS_REF
@@ -91,9 +94,9 @@ RUN python3 -m pip install -U \
9194

9295
# Get the MoveIt2 source code
9396
WORKDIR ${HOME_DIR}
94-
RUN sudo git clone https://github.com/moveit/moveit2.git -b ${ROSDISTRO} moveit2/src
97+
RUN sudo git clone https://github.com/ros-planning/moveit2.git -b ${ROS_DISTRO} moveit2/src
9598
RUN cd ${MOVEIT2_DIR}/src \
96-
&& sudo git clone https://github.com/moveit/moveit2_tutorials.git -b ${ROSDISTRO}
99+
&& sudo git clone https://github.com/ros-planning/moveit2_tutorials.git -b ${ROS_DISTRO}
97100

98101
# Update the ownership of the source files (had to use sudo above to work around
99102
# a possible inherited 'insteadof' from the host that forces use of ssh
@@ -108,7 +111,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
108111
COPY --chown=${USERNAME}:${USERNAME} moveit2-pkgs.txt /tmp/
109112
COPY --chown=${USERNAME}:${USERNAME} excluded-pkgs.txt /tmp/
110113
RUN rosinstall_generator \
111-
--rosdistro ${ROSDISTRO} \
114+
--rosdistro ${ROS_DISTRO} \
112115
--deps \
113116
--exclude-path ${SPACEROS_DIR}/src \
114117
--exclude $(cat /tmp/excluded-pkgs.txt) -- \
@@ -129,7 +132,7 @@ RUN sudo chown -R ${USERNAME}:${USERNAME} ${MOVEIT2_DIR}
129132
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
130133
--mount=type=cache,target=/var/lib/apt,sharing=locked \
131134
/bin/bash -c 'source ${SPACEROS_DIR}/install/setup.bash' \
132-
&& rosdep install --from-paths ../spaceros/src src --ignore-src --rosdistro ${ROSDISTRO} -r -y --skip-keys "console_bridge generate_parameter_library fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers rmw_connextdds ros_testing rmw_connextdds rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp composition demo_nodes_py lifecycle rosidl_typesupport_fastrtps_cpp rosidl_typesupport_fastrtps_c ikos diagnostic_aggregator diagnostic_updater joy qt_gui rqt_gui rqt_gui_py"
135+
&& rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -r -y --skip-keys "console_bridge generate_parameter_library fastcdr fastrtps rti-connext-dds-5.3.1 urdfdom_headers rmw_connextdds ros_testing rmw_connextdds rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp composition demo_nodes_py lifecycle rosidl_typesupport_fastrtps_cpp rosidl_typesupport_fastrtps_c ikos diagnostic_aggregator diagnostic_updater joy qt_gui rqt_gui rqt_gui_py"
133136

134137
# Apply a patch to octomap_msgs to work around a build issue
135138
COPY --chown=${USERNAME}:${USERNAME} octomap_fix.diff ./src/octomap_msgs

moveit2/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ To build the docker image, run:
1111
./build.sh
1212
```
1313

14+
By default, this will build on top of the latest released version of the Space ROS base image (typically `osrf/space-ros:latest`).
15+
If building locally, the underlying base image can be set in the [build script](./build.sh), or through the environment with:
16+
17+
```bash
18+
# Use a locally built image as the base
19+
SPACE_ROS_IMAGE="space-ros:main" ./build.sh
20+
```
21+
1422
The build process will take about 30 minutes, depending on the host computer.
1523

1624
## Running the MoveIt2 Docker Image in a Container

moveit2/build.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ echo ""
1616

1717
docker build -t $ORG/$IMAGE:$TAG \
1818
--build-arg VCS_REF="$VCS_REF" \
19-
--build-arg VERSION="$VERSION" .
19+
--build-arg VERSION="$VERSION" \
20+
--build-arg SPACE_ROS_IMAGE="${SPACE_ROS_IMAGE:-osrf/space-ros:latest}" \
21+
.
2022

2123
echo ""
2224
echo "##### Done! #####"

navigation2/Dockerfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
#
1717
# The script provides the following build arguments:
1818
#
19-
# VCS_REF - The git revision of the Space ROS source code (no default value).
20-
# VERSION - The version of Space ROS (default: "preview")
19+
# VCS_REF - The git revision of the Space ROS source code (no default value).
20+
# VERSION - The version of Space ROS (default: "preview")
21+
# SPACE_ROS_IMAGE - The base Space ROS image to build on
2122

22-
FROM osrf/space-ros:latest
23+
ARG SPACE_ROS_IMAGE=osrf/space-ros:latest
24+
25+
FROM ${SPACE_ROS_IMAGE}
2326

2427
# Define arguments used in the metadata definition
2528
ARG VCS_REF
@@ -62,7 +65,7 @@ RUN mkdir ${SPACEROS_DIR}/src \
6265

6366
# Generate repos file for nav2 dependencies, exclude packages from Space ROS src
6467
RUN rosinstall_generator \
65-
--rosdistro ${ROSDISTRO} \
68+
--rosdistro ${ROS_DISTRO} \
6669
--deps \
6770
--exclude-path ${SPACEROS_DIR}/src -- \
6871
-- $(cat ${NAVIGATION2_WS}/nav2_dep_keys.txt) \

navigation2/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ To build the docker image, run:
1212

1313
The build process will take about 30 minutes, depending on the host computer.
1414

15+
By default, this will build on top of the latest released version of the Space ROS base image (typically `osrf/space-ros:latest`).
16+
If building locally, the underlying base image can be set in the [build script](./build.sh), or through the environment with:
17+
18+
```bash
19+
# Use a locally built image as the base
20+
SPACE_ROS_IMAGE="space-ros:main" ./build.sh
21+
```
22+
1523
## Running the Navigation2 Docker Image in a Container
1624

1725
After building the image, you can see the newly-built image by running:

navigation2/build.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ echo ""
1616

1717
docker build -t $ORG/$IMAGE:$TAG \
1818
--build-arg VCS_REF="$VCS_REF" \
19-
--build-arg VERSION="$VERSION" .
19+
--build-arg VERSION="$VERSION" \
20+
--build-arg SPACE_ROS_IMAGE="${SPACE_ROS_IMAGE:-osrf/space-ros:latest}" \
21+
.
2022

2123
echo ""
2224
echo "##### Done! #####"

space_robots/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
5656
# COPY --chown=${USERNAME}:${USERNAME} demo-pkgs.txt /tmp/
5757
# COPY --chown=${USERNAME}:${USERNAME} excluded-pkgs.txt /tmp/
5858
# RUN rosinstall_generator \
59-
# --rosdistro ${ROSDISTRO} \
59+
# --rosdistro ${ROS_DISTRO} \
6060
# --deps \
6161
# --exclude-path ${SPACEROS_DIR}/src \
6262
# --exclude-path ${MOVEIT2_DIR}/src \
@@ -91,7 +91,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
9191
sudo apt-get update -y \
9292
&& /bin/bash -c 'source "${SPACEROS_DIR}/install/setup.bash"' \
9393
&& /bin/bash -c 'source "${MOVEIT2_DIR}/install/setup.bash"' \
94-
&& rosdep install --from-paths src --ignore-src -r -y --rosdistro ${ROSDISTRO}
94+
&& rosdep install --from-paths src --ignore-src -r -y --rosdistro ${ROS_DISTRO}
9595

9696
# Build the demo
9797
RUN /bin/bash -c 'source ${SPACEROS_DIR}/install/setup.bash && source ${MOVEIT2_DIR}/install/setup.bash \

space_robots/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ docker exec -it <container-name> bash
5757
Make sure packages are sourced:
5858

5959
```bash
60-
source ~/spaceros/install/setup.bash
60+
source ${SPACEROS_DIR}/install/setup.bash
6161
```
6262

6363
```bash

0 commit comments

Comments
 (0)