From 91800969418776d3732d037685e2e0f0d16bef1a Mon Sep 17 00:00:00 2001 From: Ettore Landini Date: Mon, 8 Jan 2024 14:30:25 +0100 Subject: [PATCH] Yarp dependencies fixed - Yarp branch as Dockerfile arg Following the imminent deprecation of the old http://www.icub.org/ubuntu repository the yarp are now explicitly installed during docker images building. Also, it's now possible to set the yarp branch to use while building the aforementioned images --- docker_stuff/docker_mng_vars.sh | 1 + docker_stuff/docker_openPose/Dockerfile | 15 ++++++++---- docker_stuff/docker_sim2/Dockerfile | 16 +++++++++---- docker_stuff/docker_sim2/manage-docker.sh | 23 +++++++++++++++++-- docker_stuff/docker_tourCore2/Dockerfile | 14 +++++++---- .../docker_tourCore2/manage-docker.sh | 22 ++++++++++++++++-- 6 files changed, 73 insertions(+), 18 deletions(-) diff --git a/docker_stuff/docker_mng_vars.sh b/docker_stuff/docker_mng_vars.sh index f3e6219..dbfc77f 100644 --- a/docker_stuff/docker_mng_vars.sh +++ b/docker_stuff/docker_mng_vars.sh @@ -1,6 +1,7 @@ UBUNTU_DEF="ubuntu:22.04" CUDA_DEF="nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04" ROS_DEF="iron" +YARP_DEF="master" CUDA_SUFFIX="cuda.11.7.1-cudnn8" UBUNTU_SUFFIX="ubuntu22.04" DEVEL_SUFFIX="devel" diff --git a/docker_stuff/docker_openPose/Dockerfile b/docker_stuff/docker_openPose/Dockerfile index 545af0c..25cf757 100644 --- a/docker_stuff/docker_openPose/Dockerfile +++ b/docker_stuff/docker_openPose/Dockerfile @@ -24,9 +24,14 @@ RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 ENV LANG=en_US.UTF-8 # Install yarp dependencies -RUN echo "deb http://www.icub.org/ubuntu `lsb_release -cs` contrib/science" > /etc/apt/sources.list.d/icub.list -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 57A5ACB6110576A6 -RUN apt-get update && apt-get install -y icub-common libopencv-dev && sudo rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y libode8 libace-dev libboost-filesystem-dev libboost-system-dev \ + libboost-thread-dev libc6 python3 libgsl0-dev libncurses5-dev libsdl1.2-dev subversion git gfortran \ + libxmu-dev libode-dev wget unzip qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5svg5 \ + libqt5opengl5-dev libopencv-dev freeglut3-dev libtinyxml-dev libblas-dev coinor-libipopt-dev \ + liblapack-dev libmumps-dev qml-module-qtmultimedia qml-module-qtquick-dialogs qml-module-qtquick-controls \ + qml-module-qt-labs-settings libqcustomplot-dev qml-module-qt-labs-folderlistmodel libedit-dev \ + libeigen3-dev libjpeg-dev libsimbody-dev libxml2-dev libjs-underscore portaudio19-dev libgtkmm-2.4-dev \ + libi2c-dev libv4l-dev # Create user: user1 USER root @@ -53,7 +58,7 @@ RUN git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose && \ RUN cd $user1_home/openpose && \ mkdir build && \ cd ./build && \ - # Right now the following does not work. + # Right now the following does not work. # https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/2233 # You have to download the weights manually # cmake .. -DDOWNLOAD_HAND_MODEL=OFF -DUSE_CUDNN=OFF && \ @@ -75,7 +80,7 @@ ENV YCM_DIR=/home/user1/robotology/ycm/build # Build YARP USER $robotology_install_user WORKDIR $robotology_install_folder -RUN git clone https://github.com/robotology/yarp.git -b master +RUN git clone https://github.com/robotology/yarp.git -b yarp-3.9 RUN cd yarp && mkdir build && cd build && \ cmake .. \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/docker_stuff/docker_sim2/Dockerfile b/docker_stuff/docker_sim2/Dockerfile index 753fb30..66b4e01 100644 --- a/docker_stuff/docker_sim2/Dockerfile +++ b/docker_stuff/docker_sim2/Dockerfile @@ -3,13 +3,14 @@ FROM $base_img LABEL maintainer="Ettore Landini" ARG ros_distro +ARG yarp_branch="master" # Non-interactive installation mode ENV DEBIAN_FRONTEND=noninteractive ENV DOCKER_UPDATED_ON=28_09_2022 # Install essentials -RUN apt-get update && apt-get install -y apt-utils software-properties-common sudo psmisc lsb-release \ +RUN apt-get update && apt-get install -y apt software-properties-common sudo psmisc lsb-release \ tmux nano geany vim wget curl build-essential git gitk cmake cmake-curses-gui autoconf xserver-xorg-video-dummy xserver-xorg-legacy \ net-tools terminator libjpeg-dev ffmpeg apt-transport-https ca-certificates gnupg libace-dev ycm-cmake-modules locales \ python3-setuptools python3-pip iproute2 python3-tornado swig lsof iftop iputils-ping gdb bash-completion btop mlocate && rm -rf /var/lib/apt/lists/* @@ -33,9 +34,14 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y ros-$ros_distro-d python3-pytest-rerunfailures python3-rosdep python3-vcstool && rosdep init && rm -rf /var/lib/apt/lists/* # Install yarp dependencies -RUN echo "deb http://www.icub.org/ubuntu `lsb_release -cs` contrib/science" > /etc/apt/sources.list.d/icub.list -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 57A5ACB6110576A6 -RUN apt-get update && apt-get install -y icub-common libopencv-dev && sudo rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y libode8 libace-dev libboost-filesystem-dev libboost-system-dev \ + libboost-thread-dev libc6 python3 libgsl0-dev libncurses5-dev libsdl1.2-dev subversion git gfortran \ + libxmu-dev libode-dev wget unzip qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5svg5 \ + libqt5opengl5-dev libopencv-dev freeglut3-dev libtinyxml-dev libblas-dev coinor-libipopt-dev \ + liblapack-dev libmumps-dev qml-module-qtmultimedia qml-module-qtquick-dialogs qml-module-qtquick-controls \ + qml-module-qt-labs-settings libqcustomplot-dev qml-module-qt-labs-folderlistmodel libedit-dev \ + libeigen3-dev libjpeg-dev libsimbody-dev libxml2-dev libjs-underscore portaudio19-dev libgtkmm-2.4-dev \ + libi2c-dev libv4l-dev # Create user: user1 USER root @@ -70,7 +76,7 @@ ENV YCM_DIR=/home/user1/robotology/ycm/build # Build YARP USER $robotology_install_user WORKDIR $robotology_install_folder -RUN git clone https://github.com/robotology/yarp.git -b master +RUN git clone https://github.com/robotology/yarp.git -b $yarp_branch RUN cd yarp && mkdir build && cd build && \ cmake .. \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/docker_stuff/docker_sim2/manage-docker.sh b/docker_stuff/docker_sim2/manage-docker.sh index 6a3c44d..52a1246 100755 --- a/docker_stuff/docker_sim2/manage-docker.sh +++ b/docker_stuff/docker_sim2/manage-docker.sh @@ -15,6 +15,8 @@ usage() echo " -d, --devel Build/run the image with the '$DEVEL_SUFFIX' tag" echo " -e, --repo + \"repo_name\" Build/run the image with the passed repository reference" echo " -r, --ros_distro + \"distro_name\" Build/run the image with the passed distro (the passed value will be also used to compose the image tag)" + echo " -y, --yarp_branch + \"yarp branch\" Build/run the image with the passed yarp branch (the passed value, if different from \"master\", will be also used to compose the image tag)." + echo " If not passed, the branch used will be \"master\"" echo " -h, --help See current help" echo "If the parent image is not specified (neither -u nor -c), the '$UBUNTU_DEF' one will be used" echo "If the build type is not specified (neither -d nor -s), the '$DEVEL_SUFFIX' tag will be used" @@ -86,6 +88,16 @@ get_opts() ROS_SET=true shift ;; + -y|--yarp_vers) + if [[ $YARP_SET == "true" ]]; then + echo "YARP branch already set already set" + usage + fi + shift + YARP_BRANCH=$1 + YARP_SET=true + shift + ;; -e|--repository) if [[ $REPO_SET == "true" ]]; then echo "Remote repository already set" @@ -132,12 +144,14 @@ BASE_TAG_DEF="tourSim2" BUILD_SUFFIX=$DEVEL_SUFFIX VERSION="1.0.0" ROS_DISTRO=$ROS_DEF +YARP_BRANCH=$YARP_DEF PARENT_SUFFIX=$UBUNTU_SUFFIX IMAGE_SET=false BUILD_SET=false GONNA_BUILD=false RUN_WITH_GPU=true ROS_SET=false +YARP_SET=false IMAGE=$UBUNTU_DEF REPO=$REPO_DEF REPO_SET=false @@ -149,10 +163,15 @@ BASE_TAG=$BASE_TAG_DEF # Get the options get_opts $@ -COMPLETE_IMAGE_NAME=$REPO$REPO_SEP$BASE_TAG$JUNCTION$PARENT_SUFFIX$JUNCTION$ROS_DISTRO$JUNCTION$BUILD_SUFFIX +if [[ $YARP_BRANCH != "master" ]]; then + YARP_TAG=$YARP_BRANCH$JUNCTION +fi +COMPLETE_IMAGE_NAME=$REPO$REPO_SEP$BASE_TAG$JUNCTION$PARENT_SUFFIX$JUNCTION$ROS_DISTRO$JUNCTION$YARP_TAG$BUILD_SUFFIX + +echo $COMPLETE_IMAGE_NAME if [[ $GONNA_BUILD == "true" ]]; then - sudo docker build --build-arg base_img=$IMAGE --build-arg ros_distro=$ROS_DISTRO -t $COMPLETE_IMAGE_NAME . + sudo docker build --build-arg base_img=$IMAGE --build-arg ros_distro=$ROS_DISTRO --build-arg yarp_branch=$YARP_BRANCH -t $COMPLETE_IMAGE_NAME . else sudo xhost + if [[ $RUN_WITH_GPU == "true" ]]; then diff --git a/docker_stuff/docker_tourCore2/Dockerfile b/docker_stuff/docker_tourCore2/Dockerfile index 24ec040..b026c04 100644 --- a/docker_stuff/docker_tourCore2/Dockerfile +++ b/docker_stuff/docker_tourCore2/Dockerfile @@ -3,6 +3,7 @@ FROM $base_img LABEL maintainer="Ettore Landini" ARG ros_distro +ARG yarp_branch="master" # Non-interactive installation mode ENV DEBIAN_FRONTEND=noninteractive @@ -33,9 +34,14 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y ros-$ros_distro-d python3-pytest-rerunfailures python3-rosdep python3-vcstool && rosdep init && rm -rf /var/lib/apt/lists/* # Install yarp dependencies -RUN echo "deb http://www.icub.org/ubuntu `lsb_release -cs` contrib/science" > /etc/apt/sources.list.d/icub.list -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 57A5ACB6110576A6 -RUN apt-get update && apt-get install -y icub-common libopencv-dev && sudo rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y libode8 libace-dev libboost-filesystem-dev libboost-system-dev \ + libboost-thread-dev libc6 python3 libgsl0-dev libncurses5-dev libsdl1.2-dev subversion git gfortran \ + libxmu-dev libode-dev wget unzip qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5svg5 \ + libqt5opengl5-dev libopencv-dev freeglut3-dev libtinyxml-dev libblas-dev coinor-libipopt-dev \ + liblapack-dev libmumps-dev qml-module-qtmultimedia qml-module-qtquick-dialogs qml-module-qtquick-controls \ + qml-module-qt-labs-settings libqcustomplot-dev qml-module-qt-labs-folderlistmodel libedit-dev \ + libeigen3-dev libjpeg-dev libsimbody-dev libxml2-dev libjs-underscore portaudio19-dev libgtkmm-2.4-dev \ + libi2c-dev libv4l-dev # Create user: user1 USER root @@ -67,7 +73,7 @@ ENV YCM_DIR=/home/user1/robotology/ycm/build # Build YARP USER $robotology_install_user WORKDIR $robotology_install_folder -RUN git clone https://github.com/robotology/yarp.git -b master +RUN git clone https://github.com/robotology/yarp.git -b ${yarp_branch} RUN cd yarp && mkdir build && cd build && \ cmake .. \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/docker_stuff/docker_tourCore2/manage-docker.sh b/docker_stuff/docker_tourCore2/manage-docker.sh index 7a78ff2..7a905d4 100755 --- a/docker_stuff/docker_tourCore2/manage-docker.sh +++ b/docker_stuff/docker_tourCore2/manage-docker.sh @@ -15,6 +15,8 @@ usage() echo " -d, --devel Build/run the image with the '$DEVEL_SUFFIX' tag" echo " -e, --repo + \"repo_name\" Build/run the image with the passed repository reference" echo " -r, --ros_distro + \"distro_name\" Build/run the image with the passed distro (the passed value will be also used to compose the image tag)" + echo " -y, --yarp_branch + \"yarp branch\" Build/run the image with the passed yarp branch (the passed value, if different from \"master\", will be also used to compose the image tag)." + echo " If not passed, the branch used will be \"master\"" echo " -h, --help See current help" echo "If the parent image is not specified (neither -u nor -c), the '$UBUNTU_DEF' one will be used" echo "If the build type is not specified (neither -d nor -s), the '$DEVEL_SUFFIX' tag will be used" @@ -86,6 +88,16 @@ get_opts() ROS_SET=true shift ;; + -y|--yarp_vers) + if [[ $YARP_SET == "true" ]]; then + echo "YARP branch already set already set" + usage + fi + shift + YARP_BRANCH=$1 + YARP_SET=true + shift + ;; -e|--repository) if [[ $REPO_SET == "true" ]]; then echo "Remote repository already set" @@ -132,12 +144,15 @@ BASE_TAG_DEF="tourCore2" BUILD_SUFFIX=$DEVEL_SUFFIX VERSION="1.0.0" ROS_DISTRO=$ROS_DEF +YARP_BRANCH=$YARP_DEF +YARP_TAG="" PARENT_SUFFIX=$UBUNTU_SUFFIX IMAGE_SET=false BUILD_SET=false GONNA_BUILD=false RUN_WITH_GPU=true ROS_SET=false +YARP_SET=false IMAGE=$UBUNTU_DEF REPO=$REPO_DEF REPO_SET=false @@ -149,10 +164,13 @@ BASE_TAG=$BASE_TAG_DEF # Get the options get_opts $@ -COMPLETE_IMAGE_NAME=$REPO$REPO_SEP$BASE_TAG$JUNCTION$PARENT_SUFFIX$JUNCTION$ROS_DISTRO$JUNCTION$BUILD_SUFFIX +if [[ $YARP_BRANCH != "master" ]]; then + YARP_TAG=$YARP_BRANCH$JUNCTION +fi +COMPLETE_IMAGE_NAME=$REPO$REPO_SEP$BASE_TAG$JUNCTION$PARENT_SUFFIX$JUNCTION$ROS_DISTRO$JUNCTION$YARP_TAG$BUILD_SUFFIX if [[ $GONNA_BUILD == "true" ]]; then - sudo docker build --build-arg base_img=$IMAGE --build-arg ros_distro=$ROS_DISTRO -t $COMPLETE_IMAGE_NAME . + sudo docker build --build-arg base_img=$IMAGE --build-arg ros_distro=$ROS_DISTRO --build-arg yarp_branch=$YARP_BRANCH -t $COMPLETE_IMAGE_NAME . else sudo xhost + if [[ $RUN_WITH_GPU == "true" ]]; then