From ff3fc105c4bba978142ed778f9731d4bc52cbb5c Mon Sep 17 00:00:00 2001 From: Michael Wrock Date: Fri, 15 Jul 2022 02:34:58 -0700 Subject: [PATCH] Ros naming (#473) * Test docker (#3) * renamed cartesian limits file (#472) * Tutorial dockerfiles (#463) Build and push docker images for tutorials * fixed clang complaints * removed dockerhub pushes * successfully ran htmlproofer * removed chomp tutorial commits * removed accidental commits * Update CMakeLists.txt * renamed mtc tutorial cpp file * updated cmakelists * updated cmakelists * removed vscode * refactored docker * skipping base image * added conditions on building base image * added conditions on building base image * added conditions on building base image * ran pre commit * Update .docker/Dockerfile Co-authored-by: Robert Haschke * Update .docker/Dockerfile Co-authored-by: Robert Haschke * resolved comments * updated location to check for changes * test change to dockerfile * test change to dockerfile * test change to dockerfile * updated scripts to run only when dockerfile changes * fixed syntax * chaged to ros base image * chaged to ros base image * update * removed ccache and change repo names * removed ccache and change repo names Co-authored-by: Henry Moore <44307180+henrygerardmoore@users.noreply.github.com> Co-authored-by: Robert Haschke * Docker debug (#2) * Tutorial dockerfiles (#463) Build and push docker images for tutorials * fixed clang complaints * removed dockerhub pushes * successfully ran htmlproofer * removed chomp tutorial commits * removed accidental commits * Update CMakeLists.txt * renamed mtc tutorial cpp file * updated cmakelists * updated cmakelists * removed vscode * refactored docker * skipping base image * added conditions on building base image * added conditions on building base image * added conditions on building base image * ran pre commit * Update .docker/Dockerfile Co-authored-by: Robert Haschke * Update .docker/Dockerfile Co-authored-by: Robert Haschke * resolved comments * updated location to check for changes * test change to dockerfile * test change to dockerfile * test change to dockerfile * updated scripts to run only when dockerfile changes * fixed syntax * got it building * building dockerfiles of tutorials * added pick container * pushing to new pc * changed to multi-stage * updated dockerfile * rebased * continued rebasing * continued rebasing * continued rebasing * continued rebasing * continued rebasing * merged online edit * continued rebasing * pre commit * modified dockerfile * added ccache to path * merging * merging * successfully ran htmlproofer * removed chomp tutorial commits * removed accidental commits * Update CMakeLists.txt * renamed mtc tutorial cpp file * updated cmakelists * updated cmakelists * removed vscode * merging * merging * ran pre commit * Update .docker/Dockerfile Co-authored-by: Robert Haschke * Update .docker/Dockerfile Co-authored-by: Robert Haschke * resolved comments * test change to dockerfile * test change to dockerfile * test change to dockerfile * merging * changed dockerfile * changed dockerfile * changed dockerfile * changed dockerfile * changed dockerfile Co-authored-by: Robert Haschke * changed naming for ros-planning * fixed conflict resolution artifsct Co-authored-by: Henry Moore <44307180+henrygerardmoore@users.noreply.github.com> Co-authored-by: Robert Haschke --- .docker/Dockerfile | 24 ++++++++++++------------ .github/workflows/docker-base.yml | 1 - .github/workflows/docker-images.yml | 1 - 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index ac603702f6..89176b40b7 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -8,8 +8,10 @@ ARG BASE_BRANCH= ######################### Base Tutorial Image ################################################# -FROM moveit/moveit2:${ROS_DISTRO}-source as base_image +FROM ros:${ROS_DISTRO}-ros-base as base_image +ENV ROS_UNDERLAY /root/ws_moveit/ +WORKDIR $ROS_UNDERLAY # Copy MoveIt sources from docker context COPY . src/moveit2_tutorials @@ -17,18 +19,19 @@ COPY . src/moveit2_tutorials # Commands are combined in single RUN statement with "apt/lists" folder removal to reduce image size # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers RUN --mount=type=cache,target=/root/.ccache/ \ + # Enable ccache + PATH=/usr/lib/ccache:$PATH && \ # Fetch required upstream sources for building vcs import src < /root/ws_moveit/src/moveit2_tutorials/moveit2_tutorials.repos && \ . "/opt/ros/${ROS_DISTRO}/setup.sh" &&\ - . "install/setup.sh" &&\ sudo apt update && rosdep install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y && \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s && \ - # Update /ros_entrypoint.sh to source our new workspace - sed -i "s#/opt/ros/\$ROS_DISTRO/setup.bash#$ROS_UNDERLAY/setup.bash#g" /ros_entrypoint.sh + --event-handlers desktop_notification- status- + +# Update /ros_entrypoint.sh to source our new workspace +RUN sed -i "s#/opt/ros/\$ROS_DISTRO/setup.bash#$ROS_UNDERLAY/install/setup.bash#g" /ros_entrypoint.sh ######################### Hello World Tutorial Image ######################################### @@ -54,8 +57,7 @@ RUN --mount=type=cache,target=/root/.ccache/ \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s + --event-handlers desktop_notification- status- ######################### Planning Around Objects Image ####################################### @@ -72,8 +74,7 @@ RUN --mount=type=cache,target=/root/.ccache/ \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s + --event-handlers desktop_notification- status- ######################### Pick and Place (MTC) Image ######################################### @@ -103,5 +104,4 @@ RUN --mount=type=cache,target=/root/.ccache/ \ colcon build \ --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ --ament-cmake-args -DCMAKE_BUILD_TYPE=Debug \ - --event-handlers desktop_notification- status- && \ - ccache -s + --event-handlers desktop_notification- status- diff --git a/.github/workflows/docker-base.yml b/.github/workflows/docker-base.yml index 838e1e8702..bb3b721700 100644 --- a/.github/workflows/docker-base.yml +++ b/.github/workflows/docker-base.yml @@ -35,7 +35,6 @@ jobs: if: steps.changed-files.outputs.any_changed == 'true' uses: docker/setup-buildx-action@v2 - name: Login to Github Container Registry - if: steps.changed-files.outputs.any_changed == 'true' uses: docker/login-action@v2 with: registry: ghcr.io diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 2b52ecc6db..d19c48f954 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -27,7 +27,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Github Container Registry - if: env.PUSH == 'true' uses: docker/login-action@v2 with: registry: ghcr.io