-
Notifications
You must be signed in to change notification settings - Fork 0
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
ros/ubuntu: add Docker workspace ros/ubuntu to build an image with ROS 1 + orocos_toolchain + rtt_ros_integration #4
base: feature/preinstall-rtt-ros2-integration-and-common-interfaces
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
## Provide Orocos Toolchain (RTT/OCL) and rtt_ros_integration overlay workspace on top of the | ||
## official ROS 2 docker images. | ||
|
||
ARG ROS_DISTRO | ||
ARG UBUNTU_DISTRO | ||
|
||
## ************************************************************************************************* | ||
## Stage base: prepare build environment | ||
## ************************************************************************************************* | ||
FROM ros:${ROS_DISTRO}-ros-base-${UBUNTU_DISTRO} AS base | ||
|
||
# add custom rosdep rule file and update rosdep database | ||
COPY prereqs.yaml /etc/ros/rosdep/ | ||
RUN echo "yaml file:///etc/ros/rosdep/prereqs.yaml" > /etc/ros/rosdep/sources.list.d/10-custom.list | ||
RUN rosdep update | ||
|
||
# install python-vcstool used to clone repositories below | ||
RUN apt-get update \ | ||
&& apt-get install -y python-vcstool \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# setup new entrypoint and default command | ||
COPY orocos_entrypoint.sh /orocos_entrypoint.sh | ||
ENTRYPOINT [ "/orocos_entrypoint.sh" ] | ||
CMD [ "bash" ] | ||
|
||
## ************************************************************************************************* | ||
## Stage orocos_toolchain: clone, build and install Orocos Toolchain using CMake (with CORBA) | ||
## ************************************************************************************************* | ||
FROM base AS orocos_toolchain | ||
|
||
COPY orocos_toolchain.repos /build/src/ | ||
RUN vcs import --recursive /build/src < /build/src/orocos_toolchain.repos \ | ||
&& cd /build \ | ||
&& . /opt/ros/${ROS_DISTRO}/local_setup.sh \ | ||
# | ||
# Install dependencies with rosdep | ||
&& apt-get update \ | ||
&& apt-get install -y ruby \ | ||
&& rosdep install -y --from-path src --ignore-src \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
# | ||
# Build the workspace | ||
&& catkin_make_isolated \ | ||
--install \ | ||
--install-space /opt/orocos/${ROS_DISTRO} \ | ||
--cmake-args \ | ||
-DBUILD_TESTING=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DENABLE_CORBA=ON \ | ||
-DCORBA_IMPLEMENTATION=OMNIORB \ | ||
-DOROCOS_INSTALL_INTO_PREFIX_ROOT=ON \ | ||
# | ||
# Cleanup | ||
&& rm -rf /build | ||
|
||
## ************************************************************************************************* | ||
## Stage overlay: clone, build and install overlay workspaces to /opt/ros/${ROS_DISTRO} | ||
## ************************************************************************************************* | ||
FROM orocos_toolchain AS overlay | ||
|
||
COPY overlay.repos /build/src/ | ||
RUN vcs import --recursive /build/src < /build/src/overlay.repos \ | ||
&& cd /build \ | ||
&& . /opt/ros/${ROS_DISTRO}/local_setup.sh \ | ||
&& . /opt/orocos/${ROS_DISTRO}/local_setup.sh \ | ||
# | ||
# Install dependencies with rosdep | ||
&& apt-get update \ | ||
&& ROS_PACKAGE_PATH=/opt/orocos/${ROS_DISTRO}/share:/opt/ros/${ROS_DISTRO}/share \ | ||
rosdep install -y --from-path . --ignore-src \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
# | ||
# Build the workspace | ||
&& catkin_make_isolated \ | ||
--install \ | ||
--install-space /opt/orocos/${ROS_DISTRO} \ | ||
--cmake-args \ | ||
-DCATKIN_ENABLE_TESTING=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
# | ||
# Cleanup | ||
&& rm -rf /build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# Build hook for Docker Hub. | ||
# See https://docs.docker.com/docker-hub/builds/advanced/. | ||
|
||
#DOCKER_TAG=eloquent-ros-base-bionic | ||
ROS_DISTRO=${DOCKER_TAG%%-*} | ||
UBUNTU_DISTRO=${DOCKER_TAG##*-} | ||
|
||
# Build and push the stage orocos_toolchain first. | ||
# Caching should make sure that the actual build step only rebuilds the final stage overlay. | ||
docker build \ | ||
-t orocos/ros-ci:${DOCKER_TAG} \ | ||
--build-arg ROS_DISTRO=${ROS_DISTRO} \ | ||
--build-arg UBUNTU_DISTRO=${UBUNTU_DISTRO} \ | ||
--target orocos_toolchain \ | ||
. | ||
docker push orocos/ros-ci:${DOCKER_TAG} | ||
|
||
# Only then build the final stage. It will be pushed by Docker Hub. | ||
docker build \ | ||
-t orocos/ros:${DOCKER_TAG} \ | ||
--build-arg ROS_DISTRO=${ROS_DISTRO} \ | ||
--build-arg UBUNTU_DISTRO=${UBUNTU_DISTRO} \ | ||
. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Setup ROS and orocos environment | ||
source "/opt/ros/$ROS_DISTRO/setup.sh" | ||
[ -d "/opt/orocos/$ROS_DISTRO" ] && source "/opt/orocos/$ROS_DISTRO/local_setup.sh" | ||
|
||
# Append commands to setup ROS and orocos environment to ~/.bashrc. | ||
# This is only relevant if the command to be executed ("$@") is an interactive bash shell. | ||
# Or for later `docker exec -it bash`. | ||
# It is not sufficient to source bash-specific setup scripts here, because bash is executed as | ||
# a new process. Aliases, command-line completion etc. configured here would have no effect. | ||
if ! grep -q '# setup ROS and orocos environment' ~/.bashrc >/dev/null; then | ||
cat >>~/.bashrc <<'EOF' | ||
|
||
# setup ROS and orocos environment | ||
source "/opt/ros/$ROS_DISTRO/setup.bash" | ||
[ -d "/opt/orocos/$ROS_DISTRO" ] && source "/opt/orocos/$ROS_DISTRO/local_setup.bash" | ||
EOF | ||
fi | ||
|
||
exec "$@" |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,5 @@ | ||||||||
repositories: | ||||||||
orocos_toolchain: | ||||||||
type: git | ||||||||
url: https://github.com/orocos-toolchain/orocos_toolchain.git | ||||||||
version: ros2 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the version for ros2, I guess:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, the branch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now it was intentional to use the Once that is done and all required patches and also branch |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
repositories: | ||
rtt_ros_integration: | ||
type: git | ||
url: https://github.com/orocos/rtt_ros_integration.git | ||
version: HEAD |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Package ruby-facets does not exist anymore since Ubuntu Focal. | ||
# Use gem instead. | ||
facets: | ||
ubuntu: | ||
'*': ruby-facets | ||
focal: | ||
gem: facets | ||
|
||
# Use metaruby and utilrb from rubygems.org. | ||
metaruby: | ||
debian: | ||
gem: metaruby | ||
ubuntu: | ||
gem: metaruby | ||
utilrb: | ||
debian: | ||
gem: utilrb | ||
ubuntu: | ||
gem: utilrb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Ubuntu
focal
, the packagepython-vcstool
doesn't exist, since python3 is the default version (python3-vcstool
). This impedes Ubuntufocal
ROSnoetic
to be built. Also,git
is missing innoetic
OSRF (core, base).