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

Feature/fix broken images #36

Merged
merged 1 commit into from
Jan 13, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/onCodeChanges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,11 @@ jobs:

##################### Command to set the tag for the date argument ######################
- name: set date argument for Docker build
id: get_date
run: |
echo "$(date +'%d/%m/%Y')" > DATE_
echo "metadata=$(cat DATE_)" > DATE_TAG
echo $(cat DATE_TAG)
echo $(cat DATE_TAG) >> $GITHUB_OUTPUT

##################### Here we check the release version and replace Custom with stable only for the image name ######################
- name: Get release / master version
Expand Down
71 changes: 71 additions & 0 deletions deprecated_images/demos/moveit-gazebo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#here add all stuff necessary to run redball demo in gazebo
#start from image passed by argument during build process.
ARG START_IMG="none"
ARG METADATA_FILE="/usr/local/bin/setup_metadata.sh"
ARG PROJECTS_DIR=/projects
ARG ROS2_WORKSPACE=ros2_ws

FROM $START_IMG as builder

ENV DEBIAN_FRONTEND=noninteractive

LABEL maintainer="[email protected], [email protected]"

# Args used as env variables always goes after FROM otherwise they are overridden
ARG PROJECTS_DIR
ARG ROS2_WORKSPACE

ARG CMAKE_EXTRA_OPTIONS=-j4

#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

# Some QT-Apps don't show controls without this
ENV QT_X11_NO_MITSHM 1
ENV YARP_COLORED_OUTPUT=1

WORKDIR /

# Install gazebo
RUN apt update && apt install -y \
gazebo

RUN apt update && apt install -y \
ros-humble-gazebo-msgs \
ros-humble-gazebo-ros \
ros-humble-moveit \
ros-humble-moveit-visual-tools \
ros-humble-ros2-controllers \
ros-humble-moveit-ros-planning-interface

RUN echo 'export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp' >> /usr/local/bin/setup_robotology_tdd.sh

# Install nlop (non-linear optimization needed for building trac_ik)
RUN bash -c "mkdir -p ${PROJECTS_DIR} && cd ${PROJECTS_DIR} &&\
git clone https://github.com/stevengj/nlopt.git &&\
cd nlopt &&\
mkdir build &&\
cd build &&\
cmake .. &&\
make &&\
make install"

RUN bash -c "mkdir -p ${PROJECTS_DIR}/${ROS2_WORKSPACE}/src && cd ${PROJECTS_DIR}/${ROS2_WORKSPACE}/src &&\
source /opt/ros/humble/setup.bash &&\
git clone https://bitbucket.org/traclabs/trac_ik.git -b rolling-devel &&\
cd trac_ik &&\
colcon build &&\
source install/setup.bash"

RUN bash -c "cd ${PROJECTS_DIR}/${ROS2_WORKSPACE}/src &&\
source /opt/ros/humble/setup.bash &&\
git clone https://github.com/icub-tech-iit/xcub-moveit2 &&\
cd .. &&\
colcon build &&\
source install/setup.bash"

ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
CMD ["bash"]

9 changes: 9 additions & 0 deletions deprecated_images/demos/moveit-gazebo/conf_build.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[sources]
START_IMG={{env.REGISTRY}}/{{env.REPOSITORY_NAME}}/{{env.IMAGE_PREFIX}}superbuild-ros2:{{steps.get_version.outputs.VERSION}}{{steps.get_version.outputs.TAG}}_sources
metadata={{steps.get_date.outputs.DATE_HOUR}}
release={{steps.get_version.outputs.VERSION}}
sbtag={{matrix.tag}}

[tag]
{{matrix.apps}}:{{steps.get_version.outputs.VERSION}}{{steps.get_version.outputs.TAG}}

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ARG START_IMG="none"
ARG PROJECTS_DIR=/projects
ARG INSTALL_DIR="/usr/local"
ARG INSTALL_DIR=/usr/local
ARG ROBOTOLOGY_INITIALIZATION_FILE=/usr/local/bin/setup_robotology_tdd.sh
ARG METADATA_FILE=/usr/local/bin/setup_metadata.sh
ARG GAZEBO_VER=11
ARG release="master"
ARG sbtag="Unstable"
ARG release="none"
ARG sbtag="none"
ARG metadata="none"

