From a424eab1f5905ce5dd3cb28c83a483e24087abff Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:04:41 +0200 Subject: [PATCH 1/5] refactor: remove deprecated Dockerfiles (#99) --- build-local.sh | 52 ----------------- ros2_control_libraries/Dockerfile | 45 --------------- ros2_control_libraries/build.sh | 70 ----------------------- ros2_modulo_control/Dockerfile | 17 ------ ros2_modulo_control/build.sh | 60 -------------------- ros_control_libraries/Dockerfile | 35 ------------ ros_control_libraries/build.sh | 60 -------------------- ros_ws/.gitignore | 1 - ros_ws/Dockerfile | 92 ------------------------------- ros_ws/build.sh | 46 ---------------- 10 files changed, 478 deletions(-) delete mode 100755 build-local.sh delete mode 100644 ros2_control_libraries/Dockerfile delete mode 100755 ros2_control_libraries/build.sh delete mode 100644 ros2_modulo_control/Dockerfile delete mode 100755 ros2_modulo_control/build.sh delete mode 100644 ros_control_libraries/Dockerfile delete mode 100755 ros_control_libraries/build.sh delete mode 100644 ros_ws/.gitignore delete mode 100644 ros_ws/Dockerfile delete mode 100755 ros_ws/build.sh diff --git a/build-local.sh b/build-local.sh deleted file mode 100755 index 691ef31..0000000 --- a/build-local.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -CURRENT_DIR="$(pwd)" - -BASE_TAG=humble -OUTPUT_TAG=humble-devel -CL_BRANCH=develop -MODULO_BRANCH=develop - -BUILD_FLAGS=() -while [ "$#" -gt 0 ]; do - case "$1" in - --base-tag) - BASE_TAG=$2 - shift 2 - ;; - --output-tag) - OUTPUT_TAG=$2 - shift 2 - ;; - --cl-branch) - CL_BRANCH=$2 - shift 2 - ;; - --modulo-branch) - MODULO_BRANCH=$2 - shift 2 - ;; - -*) - BUILD_FLAGS+=($1) - shift 1 - ;; - *) - echo "Unknown option: $1" >&2 - exit 1 - ;; - esac -done - -cd "${SCRIPT_DIR}"/ros2_ws && bash ./build.sh --base-tag "${BASE_TAG}" "${BUILD_FLAGS[@]}" || exit 1 - -cd "${SCRIPT_DIR}"/ros2_control && bash ./build.sh --local-base \ - --base-tag "${BASE_TAG}" --output-tag "${BASE_TAG}" "${BUILD_FLAGS[@]}" || exit 1 - -cd "${SCRIPT_DIR}"/ros2_control_libraries && bash ./build.sh --local-base --cl-branch "${CL_BRANCH}" \ - --base-tag "${BASE_TAG}" --output-tag "${OUTPUT_TAG}" "${BUILD_FLAGS[@]}" || exit 1 - -cd "${SCRIPT_DIR}"/ros2_modulo_control && bash ./build.sh --local-base --modulo-branch "${MODULO_BRANCH}" \ - --base-tag "${OUTPUT_TAG}" --output-tag "${OUTPUT_TAG}" "${BUILD_FLAGS[@]}" || exit 1 - -cd "${CURRENT_DIR}" diff --git a/ros2_control_libraries/Dockerfile b/ros2_control_libraries/Dockerfile deleted file mode 100644 index 6a69dc3..0000000 --- a/ros2_control_libraries/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/aica-technology/ros2-control -ARG BASE_TAG=humble -ARG UBUNTU_VERSION=jammy-jellyfish -FROM ${BASE_IMAGE}:${BASE_TAG} as jammy-jellyfish - -# install development dependencies and copy licenses -COPY --from=ghcr.io/aica-technology/control-libraries/development-dependencies:22.04 /usr/local /tmp/local -RUN sudo cp -R /tmp/local/* /usr/local && sudo rm -r /tmp/local -COPY --from=ghcr.io/aica-technology/control-libraries/development-dependencies:22.04 \ - /usr/share/doc/control-libraries/licenses /usr/share/doc/control-libraries/licenses - - -FROM ${BASE_IMAGE}:${BASE_TAG} as focal-fossa - -# install development dependencies and copy licenses -COPY --from=ghcr.io/aica-technology/control-libraries/development-dependencies:20.04 /usr/local /tmp/local -RUN sudo cp -R /tmp/local/* /usr/local && sudo rm -r /tmp/local -COPY --from=ghcr.io/aica-technology/control-libraries/development-dependencies:20.04 \ - /usr/share/doc/control-libraries/licenses /usr/share/doc/control-libraries/licenses - - -FROM ${UBUNTU_VERSION} as control-libraries-build -WORKDIR /tmp - -RUN sudo ldconfig - -ARG CL_BRANCH=main -RUN git clone -b ${CL_BRANCH} --depth 1 https://github.com/aica-technology/control-libraries.git - -# install source -RUN sudo ./control-libraries/source/install.sh -y - -# install protocol -RUN sudo ./control-libraries/protocol/install.sh -y - -# install python bindings -RUN sudo pip3 install ./control-libraries/python - -# clean image -RUN sudo rm -rf /tmp/* && sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* - -FROM ${BASE_IMAGE}:${BASE_TAG} as final -RUN sudo rm -rf /usr/include/eigen3 -COPY --from=control-libraries-build /usr/ /usr/ -RUN sudo ldconfig \ No newline at end of file diff --git a/ros2_control_libraries/build.sh b/ros2_control_libraries/build.sh deleted file mode 100755 index c4390ec..0000000 --- a/ros2_control_libraries/build.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -IMAGE_NAME=aica-technology/ros2-control-libraries - -LOCAL_BASE_IMAGE=false -BASE_IMAGE=ghcr.io/aica-technology/ros2-control -BASE_TAG=humble -OUTPUT_TAG="" -CL_BRANCH=main - -BUILD_FLAGS=() -while [ "$#" -gt 0 ]; do - case "$1" in - --local-base) - LOCAL_BASE_IMAGE=true - shift 1 - ;; - --base-tag) - BASE_TAG=$2 - shift 2 - ;; - --cl-branch) - CL_BRANCH=$2 - shift 2 - ;; - --output-tag) - OUTPUT_TAG=$2 - shift 2 - ;; - -r | --rebuild) - BUILD_FLAGS+=(--no-cache) - shift 1 - ;; - -v | --verbose) - BUILD_FLAGS+=(--progress=plain) - shift 1 - ;; - *) - echo "Unknown option: $1" >&2 - exit 1 - ;; - esac -done - -if [ -z "${OUTPUT_TAG}" ]; then - echo "Output tag is empty, using the base tag as output tag." - OUTPUT_TAG="${BASE_TAG}" -fi - -if [ "${LOCAL_BASE_IMAGE}" == true ]; then - BUILD_FLAGS+=(--build-arg BASE_IMAGE=aica-technology/ros2-control) -else - docker pull "${BASE_IMAGE}:${BASE_TAG}" -fi - -if [[ "${BASE_TAG}" == *"galactic"* ]]; then - UBUNTU_VERSION=focal-fossa -elif [[ "${BASE_TAG}" == *"humble"* || "${BASE_TAG}" == *"iron"* ]]; then - UBUNTU_VERSION=jammy-jellyfish -else - echo "Invalid base tag. Base tag needs to contain either 'galactic', 'humble' or 'iron'." - exit 1 -fi - -BUILD_FLAGS+=(--build-arg BASE_TAG="${BASE_TAG}") -BUILD_FLAGS+=(--build-arg UBUNTU_VERSION="${UBUNTU_VERSION}") -BUILD_FLAGS+=(--build-arg CL_BRANCH="${CL_BRANCH}") -BUILD_FLAGS+=(-t "${IMAGE_NAME}:${OUTPUT_TAG}") - -DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . diff --git a/ros2_modulo_control/Dockerfile b/ros2_modulo_control/Dockerfile deleted file mode 100644 index 2c80935..0000000 --- a/ros2_modulo_control/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/aica-technology/ros2-control-libraries -ARG BASE_TAG=humble -FROM ${BASE_IMAGE}:${BASE_TAG} as modulo-build - -ARG MODULO_BRANCH=main -WORKDIR /tmp -RUN git clone -b ${MODULO_BRANCH} --depth 1 https://github.com/aica-technology/modulo.git - -# copy sources and build ROS workspace with user permissions -RUN cp -r /tmp/modulo/source ${ROS2_WORKSPACE}/src/modulo - -WORKDIR ${ROS2_WORKSPACE} -RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build" -RUN sudo rm -rf /tmp/* ./src - -FROM ${BASE_IMAGE}:${BASE_TAG} as final -COPY --from=modulo-build ${ROS2_WORKSPACE} ${ROS2_WORKSPACE} \ No newline at end of file diff --git a/ros2_modulo_control/build.sh b/ros2_modulo_control/build.sh deleted file mode 100755 index db3e95f..0000000 --- a/ros2_modulo_control/build.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -IMAGE_NAME=aica-technology/ros2-modulo-control - -LOCAL_BASE_IMAGE=false -BASE_IMAGE=ghcr.io/aica-technology/ros2-control-libraries -BASE_TAG=humble -OUTPUT_TAG="" -MODULO_BRANCH=main - -BUILD_FLAGS=() -while [ "$#" -gt 0 ]; do - case "$1" in - --local-base) - LOCAL_BASE_IMAGE=true - shift 1 - ;; - --base-tag) - BASE_TAG=$2 - shift 2 - ;; - --modulo-branch) - MODULO_BRANCH=$2 - shift 2 - ;; - --output-tag) - OUTPUT_TAG=$2 - shift 2 - ;; - -r | --rebuild) - BUILD_FLAGS+=(--no-cache) - shift 1 - ;; - -v | --verbose) - BUILD_FLAGS+=(--progress=plain) - shift 1 - ;; - *) - echo "Unknown option: $1" >&2 - exit 1 - ;; - esac -done - -if [ -z "${OUTPUT_TAG}" ]; then - echo "Output tag is empty, using the base tag as output tag." - OUTPUT_TAG="${BASE_TAG}" -fi - -if [ "${LOCAL_BASE_IMAGE}" = true ]; then - BUILD_FLAGS+=(--build-arg BASE_IMAGE=aica-technology/ros2-control-libraries) -else - docker pull "${BASE_IMAGE}:${BASE_TAG}" -fi - -BUILD_FLAGS+=(--build-arg BASE_TAG="${BASE_TAG}") -BUILD_FLAGS+=(--build-arg MODULO_BRANCH="${MODULO_BRANCH}") -BUILD_FLAGS+=(-t "${IMAGE_NAME}:${OUTPUT_TAG}") - -DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . diff --git a/ros_control_libraries/Dockerfile b/ros_control_libraries/Dockerfile deleted file mode 100644 index 50ee4b6..0000000 --- a/ros_control_libraries/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/aica-technology/ros-ws -ARG BASE_TAG=noetic -FROM ${BASE_IMAGE}:${BASE_TAG} as focal-fossa - -# install development dependencies and copy licenses -COPY --from=ghcr.io/aica-technology/control-libraries/development-dependencies:20.04 /usr/local /tmp/local -RUN sudo cp -R /tmp/local/* /usr/local && sudo rm -r /tmp/local -COPY --from=ghcr.io/aica-technology/control-libraries/development-dependencies:20.04 \ - /usr/share/doc/control-libraries/licenses /usr/share/doc/control-libraries/licenses - - -FROM focal-fossa as control-libraries-build -WORKDIR ${HOME} - -RUN sudo ldconfig - -ARG CL_BRANCH=main -RUN git clone -b ${CL_BRANCH} --depth 1 https://github.com/aica-technology/control-libraries.git - -# install source -RUN sudo ./control-libraries/source/install.sh -y - -# install protocol -RUN sudo ./control-libraries/protocol/install.sh -y - -# install python bindings -RUN sudo pip3 install ./control-libraries/python - -# clean image -RUN sudo rm -rf ./control-libraries && sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* - -FROM ${BASE_IMAGE}:${BASE_TAG} as final -RUN sudo rm -rf /usr/include/eigen3 -COPY --from=control-libraries-build /usr/ /usr/ -RUN sudo ldconfig \ No newline at end of file diff --git a/ros_control_libraries/build.sh b/ros_control_libraries/build.sh deleted file mode 100755 index 0877951..0000000 --- a/ros_control_libraries/build.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -IMAGE_NAME=aica-technology/ros-control-libraries - -LOCAL_BASE_IMAGE=false -BASE_IMAGE=ghcr.io/aica-technology/ros-ws -BASE_TAG=noetic -OUTPUT_TAG="" -CL_BRANCH=main - -BUILD_FLAGS=() -while [ "$#" -gt 0 ]; do - case "$1" in - --local-base) - LOCAL_BASE_IMAGE=true - shift 1 - ;; - --base-tag) - BASE_TAG=$2 - shift 2 - ;; - --cl-branch) - CL_BRANCH=$2 - shift 2 - ;; - --output-tag) - OUTPUT_TAG=$2 - shift 2 - ;; - -r | --rebuild) - BUILD_FLAGS+=(--no-cache) - shift 1 - ;; - -v | --verbose) - BUILD_FLAGS+=(--progress=plain) - shift 1 - ;; - *) - echo "Unknown option: $1" >&2 - exit 1 - ;; - esac -done - -if [ -z "${OUTPUT_TAG}" ]; then - echo "Output tag is empty, using the base tag as output tag." - OUTPUT_TAG="${BASE_TAG}" -fi - -if [ "${LOCAL_BASE_IMAGE}" == true ]; then - BUILD_FLAGS+=(--build-arg BASE_IMAGE=aica-technology/ros-ws) -else - docker pull "${BASE_IMAGE}:${BASE_TAG}" -fi - -BUILD_FLAGS+=(--build-arg BASE_TAG="${BASE_TAG}") -BUILD_FLAGS+=(--build-arg CL_BRANCH="${CL_BRANCH}") -BUILD_FLAGS+=(-t "${IMAGE_NAME}:${OUTPUT_TAG}") - -DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . diff --git a/ros_ws/.gitignore b/ros_ws/.gitignore deleted file mode 100644 index 04204c7..0000000 --- a/ros_ws/.gitignore +++ /dev/null @@ -1 +0,0 @@ -config diff --git a/ros_ws/Dockerfile b/ros_ws/Dockerfile deleted file mode 100644 index d3b9cfd..0000000 --- a/ros_ws/Dockerfile +++ /dev/null @@ -1,92 +0,0 @@ -ARG BASE_TAG=noetic -FROM ros:${BASE_TAG} as environment-variables -ENV DEBIAN_FRONTEND=noninteractive -ENV PIP_NO_CACHE_DIR 1 -ENV USER ros -ENV HOME /home/${USER} -ENV ROS_WORKSPACE /home/${USER}/ros_ws -ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib - - -FROM environment-variables as base-dependencies - -# disable suggested and recommended install -RUN apt-config dump | grep -we Recommends -e Suggests | sed s/1/0/ \ - | sudo tee /etc/apt/apt.conf.d/999norecommend - -# install base dependencies -RUN apt-get update && apt-get install --no-install-recommends -y \ - curl \ - featherpad \ - gdb \ - git \ - iputils-ping \ - libeigen3-dev \ - libtool \ - mesa-utils \ - nano \ - python3-pip \ - python3-rosinstall-generator \ - ros-${ROS_DISTRO}-xacro \ - ros-${ROS_DISTRO}-robot-state-publisher \ - ros-${ROS_DISTRO}-rviz \ - rsync \ - software-properties-common \ - ssh \ - unzip \ - wget \ - && rm -rf /var/lib/apt/lists/* - -RUN echo "Set disable_coredump false" >> /etc/sudo.conf - -# configure sshd server settings -RUN ( \ - echo 'LogLevel DEBUG2'; \ - echo 'PubkeyAuthentication yes'; \ - echo 'Subsystem sftp /usr/lib/openssh/sftp-server'; \ - ) > /etc/ssh/sshd_config_development \ - && mkdir /run/sshd - - -FROM base-dependencies as base-workspace -ENV USER ros -ENV HOME /home/${USER} -ENV ROS_WORKSPACE /home/${USER}/ros_ws - -# create and configure a new user -ARG UID=1000 -ARG GID=1000 -RUN addgroup --gid ${GID} ${USER} -RUN adduser --gecos "ROS User" --uid ${UID} --gid ${GID} ${USER} && yes | passwd ${USER} -RUN usermod -a -G dialout ${USER} -RUN echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/99_aptget -RUN chmod 0440 /etc/sudoers.d/99_aptget && chown root:root /etc/sudoers.d/99_aptget - -# configure sshd entrypoint to authorise the new user for ssh access and -# optionally update UID and GID when invoking the container with the entrypoint script -COPY ./config/sshd_entrypoint.sh /sshd_entrypoint.sh -RUN chmod 744 /sshd_entrypoint.sh - -# build ROS workspace -USER ${USER} -RUN mkdir -p ${ROS_WORKSPACE}/src -WORKDIR ${ROS_WORKSPACE} -RUN rosdep update -RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; catkin_make" - -# create the credentials to be able to pull private repos using ssh -USER root -RUN mkdir /root/.ssh/ && ssh-keyscan github.com | tee -a /root/.ssh/known_hosts - -# prepend the environment sourcing to bashrc (appending will fail for non-interactive sessions) -RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash; \ -source ${ROS_WORKSPACE}/devel/setup.bash" | cat - ${HOME}/.bashrc > tmp && mv tmp ${HOME}/.bashrc -RUN echo "session required pam_limits.so" | tee --append /etc/pam.d/common-session > /dev/null - - -FROM environment-variables as final -COPY --from=base-workspace / / - -# start as ROS user -USER ${USER} -WORKDIR ${ROS_WORKSPACE} diff --git a/ros_ws/build.sh b/ros_ws/build.sh deleted file mode 100755 index f91ba5c..0000000 --- a/ros_ws/build.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -IMAGE_NAME=aica-technology/ros-ws -BASE_TAG=noetic - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -if [[ ! -f "${SCRIPT_DIR}"/config/sshd_entrypoint.sh ]]; then - mkdir -p "${SCRIPT_DIR}"/config - cp "$(dirname "${SCRIPT_DIR}")"/common/sshd_entrypoint.sh "${SCRIPT_DIR}"/config/ || exit 1 -fi - -BUILD_FLAGS=() -while [ "$#" -gt 0 ]; do - case "$1" in - --base-tag) - BASE_TAG=$2 - shift 2 - ;; - -r | --rebuild) - BUILD_FLAGS+=(--no-cache) - shift 1 - ;; - -v | --verbose) - BUILD_FLAGS+=(--progress=plain) - shift 1 - ;; - *) - echo "Unknown option: $1" >&2 - exit 1 - ;; - esac -done - -docker pull "ros:${BASE_TAG}" -BUILD_FLAGS+=(--build-arg BASE_TAG="${BASE_TAG}") - -if [[ "$OSTYPE" != "darwin"* ]]; then - USER_ID="$(id -u "${USER}")" - GROUP_ID="$(id -g "${USER}")" - BUILD_FLAGS+=(--build-arg UID="${USER_ID}") - BUILD_FLAGS+=(--build-arg GID="${GROUP_ID}") -fi - -BUILD_FLAGS+=(-t "${IMAGE_NAME}":"${BASE_TAG}") - -DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . From 5c6d2bffda1428a65f002180f7182934923f1d0a Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Fri, 26 Apr 2024 07:46:58 +0200 Subject: [PATCH 2/5] refactor: merge ros2-control image into ros2-ws (#100) --- ros2_control/Dockerfile.galactic | 25 ------------ ros2_control/Dockerfile.humble | 26 ------------- ros2_control/Dockerfile.iron | 38 ------------------- ros2_control/build.sh | 65 -------------------------------- ros2_ws/Dockerfile | 38 +++++++++++++++++-- ros2_ws/build.sh | 19 ++-------- 6 files changed, 39 insertions(+), 172 deletions(-) delete mode 100644 ros2_control/Dockerfile.galactic delete mode 100644 ros2_control/Dockerfile.humble delete mode 100644 ros2_control/Dockerfile.iron delete mode 100755 ros2_control/build.sh diff --git a/ros2_control/Dockerfile.galactic b/ros2_control/Dockerfile.galactic deleted file mode 100644 index fdfc26b..0000000 --- a/ros2_control/Dockerfile.galactic +++ /dev/null @@ -1,25 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/aica-technology/ros2-ws -ARG BASE_TAG=humble -FROM ${BASE_IMAGE}:${BASE_TAG} as ros2-control-build - -RUN mkdir -p ${ROS2_WORKSPACE}/src/ros2_control -WORKDIR ${ROS2_WORKSPACE}/src/ros2_control - -RUN git clone -b 1.0.0 --depth 1 https://github.com/ros-controls/ros2_control.git -RUN git clone -b 1.0.0 --depth 1 https://github.com/ros-controls/ros2_controllers.git - -# get additional interface dependencies manually -RUN git clone -b galactic-devel --depth 1 https://github.com/ros-controls/control_msgs.git -RUN git clone -b ros2-master --depth 1 https://github.com/ros-controls/control_toolbox.git -RUN git clone -b 2.1.1 --depth 1 https://github.com/ros-controls/realtime_tools.git -RUN git clone -b galactic --depth 1 https://github.com/ros2/rcl_interfaces.git -RUN git clone -b galactic --depth 1 https://github.com/ros2/test_interface_files.git -RUN git clone -b ros2 --depth 1 https://github.com/ros/angles.git - -WORKDIR ${ROS2_WORKSPACE} -RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build" -RUN rm -rf ./src - - -FROM ${BASE_IMAGE}:${BASE_TAG} as final -COPY --from=ros2-control-build ${ROS2_WORKSPACE} ${ROS2_WORKSPACE} diff --git a/ros2_control/Dockerfile.humble b/ros2_control/Dockerfile.humble deleted file mode 100644 index c7ffc14..0000000 --- a/ros2_control/Dockerfile.humble +++ /dev/null @@ -1,26 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/aica-technology/ros2-ws -ARG BASE_TAG=humble -FROM ${BASE_IMAGE}:${BASE_TAG} as ros2-control-build - -RUN mkdir -p ${ROS2_WORKSPACE}/src/ros2_control -WORKDIR ${ROS2_WORKSPACE}/src/ros2_control - -RUN git clone -b 2.11.0 --depth 1 https://github.com/ros-controls/ros2_control.git -RUN git clone -b 2.11.0 --depth 1 https://github.com/ros-controls/ros2_controllers.git - -# get additional interface dependencies manually -RUN git clone -b humble --depth 1 https://github.com/ros-controls/control_msgs.git -RUN git clone -b 3.1.0 --depth 1 https://github.com/ros-controls/control_toolbox.git -RUN git clone -b 2.2.0 --depth 1 https://github.com/ros-controls/realtime_tools.git -RUN git clone -b humble --depth 1 https://github.com/ros2/rcl_interfaces.git -RUN git clone -b humble --depth 1 https://github.com/ros2/test_interface_files.git -RUN git clone -b ros2 --depth 1 https://github.com/ros/angles.git -RUN git clone -b ros2 --depth 1 https://github.com/ros-drivers/ackermann_msgs.git - -WORKDIR ${ROS2_WORKSPACE} -RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build" -RUN rm -rf ./src - - -FROM ${BASE_IMAGE}:${BASE_TAG} as final -COPY --from=ros2-control-build ${ROS2_WORKSPACE} ${ROS2_WORKSPACE} diff --git a/ros2_control/Dockerfile.iron b/ros2_control/Dockerfile.iron deleted file mode 100644 index 329e68b..0000000 --- a/ros2_control/Dockerfile.iron +++ /dev/null @@ -1,38 +0,0 @@ -ARG BASE_IMAGE=ghcr.io/aica-technology/ros2-ws -ARG BASE_TAG=iron -FROM ${BASE_IMAGE}:${BASE_TAG} as ros2-control-build - -RUN sudo apt-get update && sudo apt-get install --no-install-recommends -y \ - doxygen \ - librange-v3-dev \ - python3-jinja2 \ - python3-typeguard \ - && sudo rm -rf /var/lib/apt/lists/* - -RUN mkdir -p ${ROS2_WORKSPACE}/src/ros2_control -WORKDIR ${ROS2_WORKSPACE}/src/ros2_control - -RUN git clone -b 3.18.0 --depth 1 https://github.com/ros-controls/ros2_control.git -RUN git clone -b 3.14.0 --depth 1 https://github.com/ros-controls/ros2_controllers.git -# get additional interface dependencies manually -RUN git clone -b 5.0.0 --depth 1 https://github.com/ros-controls/control_msgs.git -RUN git clone -b 1.0.2 --depth 1 https://github.com/pal-robotics/backward_ros.git -RUN git clone -b 3.1.2 --depth 1 https://github.com/ros/diagnostics.git -RUN git clone -b 2.5.0 --depth 1 https://github.com/ros-controls/realtime_tools.git -RUN git clone -b 1.7.0 --depth 1 https://github.com/ros2/rcl_interfaces.git -RUN git clone -b 0.11.0 --depth 1 https://github.com/ros2/test_interface_files.git -RUN git clone -b 1.16.0 --depth 1 https://github.com/ros/angles.git -RUN git clone -b ros2 --depth 1 https://github.com/ros-drivers/ackermann_msgs.git -RUN git clone -b 0.3.3 --depth 1 https://github.com/PickNikRobotics/generate_parameter_library.git -RUN git clone -b 0.2.2 --depth 1 https://github.com/PickNikRobotics/RSL.git -RUN git clone -b 1.0.2 --depth 1 https://github.com/PickNikRobotics/cpp_polyfills.git -RUN git clone -b 3.1.0 --depth 1 https://github.com/ros-controls/control_toolbox.git -RUN git clone -b 0.1.0 --depth 1 https://github.com/ros-controls/kinematics_interface.git - -WORKDIR ${ROS2_WORKSPACE} -RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build" -RUN rm -rf ./src - - -FROM ${BASE_IMAGE}:${BASE_TAG} as final -COPY --from=ros2-control-build / / diff --git a/ros2_control/build.sh b/ros2_control/build.sh deleted file mode 100755 index 8c80bac..0000000 --- a/ros2_control/build.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -IMAGE_NAME=aica-technology/ros2-control - -LOCAL_BASE_IMAGE=false -BASE_IMAGE=ghcr.io/aica-technology/ros2-ws -BASE_TAG=humble -OUTPUT_TAG="" - -BUILD_FLAGS=() -while [ "$#" -gt 0 ]; do - case "$1" in - --local-base) - LOCAL_BASE_IMAGE=true - shift 1 - ;; - --base-tag) - BASE_TAG=$2 - shift 2 - ;; - --output-tag) - OUTPUT_TAG=$2 - shift 2 - ;; - -r | --rebuild) - BUILD_FLAGS+=(--no-cache) - shift 1 - ;; - -v | --verbose) - BUILD_FLAGS+=(--progress=plain) - shift 1 - ;; - *) - echo "Unknown option: $1" >&2 - exit 1 - ;; - esac -done - -if [ -z "${OUTPUT_TAG}" ]; then - echo "Output tag is empty, using the base tag as output tag." - OUTPUT_TAG="${BASE_TAG}" -fi - -if [ "${LOCAL_BASE_IMAGE}" = true ]; then - BUILD_FLAGS+=(--build-arg BASE_IMAGE=aica-technology/ros2-ws) -else - docker pull "${BASE_IMAGE}:${BASE_TAG}" -fi - -BUILD_FLAGS+=(--build-arg BASE_TAG="${BASE_TAG}") -BUILD_FLAGS+=(-t "${IMAGE_NAME}:${OUTPUT_TAG}") - -if [[ "${BASE_TAG}" == *"galactic"* ]]; then - DOCKERFILE=Dockerfile.galactic -elif [[ "${BASE_TAG}" == *"humble"* ]]; then - DOCKERFILE=Dockerfile.humble -elif [[ "${BASE_TAG}" == *"iron"* ]]; then - DOCKERFILE=Dockerfile.iron -else - echo "Invalid base tag. Base tag needs to contain either 'galactic', 'humble' or 'iron'." - exit 1 -fi - -DOCKER_BUILDKIT=1 docker build -f "${DOCKERFILE}" "${BUILD_FLAGS[@]}" . diff --git a/ros2_ws/Dockerfile b/ros2_ws/Dockerfile index a1bd983..efc3325 100644 --- a/ros2_ws/Dockerfile +++ b/ros2_ws/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_TAG=humble +ARG BASE_TAG=iron FROM ros:${BASE_TAG} as environment-variables ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONWARNINGS=ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources @@ -99,10 +99,42 @@ USER root RUN mkdir /root/.ssh/ && ssh-keyscan github.com | tee -a /root/.ssh/known_hosts RUN echo "session required pam_limits.so" | tee --append /etc/pam.d/common-session > /dev/null +FROM base-workspace as ros2-control-iron + +RUN apt-get update && apt-get install --no-install-recommends -y \ + doxygen \ + librange-v3-dev \ + python3-jinja2 \ + python3-typeguard \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR ${ROS2_WORKSPACE}/src + +RUN git clone -b 3.18.0 --depth 1 https://github.com/ros-controls/ros2_control.git +RUN git clone -b 3.14.0 --depth 1 https://github.com/ros-controls/ros2_controllers.git +# get additional interface dependencies manually +RUN git clone -b 5.0.0 --depth 1 https://github.com/ros-controls/control_msgs.git +RUN git clone -b 1.0.2 --depth 1 https://github.com/pal-robotics/backward_ros.git +RUN git clone -b 3.1.2 --depth 1 https://github.com/ros/diagnostics.git +RUN git clone -b 2.5.0 --depth 1 https://github.com/ros-controls/realtime_tools.git +RUN git clone -b 1.7.0 --depth 1 https://github.com/ros2/rcl_interfaces.git +RUN git clone -b 0.11.0 --depth 1 https://github.com/ros2/test_interface_files.git +RUN git clone -b 1.16.0 --depth 1 https://github.com/ros/angles.git +RUN git clone -b ros2 --depth 1 https://github.com/ros-drivers/ackermann_msgs.git +RUN git clone -b 0.3.3 --depth 1 https://github.com/PickNikRobotics/generate_parameter_library.git +RUN git clone -b 0.2.2 --depth 1 https://github.com/PickNikRobotics/RSL.git +RUN git clone -b 1.0.2 --depth 1 https://github.com/PickNikRobotics/cpp_polyfills.git +RUN git clone -b 3.1.0 --depth 1 https://github.com/ros-controls/control_toolbox.git +RUN git clone -b 0.1.0 --depth 1 https://github.com/ros-controls/kinematics_interface.git + +WORKDIR ${ROS2_WORKSPACE} +RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build" +RUN rm -rf ./src + +FROM ros2-control-${BASE_TAG} as ros2-control FROM environment-variables as final -COPY --from=base-workspace / / +COPY --from=ros2-control / / # start as ROS user USER ${USER} -WORKDIR ${ROS2_WORKSPACE} diff --git a/ros2_ws/build.sh b/ros2_ws/build.sh index 09b599a..7a8ac01 100755 --- a/ros2_ws/build.sh +++ b/ros2_ws/build.sh @@ -1,7 +1,7 @@ #!/bin/bash -IMAGE_NAME=aica-technology/ros2-ws -BASE_TAG=humble +IMAGE_NAME=gchr.io/aica-technology/ros2-ws +BASE_TAG=iron SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" if [[ ! -f "${SCRIPT_DIR}"/config/sshd_entrypoint.sh ]]; then @@ -31,16 +31,5 @@ while [ "$#" -gt 0 ]; do esac done -docker pull "ros:${BASE_TAG}" -BUILD_FLAGS+=(--build-arg BASE_TAG="${BASE_TAG}") - -if [[ "$OSTYPE" != "darwin"* ]]; then - USER_ID="$(id -u "${USER}")" - GROUP_ID="$(id -g "${USER}")" - BUILD_FLAGS+=(--build-arg UID="${USER_ID}") - BUILD_FLAGS+=(--build-arg GID="${GROUP_ID}") -fi - -BUILD_FLAGS+=(-t "${IMAGE_NAME}":"${BASE_TAG}") - -DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . +BUILD_FLAGS+=(--build-arg=BASE_TAG=${BASE_TAG}) +docker buildx build -t "${IMAGE_NAME}":"${BASE_TAG}" "${BUILD_FLAGS[@]}" . From 3491e383c6f87cc26e823f2e34b6f56e44867258 Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:55:50 +0200 Subject: [PATCH 3/5] refactor: build push workflow for ros2-ws (#101) --- .github/workflows/build-push.yml | 27 ++--- .github/workflows/manual-dispatch.yml | 36 ------ .github/workflows/reusable-build-push.yml | 137 +++++++++++++--------- ros2_ws/VERSION.iron | 1 + 4 files changed, 92 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/manual-dispatch.yml create mode 100644 ros2_ws/VERSION.iron diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 5977764..690f71f 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -1,37 +1,26 @@ name: Build and Push Multi-Arch Images -# Run workflow on pushes to main branch on: push: branches: - main workflow_dispatch: + inputs: + force: + required: false + type: boolean + default: false jobs: build-ws: strategy: matrix: - ros2_distro: [ humble, iron ] + ros2_distro: [ iron ] name: Build and publish ros2-ws:${{ matrix.ros2_distro }} uses: ./.github/workflows/reusable-build-push.yml with: - workspace: ros2-ws - base_tag: ${{ matrix.ros2_distro }} - secrets: - token: ${{ secrets.GITHUB_TOKEN }} - - build-control: - needs: build-ws - strategy: - matrix: - ros2_distro: [ humble, iron ] - - name: Build and publish ros2-control:${{ matrix.ros2_distro }} - uses: ./.github/workflows/reusable-build-push.yml - with: - workspace: ros2-control - base_tag: ${{ matrix.ros2_distro }} - dockerfile_extension: .${{ matrix.ros2_distro }} + ros_distro: ${{ matrix.ros2_distro }} + force: ${{ github.event_name == 'workflow_dispatch' && inputs.force }} secrets: token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/manual-dispatch.yml b/.github/workflows/manual-dispatch.yml deleted file mode 100644 index 45f24e8..0000000 --- a/.github/workflows/manual-dispatch.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Manual Build and Push - -# Run workflow by manual dispatch -on: - workflow_dispatch: - inputs: - workspace: - description: 'The desired workspace' - required: true - type: choice - options: - - ros2-ws - - ros2-control - base_tag: - description: 'The tag of the base image to use' - required: false - default: 'humble' - output_tag: - description: 'The tag for the output image (if left empty, the base tag is used)' - required: false - default: '' - dockerfile_extension: - description: 'The optional extension of the Dockerfile for variant images' - required: false - default: '' - -jobs: - build-push: - uses: ./.github/workflows/reusable-build-push.yml - with: - workspace: ${{ inputs.workspace }} - base_tag: ${{ inputs.base_tag }} - output_tag: ${{ inputs.output_tag }} - dockerfile_extension: ${{ inputs.dockerfile_extension }} - secrets: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/reusable-build-push.yml b/.github/workflows/reusable-build-push.yml index 15c776f..c75e4cd 100644 --- a/.github/workflows/reusable-build-push.yml +++ b/.github/workflows/reusable-build-push.yml @@ -3,71 +3,89 @@ name: Reusable workflow to build and push multi-arch images on: workflow_call: inputs: - workspace: - required: true - type: string - base_tag: - required: false - type: string - default: 'humble' - output_tag: + ros_distro: required: false type: string - dockerfile_extension: + default: "iron" + force: required: false - type: string + type: boolean + default: false secrets: token: - description: 'The GitHub token passed from the caller workflow' + description: "The GitHub token passed from the caller workflow" required: true +env: + ROS2_WS_PATH: ros2_ws + jobs: + check-version: + name: Check if the version has been updated + outputs: + has_changed: ${{ steps.check.outputs.has_changed }} + version: ${{ steps.versions.outputs.new_version }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + - id: versions + run: | + git show HEAD^:$ROS2_WS_PATH/VERSION.${{ inputs.ros_distro }} 2>/dev/null + if [[ $? == 0 ]]; then + PREV_VERSION=$(git show HEAD^:$ROS2_WS_PATH/VERSION.${{ inputs.ros_distro }}) + else + PREV_VERSION=0.0.0 + fi + NEW_VERSION=$(git show HEAD:$ROS2_WS_PATH/VERSION.${{ inputs.ros_distro }}) + + echo "prev_version=${PREV_VERSION}" >> $GITHUB_OUTPUT + echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT + shell: bash + - uses: aica-technology/.github/.github/actions/compare-versions@v0.11.0 + id: check + with: + previous_version: ${{ steps.versions.outputs.prev_version }} + new_version: ${{ steps.versions.outputs.new_version }} + metadata: + needs: check-version + if: ${{ needs.check-version.outputs.has_changed == 'true' || inputs.force }} runs-on: ubuntu-latest - name: Parse inputs + name: Metadata outputs: - output_tag: ${{ steps.parse.outputs.output_tag }} - image_name: ${{ steps.parse.outputs.image_name }} - path: ${{ steps.parse.outputs.path }} - file: ${{ steps.parse.outputs.file }} - build_flags: ${{ steps.parse.outputs.build_flags }} + image_name: ${{ steps.ensure-image.outputs.image_name }} + image_tags: ${{ steps.tags.outputs.image_tags }} + build_flags: ${{ steps.tags.outputs.build_flags }} + git_tag: ${{ steps.tags.outputs.git_tag }} steps: - - name: Parse inputs - id: parse + - uses: aica-technology/.github/.github/actions/ghcr-ensure-prefix@v0.6.0 + id: ensure-image + with: + image_name: aica-technology/ros2-ws + + - id: tags run: | - BUILD_FLAGS=() - # parse base tag - BASE_TAG=${{ inputs.base_tag }} + BUILD_FLAGS=() + BASE_TAG=${{ inputs.ros_distro }} BUILD_FLAGS+=(--build-arg BASE_TAG=${BASE_TAG}) echo "::debug::Using base image tag ${BASE_TAG}" - # parse output tag - OUTPUT_TAG=${{ inputs.output_tag }} - if [ -z ${OUTPUT_TAG} ]; then - OUTPUT_TAG=${BASE_TAG} - fi - echo "output_tag=${OUTPUT_TAG}" >> $GITHUB_OUTPUT - echo "::debug::Generated image tag will be ${OUTPUT_TAG}" - - # parse image name - IMAGE_NAME=${{ inputs.workspace }} - IMAGE_NAME=${{ github.repository_owner }}/${IMAGE_NAME//[_]/-} - echo "::debug::Generated image name will be ${IMAGE_NAME}" - echo "image_name=${IMAGE_NAME}" >> $GITHUB_OUTPUT - - # parse docker path and file - WS_PATH=${{ inputs.workspace }} - WS_PATH=${WS_PATH//[-]/_} - echo "path=${WS_PATH}" >> $GITHUB_OUTPUT - FILE=${WS_PATH}/Dockerfile${{ inputs.dockerfile_extension }} - echo "file=${FILE}" >> $GITHUB_OUTPUT - echo "build_flags=${BUILD_FLAGS[@]}" >> $GITHUB_OUTPUT + VERSION_TAG="v${{ needs.check-version.outputs.version }}" + IMAGE_TAGS="${VERSION_TAG},${VERSION_TAG}-${{ inputs.ros_distro}}","${{ inputs.ros_distro}}" + GIT_TAG="${{ inputs.ros_distro}}-${VERSION_TAG}" + echo "Image tags: ${IMAGE_TAGS}" + echo "Git tag: ${GIT_TAG}" + echo "image_tags=${IMAGE_TAGS}" >> $GITHUB_OUTPUT + echo "git_tag=${GIT_TAG}" >> $GITHUB_OUTPUT + build: needs: metadata strategy: matrix: - arch: [ amd64, arm64 ] + arch: [amd64, arm64] include: - image: ubuntu-latest - image: buildjet-2vcpu-ubuntu-2204-arm @@ -78,29 +96,40 @@ jobs: steps: - uses: actions/checkout@v3 - - if: needs.metadata.outputs.path == 'ros2_ws' || needs.metadata.outputs.path == 'ros_ws' - run: | - CONFIG_PATH=${{ needs.metadata.outputs.path }}/config + - run: | + CONFIG_PATH=$ROS2_WS_PATH/config mkdir -p ${CONFIG_PATH} cp common/sshd_entrypoint.sh ${CONFIG_PATH}/ - + + - uses: aica-technology/.github/.github/actions/list-add-suffixes@v0.6.1 + id: merge-tags + with: + list: ${{ needs.metadata.outputs.image_tags }} + suffixes: ${{ matrix.arch }} + glue_separator: "-" + - uses: aica-technology/.github/.github/actions/ghcr-build@v0.6.1 with: image_name: ${{ needs.metadata.outputs.image_name }} - image_tags: ${{ needs.metadata.outputs.output_tag }}-${{ matrix.arch }} - build_context_path: ${{ needs.metadata.outputs.path }} - dockerfile_path: ${{ needs.metadata.outputs.file }} + image_tags: ${{ steps.merge-tags.outputs.list }} + build_context_path: $ROS2_WS_PATH + dockerfile_path: ros2_ws/Dockerfile build_flags: ${{ needs.metadata.outputs.build_flags }} token: ${{ secrets.GITHUB_TOKEN }} - + multi-arch: runs-on: ubuntu-latest name: Merge into a multi-arch image - needs: [ metadata, build ] + needs: [metadata, build] steps: - uses: aica-technology/.github/.github/actions/ghcr-manifest-merge@v0.6.1 with: image_name: ${{ needs.metadata.outputs.image_name }} - image_tags: ${{ needs.metadata.outputs.output_tag }} + image_tags: ${{ needs.metadata.outputs.image_tags }} archs: amd64,arm64 token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create git tag + uses: aica-technology/.github/.github/actions/git-tag@v0.8.1 + with: + tag: ${{ needs.metadata.outputs.git_tag }} diff --git a/ros2_ws/VERSION.iron b/ros2_ws/VERSION.iron new file mode 100644 index 0000000..afaf360 --- /dev/null +++ b/ros2_ws/VERSION.iron @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file From 57ca29b88d3bfbe09ff8fd0c02c1ae36812230a7 Mon Sep 17 00:00:00 2001 From: Louis Brunner Date: Mon, 29 Apr 2024 16:02:19 +0100 Subject: [PATCH 4/5] feat: add metadata through LABELs (#103) --- .github/workflows/reusable-build-push.yml | 10 +++++++--- ros2_ws/Dockerfile | 9 +++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-build-push.yml b/.github/workflows/reusable-build-push.yml index c75e4cd..b79f57a 100644 --- a/.github/workflows/reusable-build-push.yml +++ b/.github/workflows/reusable-build-push.yml @@ -67,17 +67,21 @@ jobs: - id: tags run: | - BUILD_FLAGS=() + BUILD_FLAGS=() + BASE_TAG=${{ inputs.ros_distro }} BUILD_FLAGS+=(--build-arg BASE_TAG=${BASE_TAG}) - echo "::debug::Using base image tag ${BASE_TAG}" - echo "build_flags=${BUILD_FLAGS[@]}" >> $GITHUB_OUTPUT VERSION_TAG="v${{ needs.check-version.outputs.version }}" IMAGE_TAGS="${VERSION_TAG},${VERSION_TAG}-${{ inputs.ros_distro}}","${{ inputs.ros_distro}}" GIT_TAG="${{ inputs.ros_distro}}-${VERSION_TAG}" + BUILD_FLAGS+=(--build-arg VERSION=${GIT_TAG}) + + echo "::debug::Using base image tag ${BASE_TAG}" + echo "Build flags: ${BUILD_FLAGS[@]}" echo "Image tags: ${IMAGE_TAGS}" echo "Git tag: ${GIT_TAG}" + echo "build_flags=${BUILD_FLAGS[@]}" >> $GITHUB_OUTPUT echo "image_tags=${IMAGE_TAGS}" >> $GITHUB_OUTPUT echo "git_tag=${GIT_TAG}" >> $GITHUB_OUTPUT diff --git a/ros2_ws/Dockerfile b/ros2_ws/Dockerfile index efc3325..a626666 100644 --- a/ros2_ws/Dockerfile +++ b/ros2_ws/Dockerfile @@ -138,3 +138,12 @@ COPY --from=ros2-control / / # start as ROS user USER ${USER} + +# Metadata +ARG VERSION +ARG BASE_TAG +LABEL org.opencontainers.image.title="AICA ROS2 image" +LABEL org.opencontainers.image.description="AICA base ROS2 image (includes ros2_control)" +LABEL org.opencontainers.image.version="${VERSION}" +LABEL org.opencontainers.image.base.name="docker.io/library/ros:${BASE_TAG}" +LABEL tech.aica.image.metadata='{"type":"base/ws","base":{"name":"docker.io/library/ros","version":"'${BASE_TAG}'"}}' From 7f4043c8b261845b8dd94af8757fe16e870d645d Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Tue, 30 Apr 2024 07:14:04 +0200 Subject: [PATCH 5/5] docs: update README (#102) --- .github/workflows/reusable-build-push.yml | 2 +- README.md | 49 +++++++++-------------- ros2_ws/Dockerfile | 4 +- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/.github/workflows/reusable-build-push.yml b/.github/workflows/reusable-build-push.yml index b79f57a..184fa79 100644 --- a/.github/workflows/reusable-build-push.yml +++ b/.github/workflows/reusable-build-push.yml @@ -74,7 +74,7 @@ jobs: VERSION_TAG="v${{ needs.check-version.outputs.version }}" IMAGE_TAGS="${VERSION_TAG},${VERSION_TAG}-${{ inputs.ros_distro}}","${{ inputs.ros_distro}}" - GIT_TAG="${{ inputs.ros_distro}}-${VERSION_TAG}" + GIT_TAG="${VERSION_TAG}-${{ inputs.ros_distro}}" BUILD_FLAGS+=(--build-arg VERSION=${GIT_TAG}) echo "::debug::Using base image tag ${BASE_TAG}" diff --git a/README.md b/README.md index 3d713e6..8977d1a 100644 --- a/README.md +++ b/README.md @@ -2,44 +2,33 @@ ![Build and Push ROS and ROS2 images](https://github.com/aica-technology/docker-images/actions/workflows/build-push.yml/badge.svg) -## Images +This repository is used to produce pre-configured and versioned Docker images with ROS 2 and `ros2_control` packages and +other dependencies pre-installed. The images can be used as workspaces for development containers or as base images for +downstream targets. -### ROS workspace (noetic) +## ROS 2 workspace (ros2-ws) -The ros_ws image provides a ROS workspace (noetic). Build it by running the -[build script](ros_ws/build.sh) while in the [ros_ws](ros_ws) directory. +The `ros2_ws` image provides a ROS 2 workspace with pre-installed ros2-control packages. -The username that should be supplied at login is `ros`. +### Deprecated images -### ROS workspace with pre-installed control libraries +1. ROS workspace (noetic): the ros_ws image provides a ROS workspace (noetic). Build it by running the + [build script](ros_ws/build.sh) while in the [ros_ws](ros_ws) directory. The username that should be supplied at + login is `ros`. -The ros_control_libraries image provides the same ROS workspace as ros_ws but -comes with the pre-installed [control libraries](https://github.com/aica-technology/control-libraries). +2. ROS workspace with pre-installed control libraries: the ros_control_libraries image provides the same ROS workspace + as ros_ws but comes with the pre-installed [control libraries](https://github.com/aica-technology/control-libraries). -### ROS2 workspace +3. ROS 2 workspace with pre-installed control libraries: the ros2_control_libraries image provides the a ROS 2 workspace + and comes with the pre-installed [control libraries](https://github.com/aica-technology/control-libraries). -Similar to the ROS workspace, the ros2_ws image provides a ROS2 workspace. -Build it by running the [build script](ros2_ws/build.sh) while -in the [ros2_ws](ros2_ws) directory. Modify the ROS2 distribution -in the script as desired. +4. ROS 2 workspace with pre-installed control libraries and modulo: the ros2_modulo image provides a ROS 2 workspace with + [modulo](https://github.com/aica-technology/modulo) already built and comes with pre-installed + [control libraries](https://github.com/aica-technology/control-libraries). -The username that should be supplied at login is `ros2`. - -### ROS2 workspace with pre-installed control libraries - -The ros2_control_libraries image provides the same ROS2 workspace as ros2_ws but -comes with the pre-installed [control libraries](https://github.com/aica-technology/control-libraries). - -### ROS2 workspace with pre-installed control libraries and modulo - -The ros2_modulo image provides a ROS2 workspace with [modulo](https://github.com/aica-technology/modulo) -already built and comes with pre-installed [control libraries](https://github.com/aica-technology/control-libraries). - -### ROS2 workspace with pre-installed control libraries, modulo, and ROS2 control - -The ros2_modulo_control image provides a ROS2 workspace with [modulo](https://github.com/aica-technology/modulo) -already built and comes with pre-installed [control libraries](https://github.com/aica-technology/control-libraries) -and ROS2 control packages. +5. ROS 2 workspace with pre-installed control libraries, modulo, and ROS 2 control: the ros2_modulo_control image provides + a ROS 2 workspace with [modulo](https://github.com/aica-technology/modulo) already built and comes with pre-installed + [control libraries](https://github.com/aica-technology/control-libraries) and ROS 2 control packages. ## Scripts diff --git a/ros2_ws/Dockerfile b/ros2_ws/Dockerfile index a626666..da3e581 100644 --- a/ros2_ws/Dockerfile +++ b/ros2_ws/Dockerfile @@ -142,8 +142,8 @@ USER ${USER} # Metadata ARG VERSION ARG BASE_TAG -LABEL org.opencontainers.image.title="AICA ROS2 image" -LABEL org.opencontainers.image.description="AICA base ROS2 image (includes ros2_control)" +LABEL org.opencontainers.image.title="AICA ROS 2 image" +LABEL org.opencontainers.image.description="AICA base ROS 2 image (includes ros2_control)" LABEL org.opencontainers.image.version="${VERSION}" LABEL org.opencontainers.image.base.name="docker.io/library/ros:${BASE_TAG}" LABEL tech.aica.image.metadata='{"type":"base/ws","base":{"name":"docker.io/library/ros","version":"'${BASE_TAG}'"}}'