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

Use apt install for rmw zenoh #48

Merged
merged 4 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 0 additions & 5 deletions .gitlab-ci/docker-ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ variables:
REGISTRY_USER: ${CI_REGISTRY_USER} # Docker registry username
REGISTRY: ${CI_REGISTRY} # Docker registry to push images to
RMW_IMPLEMENTATION: 'rmw_cyclonedds_cpp' # RMW implementation to use (only for ROS 2)
RMW_ZENOH_GIT_REF: '' # Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp`
ROS_DISTRO: '' # ROS Distro (required if ROS is not installed in `base-image`)
SLIM_BUILD_ARGS: '--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false' # Arguments to `slim build` (except for `--target` and `--tag`)
TARGET: run # Target stage of Dockerfile (comma-separated list) [dev|run]
Expand Down Expand Up @@ -205,10 +204,6 @@ run-arm64:
fi
- git clone --branch master --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci
- test -f ${BUILD_CONTEXT}/.repos || echo "repositories:" > ${BUILD_CONTEXT}/.repos
- |-
if [ "$RMW_IMPLEMENTATION" = "rmw_zenoh_cpp" ]; then
export UNDERLAY="/opt/ws_rmw_zenoh/install"
fi
script: .industrial_ci/gitlab.sh

Test dev-amd64:
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,6 @@ The password of the custom user is set to its username (`dockeruser:dockeruser`
ROS 2 middleware implementation
*default:* `rmw_cyclonedds_cpp`
*supported values:* `rmw_zenoh_cpp`, `rmw_fastrtps_cpp`, `rmw_cyclonedds_cpp`, `rmw_gurumdds_cpp`, ...
- **`rmw-zenoh-git-ref` | `RMW_ZENOH_GIT_REF`**
Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp`
*default:* `$ROS_DISTRO`
- **`ros-distro` | `ROS_DISTRO`**
ROS Distro
*required if ROS is not installed in `base-image`*
Expand Down
7 changes: 1 addition & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ inputs:
rmw-implementation:
description: "RMW implementation to use (only for ROS 2)"
default: rmw_cyclonedds_cpp
rmw-zenoh-git-ref:
description: "Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp`"
slim-build-args:
description: "Arguments to `slim build` (except for `--target` and `--tag`)"
default: '--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false'
Expand Down Expand Up @@ -211,7 +209,6 @@ runs:
IMAGE_TAG: ${{ inputs.image-tag }}
PLATFORM: ${{ inputs.platform }}
RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }}
RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }}
ROS_DISTRO: ${{ inputs.ros-distro }}
SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }}
SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }}
Expand All @@ -229,7 +226,7 @@ runs:
uses: ros-industrial/industrial_ci@master
env:
ADDITIONAL_DEBS: git
AFTER_INIT_EMBED: '[[ "$RMW_IMPLEMENTATION" == "rmw_zenoh_cpp" ]] && export UNDERLAY="/opt/ws_rmw_zenoh/install" ; [[ -n ${{ inputs.git-https-server }} ]] && git config --global url.https://${{ inputs.git-https-user }}:${{ inputs.git-https-password }}@${{ inputs.git-https-server }}.insteadOf https://${{ inputs.git-https-server }}'
AFTER_INIT_EMBED: '[[ -n ${{ inputs.git-https-server }} ]] && git config --global url.https://${{ inputs.git-https-user }}:${{ inputs.git-https-password }}@${{ inputs.git-https-server }}.insteadOf https://${{ inputs.git-https-server }}'
DOCKER_IMAGE: ${{ steps.build-images.outputs.INDUSTRIAL_CI_IMAGE }}
DOCKER_PULL: false
DOCKER_RUN_OPTS: -u root:root
Expand Down Expand Up @@ -276,7 +273,6 @@ runs:
IMAGE_TAG: ${{ inputs.image-tag }}
PLATFORM: ${{ inputs.platform }}
RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }}
RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }}
ROS_DISTRO: ${{ inputs.ros-distro }}
SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }}
SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }}
Expand Down Expand Up @@ -319,7 +315,6 @@ runs:
IMAGE_TAG: latest
PLATFORM: ${{ inputs.platform }}
RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }}
RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }}
ROS_DISTRO: ${{ inputs.ros-distro }}
SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }}
SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }}
Expand Down
24 changes: 1 addition & 23 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -222,29 +222,8 @@ RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc
# install desired ROS 2 middleware
ARG RMW_IMPLEMENTATION
ENV RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION:-rmw_cyclonedds_cpp}
ARG RMW_ZENOH_GIT_REF
RUN source /opt/ros/$ROS_DISTRO/setup.bash && \
if [[ "$RMW_IMPLEMENTATION" == "rmw_zenoh_cpp" ]]; then \
if [[ ! -d /opt/ws_rmw_zenoh/src ]]; then \
mkdir -p /opt/ws_rmw_zenoh/src && \
git clone https://github.com/ros2/rmw_zenoh.git /opt/ws_rmw_zenoh/src/rmw_zenoh && \
cd /opt/ws_rmw_zenoh/src/rmw_zenoh && \
git checkout ${RMW_ZENOH_GIT_REF:-${ROS_DISTRO}} && \
cd - && \
if [[ "$(lsb_release -r | awk '{print $2}')" == "22.04" ]]; then \
git clone -b 2.2.x https://github.com/eProsima/Fast-CDR.git /opt/ws_rmw_zenoh/src/Fast-CDR ; \
fi && \
(rosdep init || true) && \
rosdep update --rosdistro $ROS_DISTRO && \
apt-get update && \
cd /opt/ws_rmw_zenoh && \
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO && \
rm -rf /var/lib/apt/lists/* && \
source /opt/ros/${ROS_DISTRO}/setup.bash && \
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release && \
echo "source /opt/ws_rmw_zenoh/install/setup.bash" >> ~/.bashrc ; \
fi ; \
elif [[ "$ROS_VERSION" == "2" ]]; then \
if [[ "$ROS_VERSION" == "2" && "$DISABLE_ROS_INSTALLATION" != "true"]]; then \
apt-get update && \
RMW_PACKAGE=ros-$ROS_DISTRO-$(echo $RMW_IMPLEMENTATION | tr '_' '-') && \
apt-get install -y $RMW_PACKAGE && \
Expand Down Expand Up @@ -280,7 +259,6 @@ ARG CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"
# build ROS workspace
RUN if [[ -x "$(command -v colcon)" ]]; then \
source /opt/ros/${ROS_DISTRO}/setup.bash && \
[[ -f /opt/ws_rmw_zenoh/install/setup.bash ]] && source /opt/ws_rmw_zenoh/install/setup.bash ; \
[[ -f /opt/ws_base_image/install/setup.bash ]] && source /opt/ws_base_image/install/setup.bash ; \
colcon build --cmake-args ${CMAKE_ARGS} ; \
elif [[ -x "$(command -v catkin)" ]]; then \
Expand Down
1 change: 0 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set -e

# source ROS workspace
source /opt/ros/$ROS_DISTRO/setup.bash
[[ -f /opt/ws_rmw_zenoh/install/setup.bash ]] && source /opt/ws_rmw_zenoh/install/setup.bash
[[ -f /opt/ws_base_image/install/setup.bash ]] && source /opt/ws_base_image/install/setup.bash
[[ -f $WORKSPACE/devel/setup.bash ]] && source $WORKSPACE/devel/setup.bash
[[ -f $WORKSPACE/install/setup.bash ]] && source $WORKSPACE/install/setup.bash
Expand Down
1 change: 0 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ build_image() {
add_arg_if_set "GIT_SSH_KNOWN_HOST_KEYS"
add_arg_if_set "GIT_SSH_PRIVATE_KEY"
add_arg_if_set "RMW_IMPLEMENTATION"
add_arg_if_set "RMW_ZENOH_GIT_REF"
add_arg_if_set "ROS_DISTRO"
add_arg_if_set "VCS_IMPORT_FILE"

Expand Down
1 change: 0 additions & 1 deletion scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ GIT_SSH_KNOWN_HOST_KEYS="${GIT_SSH_KNOWN_HOST_KEYS:-}"
GIT_SSH_PRIVATE_KEY="${GIT_SSH_PRIVATE_KEY:-}"
IMAGE="${IMAGE_NAME}:${IMAGE_TAG}"
RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-}"
RMW_ZENOH_GIT_REF="${RMW_ZENOH_GIT_REF:-}"
ROS_DISTRO="${ROS_DISTRO:-}"
SLIM_BUILD_ARGS="${SLIM_BUILD_ARGS:-'--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false'}"
SLIM_IMAGE="${SLIM_IMAGE_NAME}:${SLIM_IMAGE_TAG}"
Expand Down
Loading