# Start from a ubuntu image plus mesa library recompiled with specific configuration
Expand All @@ -17,21 +17,22 @@ ENV DEBIAN_FRONTEND=noninteractive

# Some definitions
ARG CMAKE_GENERATOR="Unix Makefiles"
ARG SOURCES_BUILD_TYPE=RelWithDebInfo
ARG CMAKE_EXTRA_OPTIONS=-j2
# ARG SOURCES_BUILD_TYPE=RelWithDebInfo
ARG CMAKE_EXTRA_OPTIONS=-j4
ARG BUILD_TYPE=Release
# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared

# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
ARG GAZEBO_VER
ARG release
ARG sbtag
ARG PROJECTS_DIR
ARG INSTALL_DIR


# Create a new runtimeusers group
# Create a new runtimeusers group (why we are doing this)
RUN groupadd -K GID_MIN=100 -K GID_MAX=499 runtimeusers

# Install dependencies given in documentation in superbuild
# Install dependencies given in documentation in superbuild
RUN mkdir -p /etc/bash_completion.d/ && \
# apt-get update and apt-get install should always be in the same layer to prevent caching errors
apt-get update && \
Expand All @@ -47,24 +48,21 @@ RUN mkdir -p /etc/bash_completion.d/ && \
lsb-release \
vim

# Get gazebo from the osrf repo
RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" \
> /etc/apt/sources.list.d/gazebo-stable.list &&\
wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add - &&\
apt-get update &&\
apt install -y gazebo${GAZEBO_VER} libgazebo${GAZEBO_VER}-dev
# Get gazebo from apt
RUN apt-get update &&\
apt install -y gazebo libgazebo-dev libgazebo${GAZEBO_VER}

RUN mkdir ${PROJECTS_DIR} && cd ${PROJECTS_DIR} &&\
# Clone relevant repos
git clone https://github.com/robotology/robotology-superbuild.git &&\
git clone https://github.com/robotology/cer.git &&\
git clone https://github.com/robotology/cer-sim.git &&\
git clone https://github.com/robotology/navigation.git &&\
# git clone https://github.com/robotology/cer.git &&\
# git clone https://github.com/robotology/cer-sim.git &&\
# git clone https://github.com/robotology/navigation.git &&\
git clone https://github.com/icub-tech-iit/appsAway.git &&\
git clone https://github.com/robotology/icub-models.git --depth 1 --branch devel &&\
# git clone https://github.com/robotology/icub-models.git --depth 1 --branch devel &&\
chmod -R g+rw ${PROJECTS_DIR}

# Build robotology-superbuild
# Build robotology-superbuild
RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\
git checkout ${release} &&\
# Add no-install-recommends to robotology libraries
Expand All @@ -88,7 +86,7 @@ RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\
# Remove build directory
rm -rf /projects/robotology-superbuild/build/src

# Build checkRobotInterface
# Build checkRobotInterface
RUN cd ${PROJECTS_DIR}/appsAway/modules/checkRobotInterface && \
mkdir build && cd build && \
cmake .. \
Expand All @@ -100,44 +98,44 @@ RUN cd ${PROJECTS_DIR}/appsAway/modules/checkRobotInterface && \
# Remove build directory
rm -rf ${PROJECTS_DIR}/appsAway/modules/checkRobotInterface/build

# Build icub-models
RUN cd ${PROJECTS_DIR}/icub-models && mkdir build && cd build && \
cmake .. \
-DCMAKE_BUILD_TYPE=${SOURCES_BUILD_TYPE} && \
make install && \
# Remove build directory
rm -rf ${PROJECTS_DIR}/icub-models/build

