From 67ab5839b9845dd616e1ef3d12971b731a1ac192 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Mon, 15 Jul 2024 08:08:10 -0700 Subject: [PATCH] move all git clones into vcs yaml file, commingle catkin packages and cmake/python packages for now --- .github/workflows/ubuntu_24_04.yaml | 4 +-- Dockerfile | 12 ++++--- build.sh | 27 +++++++++------ git_clone.sh | 18 ++-------- underlay_repos.yaml | 52 +++++++++++++++++++++-------- 5 files changed, 66 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ubuntu_24_04.yaml b/.github/workflows/ubuntu_24_04.yaml index 438db5a..312a256 100644 --- a/.github/workflows/ubuntu_24_04.yaml +++ b/.github/workflows/ubuntu_24_04.yaml @@ -6,7 +6,7 @@ on: jobs: ubuntu2404dockeron2204: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 # env: steps: - name: git clone git@github.com:lucasw/ros_from_src @@ -18,7 +18,7 @@ jobs: - name: docker build from source 24.04 run: | cd ros_from_src - docker build --build-arg IMAGE=ubuntu:24.04 --build-arg PYTHON_MINOR_VERSION=10 . -t ros2404 + docker build --build-arg IMAGE=ubuntu:24.04 . -t ros2404 # TODO(lucasw) ubuntu_2404/Dockerfile doesn't work, was depending on the now-removed # apt debian science ros packages diff --git a/Dockerfile b/Dockerfile index 5110dbf..f96bba7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG IMAGE=ubuntu:22.04 +ARG IMAGE=ubuntu:24.04 FROM ${IMAGE} ARG IMAGE RUN echo ${IMAGE} @@ -14,9 +14,9 @@ RUN apt-get install -yqq git # TODO(lucasw) this doesn't work in 20.04 because of log # --build-args ROSCONSOLE=https://github.com/ros-o/rosconsole -ARG ROSCONSOLE=https://github.com/ros-o/rosconsole +# ARG ROSCONSOLE=https://github.com/ros-o/rosconsole # ENV ROSCONSOLE=$ROSCONSOLE -RUN echo $ROSCONSOLE +# RUN echo $ROSCONSOLE # packages that need to be cmake installed, and are ros packages in a catkin workspace RUN mkdir $SRC/ros_from_src -p @@ -26,9 +26,11 @@ COPY dependencies.sh $SRC/ros_from_src RUN $SRC/ros_from_src/dependencies.sh # WORKDIR $SRC/ros_from_src -COPY underlay_repos.yaml $SRC/ros_from_src +RUN mkdir -p underlay_ws/src +COPY underlay_repos.yaml underlay_ws/src COPY git_clone.sh $SRC/ros_from_src -RUN ROS_CONSOLE=$ROSCONSOLE $SRC/ros_from_src/git_clone.sh +# RUN ROS_CONSOLE=$ROSCONSOLE $SRC/ros_from_src/git_clone.sh +RUN $SRC/ros_from_src/git_clone.sh COPY build.sh $SRC/ros_from_src RUN $SRC/ros_from_src/build.sh diff --git a/build.sh b/build.sh index 820811e..1660961 100755 --- a/build.sh +++ b/build.sh @@ -14,6 +14,10 @@ mkdir -p $BUILD DEST=`pwd`/ros +WS=`pwd`/underlay_ws/src +echo $WS +mkdir $WS -p + # python installs python --version | awk '{print $2}' | cut -d'.' -f1 @@ -32,7 +36,7 @@ export PYTHONPATH=$PYTHONPATH:$OPT_PYTHONPATH0:$OPT_PYTHONPATH1 echo PYTHONPATH=$PYTHONPATH:$OPT_PYTHONPATH0:$OPT_PYTHONPATH1 # catkin_pkg -cd $SRC/catkin_pkg +cd $WS/catkin_pkg python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed ls -l $OPT_PYTHONPATH0 || ls -l $OPT_PYTHONPATH1 ls -l $OPT_PYTHONPATH0/catkin_pkg* || ls -l $OPT_PYTHONPATH1/catkin_pkg* @@ -42,22 +46,25 @@ python -c "from catkin_pkg.package import parse_package" # osrf pycommon -cd $SRC/osrf_pycommon +cd $WS/osrf_pycommon # TODO(lucasw) install to $DEST python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed # catkin tools -cd $SRC/catkin_tools +cd $WS/catkin_tools python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed # catkin install mkdir -p $BUILD/catkin cd $BUILD/catkin cmake $WS/catkin -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -DCATKIN_INSTALL_INTO_PREFIX_ROOT=true && make && make install -python -c "import catkin; print(catkin)" -ls -l $DEST/bin +ls -l $DEST/local/bin PATH=$PATH:$DEST/bin PATH=$PATH:$DEST/local/bin +which catkin +catkin --version +echo $PYTHONPATH +python -c "import catkin; print(catkin)" # console_bridge mkdir -p $BUILD/console_bridge @@ -90,7 +97,7 @@ make install mkdir -p $BUILD/ros_environment pwd cd $BUILD/ros_environment -cmake $SRC/ros_environment -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF +cmake $WS/ros_environment -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF make make install @@ -130,13 +137,13 @@ make make install # rospkg -cd $SRC/rospkg +cd $WS/rospkg python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed -cd $SRC/rosdistro +cd $WS/rosdistro python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed -cd $SRC/rosdep +cd $WS/rosdep python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed rosdep init || true rosdep update @@ -144,5 +151,3 @@ rosdep update # TODO(lucasw) already have a copy of this but needs to be in the workspace # find / | grep setup.bash # find / | grep catkin-config.cmake - - diff --git a/git_clone.sh b/git_clone.sh index 97b7308..7c3468b 100755 --- a/git_clone.sh +++ b/git_clone.sh @@ -1,6 +1,8 @@ #!/bin/bash # TODO(lucasw) replace the below with submodules # export PATH=$PATH:/usr/local/bin +set -e + SRC=`pwd`/src echo $SRC mkdir $SRC -p @@ -12,21 +14,7 @@ mkdir $WS -p # TODO(lucasw) replace these git clones with vcs # packages that need to be cmake installed, and are ros packages in a catkin workspace cd $WS -vcs import --input underlay_repos.yaml +vcs import --input underlay_repos.yaml --retry 5 # ROSCONSOLE1=${ROSCONSOLE:-https://github.com/ros-o/rosconsole} # git clone $ROSCONSOLE1 - -# pure python -cd $SRC -git clone https://github.com/ros-infrastructure/catkin_pkg -git clone https://github.com/osrf/osrf_pycommon -git clone https://github.com/catkin/catkin_tools - -# cmake installs -git clone https://github.com/ros-o/ros_environment - -# runtime -git clone https://github.com/ros-infrastructure/rospkg -git clone https://github.com/ros-infrastructure/rosdistro -git clone https://github.com/lucasw/rosdep --branch disable_root_etc_ros diff --git a/underlay_repos.yaml b/underlay_repos.yaml index 4de723d..6748a37 100644 --- a/underlay_repos.yaml +++ b/underlay_repos.yaml @@ -1,20 +1,28 @@ repositories: + # TODO(lucasw) separate the ros catkin packages from cmake/python packages actionlib: type: git - url: git@github.com:ros/actionlib.git + url: https://github.com/ros/actionlib.git version: noetic-devel angles: type: git - url: git@github.com:ros/angles.git + url: https://github.com/ros/angles.git version: master bond_core: type: git - url: git@github.com:ros-o/bond_core.git + url: https://github.com/ros-o/bond_core.git version: obese-devel catkin: type: git - url: https://github.com/ros/catkin - version: noetic-devel + url: https://github.com/ros-o/catkin + version: obese-devel + catkin_pkg: + type: git + url: https://github.com/ros-infrastructure/catkin_pkg + # version: noetic-devel + catkin_tools: + type: git + url: https://github.com/catkin/catkin_tools class_loader: type: git url: https://github.com/ros-o/class_loader @@ -25,7 +33,7 @@ repositories: version: 0.5-devel common_msgs: type: git - url: git@github.com:ros/common_msgs.git + url: https://github.com/ros/common_msgs.git version: noetic-devel console_bridge: type: git @@ -57,15 +65,15 @@ repositories: version: main geometry: type: git - url: git@github.com:ros-o/geometry.git + url: https://github.com/ros-o/geometry.git version: obese-devel - geometry2: # TODO(lucasw) use ros-o + geometry2: type: git - url: git@github.com:lucasw/geometry2 - version: noetic-devel + url: https://github.com/ros-o/geometry2 + version: obese-devel kdl_parser: type: git - url: git@github.com:ros/kdl_parser.git + url: https://github.com/ros/kdl_parser.git version: noetic-devel message_generation: type: git @@ -75,13 +83,16 @@ repositories: type: git url: https://github.com/ros/message_runtime version: kinetic-devel + osrf_pycommon: + type: git + url: https://github.com/osrf/osrf_pycommon pluginlib: type: git url: https://github.com/ros-o/pluginlib version: obese-devel resource_retriever: type: git - url: git@github.com:ros/resource_retriever.git + url: https://github.com/ros/resource_retriever.git version: kinetic-devel ros: type: git @@ -95,27 +106,40 @@ repositories: type: git url: https://github.com/ros/ros_comm_msgs version: kinetic-devel + ros_environment: + type: git + url: https://github.com/ros-o/ros_environment rosconsole: type: git url: https://github.com/ros-o/rosconsole version: obese-devel rosconsole_bridge: type: git - url: git@github.com:ros/rosconsole_bridge.git + url: https://github.com/ros/rosconsole_bridge version: kinetic-devel roscpp_core: type: git url: https://github.com/ros-o/roscpp_core version: obese-devel + rosdep: + type: git + url: https://github.com/lucasw/rosdep + version: disable_root_etc_ros + rosdistro: + type: git + url: https://github.com/ros-infrastructure/rosdistro rospack: type: git url: https://github.com/ros/rospack version: noetic-devel + rospkg: + type: git + url: https://github.com/ros-infrastructure/rospkg std_msgs: type: git url: https://github.com/ros/std_msgs version: kinetic-devel urdf: type: git - url: git@github.com:ros/urdf.git + url: https://github.com/ros/urdf.git version: melodic-devel