Skip to content

Commit

Permalink
Port from Focal to Jammy
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnimmer-tri committed Feb 23, 2024
1 parent 1e71ba3 commit e3838a4
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 103 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
6 changes: 3 additions & 3 deletions drake_ament_cmake_installed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 3 additions & 7 deletions drake_bazel_external/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion drake_bazel_external/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions drake_bazel_installed/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drake_bazel_installed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion drake_bazel_installed/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
10 changes: 5 additions & 5 deletions drake_catkin_installed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions drake_cmake_installed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drake_cmake_installed_apt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

set -euxo pipefail

./scripts/continuous_integration/common/ros_foxy
./scripts/continuous_integration/common/ros_humble
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

set -euxo pipefail

./scripts/continuous_integration/common/linux_ubuntu_focal
./scripts/continuous_integration/common/linux_ubuntu_jammy
2 changes: 1 addition & 1 deletion scripts/continuous_integration/jenkins/setup
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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 <<EOF
bazel
clang-format-12
cmake
coinor-libclp-dev
coinor-libcoinutils-dev
coinor-libipopt-dev
default-jdk
file
gfortran
git
libblas-dev
libbz2-dev
libclang-12-dev
libdouble-conversion-dev
libexpat1-dev
libclang-14-dev
libeigen3-dev
libgflags-dev
libgl-dev
libglew-dev
libglib2.0-dev
libglx-dev
libjpeg-turbo8-dev
libjsoncpp-dev
liblapack-dev
liblz4-dev
liblzma-dev
libmsgpack-dev
libmumps-seq-dev
libnlopt-cxx-dev
libopengl-dev
libpng-dev
libsuitesparse-dev
libtiff-dev
libtinyxml-dev
libtool
libspdlog-dev
libx11-dev
libxml2-dev
locales
nasm
ocl-icd-opencl-dev
Expand All @@ -132,44 +110,37 @@ apt-get install --no-install-recommends $(cat <<EOF
pkg-config
python-is-python3
python3-all-dev
python3-semantic-version
python3-ipywidgets
python3-matplotlib
python3-munkres
python3-numpy
python3-pil
python3-pydot
python3-pygame
python3-yaml
zlib1g-dev
EOF
)

locale-gen en_US.UTF-8

if [[ ${ros_foxy} -eq 1 ]]; then
if [[ ${ros_humble} -eq 1 ]]; then
apt-key adv --fetch-keys \
https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc
echo 'deb http://packages.ros.org/ros2/ubuntu focal main' \
echo 'deb http://packages.ros.org/ros2/ubuntu jammy main' \
> /etc/apt/sources.list.d/ros2-latest.list

apt-get update
apt-get install --no-install-recommends $(cat <<EOF
python3-colcon-common-extensions
ros-foxy-ament-cmake
ros-foxy-ament-cmake-gtest
ros-foxy-ament-cmake-lint-cmake
ros-foxy-ament-cmake-xmllint
ros-foxy-ament-lint-auto
ros-humble-ament-cmake
ros-humble-ament-cmake-gtest
ros-humble-ament-cmake-lint-cmake
ros-humble-ament-cmake-xmllint
ros-humble-ament-lint-auto
EOF
)
fi

if [[ ${ros_noetic} -eq 1 ]]; then
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 \
--recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
echo 'deb http://packages.ros.org/ros/ubuntu focal main' \
> /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 <<EOF
catkin
python3-pkg-resources
Expand Down

0 comments on commit e3838a4

Please sign in to comment.