# Build CER
RUN cd ${PROJECTS_DIR}/cer && \
git checkout devel &&\
mkdir build && cd build &&\
cmake .. \
-G "$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-D ENABLE_cermod_cerDoubleLidar=ON \
-DENABLE_faceExpressionImage=ON \
-DGAZEBO_TRIPOD_PLUGIN=ON && \
cmake --build . -- ${CMAKE_EXTRA_OPTIONS}
# Remove build directory
# rm -rf ${PROJECTS_DIR}/cer/build
# # Build icub-models
# RUN cd ${PROJECTS_DIR}/icub-models && mkdir build && cd build && \
# cmake .. \
# -DCMAKE_BUILD_TYPE=${SOURCES_BUILD_TYPE} && \
# make install && \
# # Remove build directory
# rm -rf ${PROJECTS_DIR}/icub-models/build

# # Build CER
# RUN cd ${PROJECTS_DIR}/cer && \
# git checkout devel &&\
# mkdir build && cd build &&\
# cmake .. \
# -G "$CMAKE_GENERATOR" \
# -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
# -D ENABLE_cermod_cerDoubleLidar=ON \
# -DENABLE_faceExpressionImage=ON \
# -DGAZEBO_TRIPOD_PLUGIN=ON && \
# cmake --build . -- ${CMAKE_EXTRA_OPTIONS}
# # Remove build directory
# # rm -rf ${PROJECTS_DIR}/cer/build

# Build Navigation
RUN cd ${PROJECTS_DIR}/navigation && \
mkdir build && cd build &&\
cmake .. \
-G "$CMAKE_GENERATOR" \
&&\
cmake --build . -- ${CMAKE_EXTRA_OPTIONS} &&\
make install && \
rm -rf ${PROJECTS_DIR}/navigation/build

# Using Multi-Stage Builds
# We use a middle stage because several COPY commands with hardlinks and softlinks generate duplication
# # Build Navigation
# RUN cd ${PROJECTS_DIR}/navigation && \
# mkdir build && cd build &&\
# cmake .. \
# -G "$CMAKE_GENERATOR" \
# &&\
# cmake --build . -- ${CMAKE_EXTRA_OPTIONS} &&\
# make install && \
# rm -rf ${PROJECTS_DIR}/navigation/build

# Using Multi-Stage Builds
# We use a middle stage because several COPY commands with hardlinks and softlinks generate duplication
FROM $START_IMG as middlestage


# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
ARG PROJECTS_DIR
ARG ROBOTOLOGY_INITIALIZATION_FILE
ARG INSTALL_DIR
Expand All @@ -163,13 +161,12 @@ RUN echo "source ${INSTALL_DIR}/share/robotology-superbuild/setup.sh" >> $ROBOTO

FROM scratch

# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
# Variables defined before the first FROM can be accessed in all stages but they need to be re-declared
ARG PROJECTS_DIR
ARG INSTALL_DIR
ARG GAZEBO_VER
ARG ROBOTOLOGY_INITIALIZATION_FILE
ARG release
ARG sbtag
ARG ROBOTOLOGY_INITIALIZATION_FILE
ARG metadata

COPY --from=middlestage / /
Expand All @@ -181,7 +178,7 @@ ENV GAZEBO_MODEL_PATH=/usr/local/share/gazebo/models:/usr/local/share/iCub/robot
ENV GAZEBO_MODEL_DATABASE_URI=http://gazebosim.org/models
ENV GAZEBO_RESOURCE_PATH=/usr/local/share/gazebo/worlds
ENV GAZEBO_MASTER_URI=http://localhost:11345
ENV YARP_DATA_DIRS=${PROJECTS_DIR}/cer/build/share/CER:${PROJECTS_DIR}/cer/build/share/CER/robots/CER01:/usr/local/share/navigation
# ENV YARP_DATA_DIRS=${PROJECTS_DIR}/cer/build/share/CER:${PROJECTS_DIR}/cer/build/share/CER/robots/CER01:/usr/local/share/navigation
ENV QT_X11_NO_MITSHM=1
ENV YARP_COLORED_OUTPUT=1
ENV img_metadata=${metadata}
Expand All @@ -190,6 +187,4 @@ EXPOSE 10000/tcp 10000/udp

ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]

