From 1106f073e037c04f18a2c557f80612aee1255142 Mon Sep 17 00:00:00 2001 From: Ezra Brooks Date: Thu, 28 Dec 2023 12:55:39 -0700 Subject: [PATCH] Don't run vcs inside buildkit (#60) --- .gitignore | 4 ++++ moveit2/Dockerfile | 16 +++------------- moveit2/build.sh | 3 +++ .../{moveit2_tutorials.repos => moveit2.repos} | 4 ++++ space_robots/Dockerfile | 5 ----- space_robots/build.sh | 3 +++ 6 files changed, 17 insertions(+), 18 deletions(-) rename moveit2/{moveit2_tutorials.repos => moveit2.repos} (83%) diff --git a/.gitignore b/.gitignore index 2699e61..63434d0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ __pycache__/ *.py[cod] *$py.class + +# vcstool workspaces +moveit2/src +space_robots/src diff --git a/moveit2/Dockerfile b/moveit2/Dockerfile index 6181fd8..811a986 100644 --- a/moveit2/Dockerfile +++ b/moveit2/Dockerfile @@ -81,20 +81,11 @@ RUN python3 -m pip install -U \ pytest-rerunfailures \ pytest -# Get the MoveIt2 source code -WORKDIR ${HOME_DIR} -RUN sudo git clone https://github.com/ros-planning/moveit2.git -b ${ROSDISTRO} moveit2/src -RUN cd ${MOVEIT2_DIR}/src \ - && sudo git clone https://github.com/ros-planning/moveit2_tutorials.git -b ${ROSDISTRO} - -# Update the ownership of the source files (had to use sudo above to work around -# a possible inherited 'insteadof' from the host that forces use of ssh -RUN sudo chown -R ${USERNAME}:${USERNAME} ${MOVEIT2_DIR} - # Get rosinstall_generator RUN sudo apt-get update -y && sudo apt-get install -y python3-rosinstall-generator # Generate repos file for moveit2 dependencies, excluding packages from Space ROS core. +WORKDIR ${HOME_DIR} COPY --chown=${USERNAME}:${USERNAME} moveit2-pkgs.txt /tmp/ COPY --chown=${USERNAME}:${USERNAME} excluded-pkgs.txt /tmp/ RUN rosinstall_generator \ @@ -107,9 +98,8 @@ RUN rosinstall_generator \ # Get the repositories required by MoveIt2, but not included in Space ROS WORKDIR ${MOVEIT2_DIR} -RUN vcs import src < /tmp/moveit2_generated_pkgs.repos -COPY --chown=${USERNAME}:${USERNAME} moveit2_tutorials.repos /tmp/ -RUN vcs import src < /tmp/moveit2_tutorials.repos +RUN mkdir -p src && vcs import src < /tmp/moveit2_generated_pkgs.repos +COPY src src # Update the ownership of the source files (had to use sudo above to work around # a possible inherited 'insteadof' from the host that forces use of ssh diff --git a/moveit2/build.sh b/moveit2/build.sh index 04cc00d..d869e05 100755 --- a/moveit2/build.sh +++ b/moveit2/build.sh @@ -14,6 +14,9 @@ echo "" echo "##### Building Space ROS/MoveIt2 Docker Image #####" echo "" +mkdir -p src +vcs import src < ./moveit2.repos + docker build -t $ORG/$IMAGE:$TAG \ --build-arg VCS_REF="$VCS_REF" \ --build-arg VERSION="$VERSION" . diff --git a/moveit2/moveit2_tutorials.repos b/moveit2/moveit2.repos similarity index 83% rename from moveit2/moveit2_tutorials.repos rename to moveit2/moveit2.repos index fa8170d..b252989 100644 --- a/moveit2/moveit2_tutorials.repos +++ b/moveit2/moveit2.repos @@ -15,3 +15,7 @@ repositories: type: git url: https://github.com/PickNikRobotics/rviz_visual_tools.git version: ros2 + moveit2: + type: git + url: https://github.com/ros-planning/moveit2.git + version: humble diff --git a/space_robots/Dockerfile b/space_robots/Dockerfile index 84a94d7..0e02311 100644 --- a/space_robots/Dockerfile +++ b/space_robots/Dockerfile @@ -72,11 +72,6 @@ RUN wget https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.6.7/mo RUN tar -xzf mongo-cxx-driver-r3.6.7.tar.gz RUN cd mongo-cxx-driver-r3.6.7/build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local && sudo cmake --build . --target EP_mnmlstc_core && cmake --build . && sudo cmake --build . --target install -# Get the source for the dependencies -# RUN vcs import src < /tmp/demo_generated_pkgs.repos -COPY --chown=${USERNAME}:${USERNAME} demo_manual_pkgs.repos /tmp/ -RUN vcs import src < /tmp/demo_manual_pkgs.repos && /bin/bash -c 'source "${SPACEROS_DIR}/install/setup.bash"' - RUN sudo apt-get update -y \ && /bin/bash -c 'source "${SPACEROS_DIR}/install/setup.bash"' \ && /bin/bash -c 'source "${MOVEIT2_DIR}/install/setup.bash"' \ diff --git a/space_robots/build.sh b/space_robots/build.sh index 94770d8..65a5115 100755 --- a/space_robots/build.sh +++ b/space_robots/build.sh @@ -14,6 +14,9 @@ echo "" echo "##### Building Space ROS Demo Docker Image #####" echo "" +mkdir -p src +vcs import src < demo_manual_pkgs.repos + docker build -t $ORG/$IMAGE:$TAG \ --build-arg VCS_REF="$VCS_REF" \ --build-arg VERSION="$VERSION" .