From e3838a4a1832b63f3fde91708a9ecc477ac153ab Mon Sep 17 00:00:00 2001 From: Jeremy Nimmer Date: Fri, 23 Feb 2024 11:21:14 -0800 Subject: [PATCH] Port from Focal to Jammy --- .github/workflows/ci.yml | 26 +++--- Jenkinsfile | 2 +- drake_ament_cmake_installed/README.md | 6 +- drake_bazel_external/.bazelrc | 10 +-- drake_bazel_external/README.md | 2 +- drake_bazel_installed/.bazelrc | 6 +- drake_bazel_installed/README.md | 2 +- drake_bazel_installed/WORKSPACE | 2 +- drake_catkin_installed/README.md | 10 +-- drake_cmake_installed/README.md | 10 +-- drake_cmake_installed_apt/README.md | 2 +- .../common/drake_ament_cmake_installed | 4 +- ...{linux_ubuntu_focal => linux_ubuntu_jammy} | 2 +- .../common/{ros_foxy => ros_humble} | 2 +- .../{ros_foxy => ros_humble}/build_test | 0 .../{ros_foxy => ros_humble}/setup | 2 +- .../{ubuntu_focal => ubuntu_jammy}/build_test | 0 .../{ubuntu_focal => ubuntu_jammy}/setup | 2 +- scripts/continuous_integration/jenkins/setup | 2 +- .../linux/ubuntu/{focal => jammy}/Dockerfile | 2 +- .../ubuntu/{focal => jammy}/install_prereqs | 79 ++++++------------- 21 files changed, 70 insertions(+), 103 deletions(-) rename scripts/continuous_integration/common/{linux_ubuntu_focal => linux_ubuntu_jammy} (83%) rename scripts/continuous_integration/common/{ros_foxy => ros_humble} (80%) rename scripts/continuous_integration/github_actions/{ros_foxy => ros_humble}/build_test (100%) rename scripts/continuous_integration/github_actions/{ros_foxy => ros_humble}/setup (56%) rename scripts/continuous_integration/github_actions/{ubuntu_focal => ubuntu_jammy}/build_test (100%) rename scripts/continuous_integration/github_actions/{ubuntu_focal => ubuntu_jammy}/setup (52%) rename scripts/setup/linux/ubuntu/{focal => jammy}/Dockerfile (98%) rename scripts/setup/linux/ubuntu/{focal => jammy}/install_prereqs (72%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18a03615..44271d9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,36 +72,36 @@ jobs: - name: build and test run: ./scripts/continuous_integration/github_actions/macos_ventura/build_test shell: zsh -efuo pipefail {0} - ros_foxy: - name: ros 2 foxy + ros_humble: + name: ros 2 humble runs-on: ubuntu-latest - container: ubuntu:focal + container: ubuntu:jammy steps: - name: checkout uses: actions/checkout@v4 - name: setup - run: ./scripts/continuous_integration/github_actions/ros_foxy/setup + run: ./scripts/continuous_integration/github_actions/ros_humble/setup shell: bash - name: build and test - run: ./scripts/continuous_integration/github_actions/ros_foxy/build_test + run: ./scripts/continuous_integration/github_actions/ros_humble/build_test shell: bash - ubuntu_focal: - name: ubuntu 20.04 focal + ubuntu_jammy: + name: ubuntu 22.04 jammy runs-on: ubuntu-latest - container: ubuntu:focal + container: ubuntu:jammy steps: - name: checkout uses: actions/checkout@v4 - name: setup - run: ./scripts/continuous_integration/github_actions/ubuntu_focal/setup + run: ./scripts/continuous_integration/github_actions/ubuntu_jammy/setup shell: bash - name: build and test - run: ./scripts/continuous_integration/github_actions/ubuntu_focal/build_test + run: ./scripts/continuous_integration/github_actions/ubuntu_jammy/build_test shell: bash - ubuntu_focal_apt: - name: ubuntu 20.04 focal apt + ubuntu_jammy_apt: + name: ubuntu 22.04 jammy apt runs-on: ubuntu-latest - container: ubuntu:focal + container: ubuntu:jammy steps: - name: checkout uses: actions/checkout@v4 diff --git a/Jenkinsfile b/Jenkinsfile index 4a4fdb98..48f41232 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ /* SPDX-License-Identifier: MIT-0 */ -node('drake-external-examples-linux-focal-unprovisioned') { +node('drake-external-examples-linux-jammy-unprovisioned') { timeout(600) { ansiColor('xterm') { def triggers = [] diff --git a/drake_ament_cmake_installed/README.md b/drake_ament_cmake_installed/README.md index f9c7023e..af0c9a80 100644 --- a/drake_ament_cmake_installed/README.md +++ b/drake_ament_cmake_installed/README.md @@ -7,11 +7,11 @@ Drake [binary packages](https://drake.mit.edu/from_binary.html). ## Instructions -To use `ament_cmake` and `colcon` from the ROS 2 Foxy package archive, install +To use `ament_cmake` and `colcon` from the ROS 2 Humble package archive, install the required packages and configure your environment as follows: ``` -sudo ../scripts/setup/linux/ubuntu/focal/install_prereqs --ros-foxy -source /opt/ros/foxy/setup.bash +sudo ../scripts/setup/linux/ubuntu/jammy/install_prereqs --ros-humble +source /opt/ros/humble/setup.bash ``` To build the `drake_ament_cmake_installed` library: diff --git a/drake_bazel_external/.bazelrc b/drake_bazel_external/.bazelrc index 4053077a..6bbaf487 100644 --- a/drake_bazel_external/.bazelrc +++ b/drake_bazel_external/.bazelrc @@ -10,17 +10,13 @@ build --strip=never build --test_output=errors build --test_summary=terse -# Use C++17. -build --cxxopt=-std=c++17 -build --host_cxxopt=-std=c++17 +# Use C++20. +build --cxxopt=-std=c++20 +build --host_cxxopt=-std=c++20 # https://github.com/bazelbuild/bazel/issues/1164 build --action_env=CCACHE_DISABLE=1 -# For Ubuntu 20.04, we need to opt-out of Clarabel (due to too-old Eigen). -# If you use a different OS, you can comment out or remove the next line. -build --define=NO_CLARABEL=ON - # For Ubuntu builds, this flag can cut build times in half. For macOS builds, # this flag might cause build errors. We suggest turning it on if and only if # your project doesn't use macOS. diff --git a/drake_bazel_external/README.md b/drake_bazel_external/README.md index e31cecbd..51590a56 100644 --- a/drake_bazel_external/README.md +++ b/drake_bazel_external/README.md @@ -10,7 +10,7 @@ For an introduction to Bazel, refer to First, install the required Ubuntu packages: ``` -sudo ../scripts/setup/linux/ubuntu/focal/install_prereqs +sudo ../scripts/setup/linux/ubuntu/jammy/install_prereqs ``` Then, to build and test all apps: diff --git a/drake_bazel_installed/.bazelrc b/drake_bazel_installed/.bazelrc index 29d084cb..6bbaf487 100644 --- a/drake_bazel_installed/.bazelrc +++ b/drake_bazel_installed/.bazelrc @@ -10,9 +10,9 @@ build --strip=never build --test_output=errors build --test_summary=terse -# Use C++17. -build --cxxopt=-std=c++17 -build --host_cxxopt=-std=c++17 +# Use C++20. +build --cxxopt=-std=c++20 +build --host_cxxopt=-std=c++20 # https://github.com/bazelbuild/bazel/issues/1164 build --action_env=CCACHE_DISABLE=1 diff --git a/drake_bazel_installed/README.md b/drake_bazel_installed/README.md index 4e6b8be8..34bd2bbc 100644 --- a/drake_bazel_installed/README.md +++ b/drake_bazel_installed/README.md @@ -11,7 +11,7 @@ For an introduction to Bazel, refer to First, install the required Ubuntu packages: ``` -sudo ../scripts/setup/linux/ubuntu/focal/install_prereqs +sudo ../scripts/setup/linux/ubuntu/jammy/install_prereqs ``` Then, to build and test all apps: diff --git a/drake_bazel_installed/WORKSPACE b/drake_bazel_installed/WORKSPACE index afaec211..383ca03e 100644 --- a/drake_bazel_installed/WORKSPACE +++ b/drake_bazel_installed/WORKSPACE @@ -14,7 +14,7 @@ py_repositories() # Choose which nightly build of Drake to use. DRAKE_RELEASE = "latest" # Can also use YYYYMMDD here, e.g., "20191026". DRAKE_CHECKSUM = "" # When using YYYYMMDD, best to add a checksum here. -OS_CODENAME = "focal" # Permitted values are "focal" or "mac". +OS_CODENAME = "jammy" # Permitted values are "jammy" or "mac". # To use a local unpacked Drake binary release instead of an http download, set # this variable to the correct path, e.g., "/opt/drake". diff --git a/drake_catkin_installed/README.md b/drake_catkin_installed/README.md index 4edcf083..a4a982b8 100644 --- a/drake_catkin_installed/README.md +++ b/drake_catkin_installed/README.md @@ -6,17 +6,17 @@ Drake [binary packages](https://drake.mit.edu/from_binary.html). ## Instructions -If you wish use `catkin` from the Ubuntu package archive, without ROS Noetic, +If you wish use `catkin` from the Ubuntu package archive, without ROS Humble, install the required packages as follows: ``` -sudo ../scripts/setup/linux/ubuntu/focal/install_prereqs +sudo ../scripts/setup/linux/ubuntu/jammy/install_prereqs ``` -If you wish use `catkin` from ROS Noetic package archive, install the required +If you wish use `catkin` from ROS Humble package archive, install the required packages and configure your environment as follows: ``` -sudo ../scripts/setup/linux/ubuntu/focal/install_prereqs --ros-noetic -source /opt/ros/noetic/setup.bash +sudo ../scripts/setup/linux/ubuntu/jammy/install_prereqs --ros-humble +source /opt/ros/humble/setup.bash ``` To build the `drake_catkin_installed` library: diff --git a/drake_cmake_installed/README.md b/drake_cmake_installed/README.md index 790174e5..315a572e 100644 --- a/drake_cmake_installed/README.md +++ b/drake_cmake_installed/README.md @@ -4,14 +4,14 @@ This uses the CMake `find_package(drake)` mechanism to find an installed instanc # Instructions -These instructions are only supported for Ubuntu 20.04 (Focal). +These instructions are only supported for Ubuntu 22.04 (Jammy). ```shell ############################################################### # Install Prerequisites ############################################################### # Various system dependencies -sudo ../scripts/setup/linux/ubuntu/focal/install_prereqs +sudo ../scripts/setup/linux/ubuntu/jammy/install_prereqs # (Optionally) Install GTest # You could also explicitly pull gtest into the CMake build directly: @@ -26,11 +26,11 @@ sudo cp *.a /usr/local/lib ############################################################### # 1) A specific version (date-stamped) -# curl -O https://drake-packages.csail.mit.edu/drake/nightly/drake-20220309-focal.tar.gz +# curl -O https://drake-packages.csail.mit.edu/drake/nightly/drake-20240214-jammy.tar.gz # 2) The latest (usually last night's build) -curl -O https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-focal.tar.gz -tar -xvzf drake-latest-focal.tar.gz -C $HOME +curl -O https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz +tar -xvzf drake-latest-jammy.tar.gz -C $HOME # 3) Manual Installation # git clone https://github.com/RobotLocomotion/drake.git diff --git a/drake_cmake_installed_apt/README.md b/drake_cmake_installed_apt/README.md index 1affe698..03c15cb0 100644 --- a/drake_cmake_installed_apt/README.md +++ b/drake_cmake_installed_apt/README.md @@ -2,7 +2,7 @@ This example uses the [`cmake`](https://cmake.org/) build system with an instance of Drake installed using the -[APT](https://manpages.ubuntu.com/manpages/focal/man8/apt.8.html) package +[APT](https://manpages.ubuntu.com/manpages/jammy/man8/apt.8.html) package manager. ## Instructions diff --git a/scripts/continuous_integration/common/drake_ament_cmake_installed b/scripts/continuous_integration/common/drake_ament_cmake_installed index 3b6f289b..d9976911 100755 --- a/scripts/continuous_integration/common/drake_ament_cmake_installed +++ b/scripts/continuous_integration/common/drake_ament_cmake_installed @@ -5,8 +5,8 @@ set -eo pipefail # AMENT_TRACE_SETUP_FILES and other variables are unbound. -if [[ -f /opt/ros/foxy/setup.bash ]]; then - source /opt/ros/foxy/setup.bash +if [[ -f /opt/ros/humble/setup.bash ]]; then + source /opt/ros/humble/setup.bash fi set -xu diff --git a/scripts/continuous_integration/common/linux_ubuntu_focal b/scripts/continuous_integration/common/linux_ubuntu_jammy similarity index 83% rename from scripts/continuous_integration/common/linux_ubuntu_focal rename to scripts/continuous_integration/common/linux_ubuntu_jammy index 292a0d8e..8991c803 100755 --- a/scripts/continuous_integration/common/linux_ubuntu_focal +++ b/scripts/continuous_integration/common/linux_ubuntu_jammy @@ -8,4 +8,4 @@ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes export DEBIAN_FRONTEND='noninteractive' -./scripts/setup/linux/ubuntu/focal/install_prereqs +./scripts/setup/linux/ubuntu/jammy/install_prereqs diff --git a/scripts/continuous_integration/common/ros_foxy b/scripts/continuous_integration/common/ros_humble similarity index 80% rename from scripts/continuous_integration/common/ros_foxy rename to scripts/continuous_integration/common/ros_humble index ec6575ec..40e9d6d3 100755 --- a/scripts/continuous_integration/common/ros_foxy +++ b/scripts/continuous_integration/common/ros_humble @@ -8,4 +8,4 @@ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes export DEBIAN_FRONTEND='noninteractive' -./scripts/setup/linux/ubuntu/focal/install_prereqs --ros-foxy +./scripts/setup/linux/ubuntu/jammy/install_prereqs --ros-humble diff --git a/scripts/continuous_integration/github_actions/ros_foxy/build_test b/scripts/continuous_integration/github_actions/ros_humble/build_test similarity index 100% rename from scripts/continuous_integration/github_actions/ros_foxy/build_test rename to scripts/continuous_integration/github_actions/ros_humble/build_test diff --git a/scripts/continuous_integration/github_actions/ros_foxy/setup b/scripts/continuous_integration/github_actions/ros_humble/setup similarity index 56% rename from scripts/continuous_integration/github_actions/ros_foxy/setup rename to scripts/continuous_integration/github_actions/ros_humble/setup index bc27a5f1..fe08f90f 100755 --- a/scripts/continuous_integration/github_actions/ros_foxy/setup +++ b/scripts/continuous_integration/github_actions/ros_humble/setup @@ -3,4 +3,4 @@ set -euxo pipefail -./scripts/continuous_integration/common/ros_foxy +./scripts/continuous_integration/common/ros_humble diff --git a/scripts/continuous_integration/github_actions/ubuntu_focal/build_test b/scripts/continuous_integration/github_actions/ubuntu_jammy/build_test similarity index 100% rename from scripts/continuous_integration/github_actions/ubuntu_focal/build_test rename to scripts/continuous_integration/github_actions/ubuntu_jammy/build_test diff --git a/scripts/continuous_integration/github_actions/ubuntu_focal/setup b/scripts/continuous_integration/github_actions/ubuntu_jammy/setup similarity index 52% rename from scripts/continuous_integration/github_actions/ubuntu_focal/setup rename to scripts/continuous_integration/github_actions/ubuntu_jammy/setup index b8c7b4c7..a78ef9c1 100755 --- a/scripts/continuous_integration/github_actions/ubuntu_focal/setup +++ b/scripts/continuous_integration/github_actions/ubuntu_jammy/setup @@ -3,4 +3,4 @@ set -euxo pipefail -./scripts/continuous_integration/common/linux_ubuntu_focal +./scripts/continuous_integration/common/linux_ubuntu_jammy diff --git a/scripts/continuous_integration/jenkins/setup b/scripts/continuous_integration/jenkins/setup index 0df33565..cc74cd18 100755 --- a/scripts/continuous_integration/jenkins/setup +++ b/scripts/continuous_integration/jenkins/setup @@ -3,7 +3,7 @@ set -euxo pipefail -sudo ./scripts/continuous_integration/common/linux_ubuntu_focal +sudo ./scripts/continuous_integration/common/linux_ubuntu_jammy cat > "${HOME}/.bazelrc" << EOF startup --output_user_root=${WORKSPACE}/_bazel_${USER} diff --git a/scripts/setup/linux/ubuntu/focal/Dockerfile b/scripts/setup/linux/ubuntu/jammy/Dockerfile similarity index 98% rename from scripts/setup/linux/ubuntu/focal/Dockerfile rename to scripts/setup/linux/ubuntu/jammy/Dockerfile index 05baf894..d048823b 100644 --- a/scripts/setup/linux/ubuntu/focal/Dockerfile +++ b/scripts/setup/linux/ubuntu/jammy/Dockerfile @@ -27,7 +27,7 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -FROM ubuntu:focal +FROM ubuntu:jammy COPY ./install_prereqs /tmp/install_prereqs RUN export DEBIAN_FRONTEND=noninteractive \ && yes | /tmp/install_prereqs \ diff --git a/scripts/setup/linux/ubuntu/focal/install_prereqs b/scripts/setup/linux/ubuntu/jammy/install_prereqs similarity index 72% rename from scripts/setup/linux/ubuntu/focal/install_prereqs rename to scripts/setup/linux/ubuntu/jammy/install_prereqs index fb8b00de..25ba07b7 100755 --- a/scripts/setup/linux/ubuntu/focal/install_prereqs +++ b/scripts/setup/linux/ubuntu/jammy/install_prereqs @@ -31,16 +31,12 @@ set -euxo pipefail -ros_foxy=0 -ros_noetic=0 +ros_humble=0 while [ "${1:-}" != "" ]; do case "$1" in - --ros-foxy) - ros_foxy=1 - ;; - --ros-noetic) - ros_noetic=1 + --ros-humble) + ros_humble=1 ;; *) echo 'Invalid command line argument' >&2 @@ -57,8 +53,8 @@ fi apt-get update apt-get install --no-install-recommends lsb-release -if [[ "$(lsb_release -sc)" != 'focal' ]]; then - echo 'This script requires Ubuntu 20.04 (Focal Fossa)' >&2 +if [[ "$(lsb_release -sc)" != 'jammy' ]]; then + echo 'This script requires Ubuntu 22.04 (Jammy)' >&2 exit 3 fi @@ -69,7 +65,7 @@ EOF ) wget -O drake.tar.gz \ - https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-focal.tar.gz + https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz trap 'rm -f drake.tar.gz' EXIT tar -xf drake.tar.gz -C /opt @@ -87,41 +83,23 @@ echo 'deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8' \ apt-get update apt-get install --no-install-recommends $(cat < /etc/apt/sources.list.d/ros2-latest.list apt-get update apt-get install --no-install-recommends $(cat < /etc/apt/sources.list.d/ros-latest.list - - apt-get update - apt-get install --no-install-recommends ros-noetic-catkin -fi - - - -if [[ ${ros_foxy} -ne 1 && ${ros_noetic} -ne 1 ]]; then +else apt-get install --no-install-recommends $(cat <