CMD ["bash"]


CMD ["bash"]
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ ENV YARP_ROBOT_NAME="iCubGazeboV2_5"
ENV QT_X11_NO_MITSHM=1
ENV YARP_COLORED_OUTPUT=1

CMD ["bash"]
CMD ["bash"]
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[sources]
START_IMG=ubuntu:focal
$(cat DATE_TAG)
START_IMG=ubuntu:jammy
metadata={{steps.get_date.outputs.DATE_HOUR}}
release={{steps.get_version.outputs.VERSION}}
sbtag={{matrix.tag}}

[binaries]
SOURCE_IMG={{env.DEFAULT_USER}}/{{matrix.apps}}:{{steps.get_version.outputs.VERSION}}{{steps.get_version.outputs.TAG}}_sources
START_IMG=ubuntu:focal
START_IMG=ubuntu:jammy

[tag]
{{matrix.apps}}:{{steps.get_version.outputs.VERSION}}{{steps.get_version.outputs.TAG}}


[superbuild]
[superbuild]
15 changes: 15 additions & 0 deletions deprecated_images/superbuild-gazebo/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

if [ -z "$(which setup_robotology_tdd.sh)" ] ; then
echo "File setup_robotology_tdd.sh not found."
exit 1
fi

source setup_robotology_tdd.sh

echo "[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion" >> /root/.bashrc
echo "[ -r /usr/local/bin/setup_robotology_tdd.sh ] && . /usr/local/bin/setup_robotology_tdd.sh" >> /root/.bashrc

# If a CMD is passed, execute it
exec "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG SOURCE_IMG="none"

ARG HOME_DIR=/home/icub
ARG PROJECTS_DIR=${HOME_DIR}/projects
ARG INSTALL_DIR=${HOME_DIR}/install_dir
ARG INSTALL_DIR=${PROJECTS_DIR}/robotology-superbuild/build/install
ARG release="master"
ARG sbtag="Stable"
ARG metadata="data"
Expand All @@ -14,7 +14,7 @@ ARG ROBOTOLOGY_INITIALIZATION_FILE=/usr/local/bin/setup_robotology_tdd.sh
# Define default user
ARG USERNAME=icub

FROM $SOURCE_IMG as superbuild_builder
FROM $SOURCE_IMG AS superbuild_builder

LABEL maintainer="[email protected], [email protected]"

Expand Down Expand Up @@ -48,6 +48,7 @@ RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\
cd build &&\
cmake .. \
-G "$CMAKE_GENERATOR" \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DNON_INTERACTIVE_BUILD:BOOL=ON \
-DROBOTOLOGY_ENABLE_CORE:BOOL=ON \
Expand All @@ -57,11 +58,9 @@ RUN cd ${PROJECTS_DIR}/robotology-superbuild &&\
-DYCM_USE_DEPRECATED:BOOL=OFF \
-DROBOTOLOGY_USES_GAZEBO=OFF \
-DROBOTOLOGY_PROJECT_TAGS=${sbtag} \
-DYCM_EP_INSTALL_DIR=${INSTALL_DIR} \
-DENABLE_yarpmod_grabber:BOOL=ON \
-DYCM_USE_CMAKE_PROPOSED=ON \
&&\
# Build all the projects
cmake --build . --target update-all -- ${CMAKE_EXTRA_OPTIONS} &&\
cmake --build . -- ${CMAKE_EXTRA_OPTIONS}

FROM scratch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[sources]
SOURCE_IMG={{env.REGISTRY}}/{{env.REPOSITORY_NAME}}/{{env.IMAGE_PREFIX}}superbuild-icubhead-withuser:{{steps.get_version.outputs.VERSION}}{{steps.get_version.outputs.TAG}}_sources
metadata=$(cat DATE_TAG)
metadata={{steps.get_date.outputs.DATE_HOUR}}
release={{steps.get_version.outputs.VERSION}}
sbtag={{matrix.tag}}

Expand Down
Loading