-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ros2 image since now yarp-devices-ros2 is integrated in the su…
…perbuild Update and fix broken child images
- Loading branch information
Showing
7 changed files
with
96 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,9 @@ COPY setup.sh ${ROBOTOLOGY_INITIALIZATION_FILE} | |
RUN sudo chown -R icub: /usr/local/bin/entrypoint.sh | ||
RUN sudo chown -R icub: /usr/local/bin/setup_robotology_tdd.sh | ||
|
||
RUN git config --global user.email "[email protected]" &&\ | ||
git config --global user.name "icub" | ||
|
||
# Some other definitions | ||
ARG CMAKE_GENERATOR="Unix Makefiles" | ||
ARG BUILD_TYPE=Release | ||
|
@@ -50,12 +53,11 @@ RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\ | |
-G "$CMAKE_GENERATOR" \ | ||
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ | ||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ | ||
-DNON_INTERACTIVE_BUILD:BOOL=ON \ | ||
-DNON_INTERACTIVE_BUILD:BOOL=OFF \ | ||
-DROBOTOLOGY_ENABLE_CORE:BOOL=ON \ | ||
-DROBOTOLOGY_ENABLE_ICUB_HEAD:BOOL=ON \ | ||
# for enabling robometry | ||
-DROBOTOLOGY_ENABLE_DYNAMICS:BOOL=ON \ | ||
-DYCM_USE_DEPRECATED:BOOL=OFF \ | ||
-DROBOTOLOGY_USES_GAZEBO=OFF \ | ||
-DROBOTOLOGY_PROJECT_TAGS=${sbtag} \ | ||
-DYCM_USE_CMAKE_PROPOSED=ON \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ ARG SOURCE_IMG="none" | |
ARG METADATA_FILE=/usr/local/bin/setup_metadata.sh | ||
ARG PROJECTS_DIR=/projects | ||
ARG INSTALL_DIR=${PROJECTS_DIR}/robotology-superbuild/build/install | ||
ARG release="none" | ||
ARG sbtag="none" | ||
ARG metadata="none" | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE=/usr/local/bin/setup_robotology_tdd.sh | ||
# Default tags | ||
ARG release="master" | ||
ARG sbtag="Stable" | ||
ARG metadata="data" | ||
|
||
# Stage 1: build stage | ||
FROM $SOURCE_IMG AS builder | ||
|
@@ -16,26 +18,20 @@ LABEL maintainer="[email protected], [email protected]" | |
ARG METADATA_FILE | ||
ARG INSTALL_DIR | ||
ARG PROJECTS_DIR | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
ARG release | ||
ARG sbtag | ||
ARG metadata | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
COPY setup.sh ${ROBOTOLOGY_INITIALIZATION_FILE} | ||
|
||
ARG CMAKE_GENERATOR="Unix Makefiles" | ||
ARG BUILD_TYPE=Release | ||
ARG CMAKE_EXTRA_OPTIONS=-j4 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
#The EXPOSE instruction does not actually publish the port. | ||
#It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. | ||
#To actually publish the port when running the container, use the -p flag on docker run to publish and map one or more ports, or the -P flag to publish all exposed ports and map them to high-order ports. | ||
EXPOSE 10000/tcp 10000/udp | ||
#is necessary to expose port?? | ||
|
||
# Some QT-Apps don't show controls without this | ||
ENV QT_X11_NO_MITSHM 1 | ||
ENV YARP_COLORED_OUTPUT=1 | ||
|
||
# Dependencies for gnuplot | ||
RUN apt update && \ | ||
apt install -y python3 libglib2.0-dev-bin &&\ | ||
|
@@ -58,18 +54,26 @@ RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\ | |
# Build all the projects | ||
cmake --build . -- ${CMAKE_EXTRA_OPTIONS} | ||
|
||
RUN echo "source ${INSTALL_DIR}/share/robotology-superbuild/setup.sh" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
# Stage 2: scratch stage | ||
# This should theoretically help reducing the size of the final image | ||
FROM scratch | ||
COPY --from=secondstage / / | ||
COPY --from=builder / / | ||
|
||
ARG metadata | ||
ARG METADATA_FILE | ||
#The EXPOSE instruction does not actually publish the port. | ||
#It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. | ||
#To actually publish the port when running the container, use the -p flag on docker run to publish and map one or more ports, or the -P flag to publish all exposed ports and map them to high-order ports. | ||
EXPOSE 10000/tcp 10000/udp | ||
#is necessary to expose port?? | ||
|
||
ENV img_metadata=${metadata} | ||
# Some QT-Apps don't show controls without this | ||
ENV QT_X11_NO_MITSHM=1 | ||
ENV YARP_COLORED_OUTPUT=1 | ||
|
||
ARG METADATA_FILE | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
|
||
RUN echo 'export img_metadata=${metadata}' > $METADATA_FILE | ||
RUN echo 'echo 'This image was built on $metadata ' ' >> $METADATA_FILE | ||
RUN echo "source ${METADATA_FILE}" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# TODO: remove or correct | ||
#start from image passed by argument during build process. Usually it is an ubuntu image plus mesa library. | ||
ARG START_IMG="none" | ||
ARG METADATA_FILE="/usr/local/bin/setup_metadata.sh" | ||
|
||
#FROM $START_IMG as builder | ||
ARG METADATA_FILE=/usr/local/bin/setup_metadata.sh | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE=/usr/local/bin/setup_robotology_tdd.sh | ||
ARG release="master" | ||
ARG sbtag="Stable" | ||
ARG metadata="data" | ||
|
||
# Definitions | ||
ARG ROS_IMG=ros:humble-ros-base-jammy | ||
ARG ROS_DISTRO=humble | ||
# TODO Now it is working only with icub-main devel START_IMG IGNORED | ||
#ARG SUPERBUILD_IMG=icubteamcode/superbuild-icubhead:master-unstable_sources | ||
ARG PROJECTS_DIR=/projects | ||
ARG INSTALL_DIR=${PROJECTS_DIR}/robotology-superbuild/build/install | ||
|
||
FROM $START_IMG AS superbuild_builder | ||
FROM $ROS_IMG AS ros_builder | ||
|
@@ -21,6 +21,8 @@ LABEL maintainer="[email protected], [email protected]" | |
|
||
ARG ROS_DISTRO | ||
ARG PROJECTS_DIR | ||
ARG INSTALL_DIR | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
|
||
COPY --from=superbuild_builder ${PROJECTS_DIR} ${PROJECTS_DIR} | ||
COPY --from=superbuild_builder /usr /usr | ||
|
@@ -31,56 +33,56 @@ RUN apt update && apt install -y \ | |
ros-humble-rmw-cyclonedds-cpp ros-humble-ament-cmake-clang-format ros-humble-hardware-interface ros-humble-controller-manager ros-humble-ros2-control \ | ||
wget \ | ||
unzip | ||
RUN echo 'source /opt/ros/humble/setup.bash' >> /usr/local/bin/setup_robotology_tdd.sh | ||
RUN echo 'source /opt/ros/${ROS_DISTRO}/setup.bash' >> ${ROBOTOLOGY_INITIALIZATION_FILE} | ||
|
||
|
||
FROM $ROS_IMG AS secondstage | ||
|
||
ARG ROS_DISTRO | ||
ARG PROJECTS_DIR | ||
ARG INSTALL_DIR | ||
ARG METADATA_FILE | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
ARG release | ||
ARG sbtag | ||
ARG metadata | ||
|
||
COPY --from=ros_builder / / | ||
|
||
WORKDIR /root | ||
RUN wget https://github.com/icub-tech-iit/appsAway/files/8919271/FT_setup.zip | ||
RUN unzip FT_setup | ||
|
||
WORKDIR /root | ||
RUN wget https://github.com/icub-tech-iit/appsAway/files/9112222/FT_setup_can.zip | ||
RUN unzip FT_setup_can | ||
|
||
# TODO to be removed once it will merged on upstream branch | ||
RUN cd ${PROJECTS_DIR} && git clone https://github.com/robotology/yarp &&\ | ||
cd yarp &&\ | ||
git checkout master &&\ | ||
mkdir build && cd build &&\ | ||
cmake .. &&\ | ||
make install -j5 | ||
|
||
# TODO to be removed once it will merged on upstream branch | ||
RUN cd ${PROJECTS_DIR} && git clone -b master https://github.com/robotology/icub-main &&\ | ||
cd icub-main &&\ | ||
mkdir build && cd build &&\ | ||
ARG CMAKE_GENERATOR="Unix Makefiles" | ||
ARG BUILD_TYPE=Release | ||
ARG CMAKE_EXTRA_OPTIONS=-j4 | ||
ARG CMAKE_PREFIX_PATH=/usr/local | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
COPY setup.sh ${ROBOTOLOGY_INITIALIZATION_FILE} | ||
|
||
RUN bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash &&\ | ||
echo $AMENT_PREFIX_PATH &&\ | ||
echo $AMENT_CURRENT_PREFIX" | ||
|
||
RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\ | ||
cd build &&\ | ||
cmake .. \ | ||
-DENABLE_icubmod_canBusFtSensor:BOOL=ON \ | ||
-DENABLE_icubmod_canBusAnalogSensor:BOOL=ON \ | ||
-DENABLE_icubmod_embObjFTsensor:BOOL=ON \ | ||
-G "$CMAKE_GENERATOR" \ | ||
-DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} \ | ||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ | ||
-DNON_INTERACTIVE_BUILD:BOOL=ON \ | ||
-DROBOTOLOGY_ENABLE_CORE:BOOL=ON \ | ||
-DROBOTOLOGY_ENABLE_ICUB_HEAD:BOOL=ON \ | ||
# for enabling yarp-devices-ros2 | ||
-DROBOTOLOGY_ENABLE_ROS2:BOOL=ON \ | ||
-DROBOTOLOGY_PROJECT_TAGS=${sbtag} \ | ||
&&\ | ||
make install -j5 | ||
# Build all the projects | ||
cmake --build . -- ${CMAKE_EXTRA_OPTIONS} | ||
|
||
ENV QT_X11_NO_MITSHM=1 | ||
ENV YARP_COLORED_OUTPUT=1 | ||
|
||
RUN bash -c "source /opt/ros/$ROS_DISTRO/setup.bash &&\ | ||
echo $AMENT_PREFIX_PATH &&\ | ||
echo $AMENT_CURRENT_PREFIX &&\ | ||
cd ${PROJECTS_DIR} &&\ | ||
git clone -b master https://github.com/robotology/yarp-devices-ros2.git &&\ | ||
cd yarp-devices-ros2/ros2_interfaces_ws &&\ | ||
colcon build &&\ | ||
source install/setup.bash &&\ | ||
cd .. &&\ | ||
mkdir build && cd build &&\ | ||
cmake .. &&\ | ||
make install -j4" | ||
RUN echo "source ${INSTALL_DIR}/share/robotology-superbuild/setup.sh" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
RUN echo "source ${METADATA_FILE}" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
|
||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] | ||
CMD ["bash"] | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters