Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move GHA prereqs to examples and refactor #321

Merged
merged 33 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6cb222b
Move GHA prereqs to examples and refactor
nicolecheetham Oct 2, 2024
0dca1fe
Use new example prereqs path for ubuntu setups
nicolecheetham Oct 2, 2024
81eaf40
Add exec perms to prereqs and fi to ros prereq
nicolecheetham Oct 2, 2024
b9c525e
Remove bazel from non bazel examples
nicolecheetham Oct 2, 2024
1623397
Remove catkin from non catkin examples
nicolecheetham Oct 2, 2024
9ccdb0d
Try to remove python3-pkg-resources
nicolecheetham Oct 2, 2024
4d71719
Remove locales
nicolecheetham Oct 2, 2024
45a85f8
Remove python3-all-dev
nicolecheetham Oct 2, 2024
a54d0a8
Add back python3-all-dev for cmake installed
nicolecheetham Oct 2, 2024
f2da4d9
Remove pkg-config from binary prereqs
nicolecheetham Oct 3, 2024
f7cbd6a
Remove libgflags-dev from binary prereqs
nicolecheetham Oct 3, 2024
d46c49d
Add back libgflags-dev for cmake_installed
nicolecheetham Oct 3, 2024
a445017
Remove bazel fetch from non bazel examples
nicolecheetham Oct 3, 2024
cd4e35d
Remove gnupg
nicolecheetham Oct 3, 2024
62fe172
Add back gnupg for ros and bazel download
nicolecheetham Oct 3, 2024
3851cac
Remove echo VERSION.TXT
nicolecheetham Oct 3, 2024
439ec2b
Unsync ubuntu_setup due to diff file paths
nicolecheetham Oct 3, 2024
589ae66
Use relative path to prereqs for ros setup
nicolecheetham Oct 3, 2024
67b586c
Add . to ros path to try using relative path
nicolecheetham Oct 3, 2024
472d98f
add " around .. for ros relative path
nicolecheetham Oct 3, 2024
111eb57
Modify ros path to relative using BASH_SOURCE
nicolecheetham Oct 7, 2024
c9a71fd
Change ubuntu setups absolute path to relative
nicolecheetham Oct 7, 2024
3f66d80
Simplify relative ubuntu setup paths
nicolecheetham Oct 9, 2024
499528f
Simplify bazel download ubuntu setup relative path
nicolecheetham Oct 9, 2024
b9a28df
Rename prereqs files
nicolecheetham Oct 9, 2024
cb82280
Add back debug help + ubuntu setup sync
nicolecheetham Oct 9, 2024
34d79cc
Single prereqs script for cmake_installed dir
nicolecheetham Oct 11, 2024
4b3d447
Check if original mac prereqs work
nicolecheetham Oct 11, 2024
7c2f3ac
Move brew install pos in mac setup
nicolecheetham Oct 11, 2024
5e65a2e
Modify main prereq mac brew to use BASH_SOURCE
nicolecheetham Oct 11, 2024
c1e93ab
Remove mac only prereq script
nicolecheetham Oct 11, 2024
bc0859b
Remove --mac in GHA ci
nicolecheetham Oct 11, 2024
f44b0c9
Merge branch 'main' into gha_binary_move
nicolecheetham Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
- name: setup
run: ./drake_cmake_installed/setup/mac/install_prereqs
run: ./drake_cmake_installed/setup/install_prereqs
shell: zsh -efuo pipefail {0}
- name: cmake_installed build and test
run: ./drake_cmake_installed/.github/ci_build_test
Expand Down
3 changes: 2 additions & 1 deletion drake_ament_cmake_installed/.github/ros_humble_setup
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes

export DEBIAN_FRONTEND='noninteractive'

./scripts/setup/linux/ubuntu/jammy/binary_install_prereqs --ros-humble
cd $(dirname "${BASH_SOURCE}")/..
setup/install_prereqs --ros-humble
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,6 @@ echo -e "\ndrake VERSION.TXT: $(cat /opt/drake/share/doc/drake/VERSION.TXT)\n"

apt-get install --no-install-recommends gnupg

apt-key adv --fetch-keys https://bazel.build/bazel-release.pub.gpg
echo 'deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8' \
> /etc/apt/sources.list.d/bazel.list

apt-get update
apt-get install --no-install-recommends $(cat <<EOF
bazel
libgflags-dev
locales
pkg-config
python3-all-dev
EOF
)

locale-gen en_US.UTF-8

if [[ ${ros_humble} -eq 1 ]]; then
apt-key adv --fetch-keys \
https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc
Expand All @@ -108,10 +92,4 @@ if [[ ${ros_humble} -eq 1 ]]; then
ros-humble-ament-lint-auto
EOF
)
else
apt-get install --no-install-recommends $(cat <<EOF
catkin
python3-pkg-resources
EOF
)
fi
fi
3 changes: 2 additions & 1 deletion drake_bazel_download/.github/ubuntu_setup
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes

export DEBIAN_FRONTEND='noninteractive'

./scripts/setup/linux/ubuntu/jammy/binary_install_prereqs
cd $(dirname "${BASH_SOURCE}")/..
setup/install_prereqs
73 changes: 73 additions & 0 deletions drake_bazel_download/setup/install_prereqs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/bash

# Copyright (c) 2020, Massachusetts Institute of Technology.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

set -euxo pipefail

if [[ "${EUID:-}" -ne 0 ]]; then
echo 'This script must be run as root' >&2
exit 2
fi

apt-get update
apt-get install --no-install-recommends lsb-release

if [[ "$(lsb_release -sc)" != 'jammy' ]]; then
echo 'This script requires Ubuntu 22.04 (Jammy)' >&2
exit 3
fi

apt-get install --no-install-recommends $(cat <<EOF
ca-certificates
wget
EOF
)

wget -O drake.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

# Show version for debugging; use echo for newline / readability.
echo -e "\ndrake VERSION.TXT: $(cat /opt/drake/share/doc/drake/VERSION.TXT)\n"

/opt/drake/share/drake/setup/install_prereqs

apt-get install --no-install-recommends gnupg

apt-key adv --fetch-keys https://bazel.build/bazel-release.pub.gpg
echo 'deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8' \
> /etc/apt/sources.list.d/bazel.list

apt-get update
apt-get install --no-install-recommends $(cat <<EOF
bazel
EOF
)
3 changes: 2 additions & 1 deletion drake_catkin_installed/.github/ubuntu_setup
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes

export DEBIAN_FRONTEND='noninteractive'

./scripts/setup/linux/ubuntu/jammy/binary_install_prereqs
cd $(dirname "${BASH_SOURCE}")/..
setup/install_prereqs
66 changes: 66 additions & 0 deletions drake_catkin_installed/setup/install_prereqs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

# Copyright (c) 2020, Massachusetts Institute of Technology.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

set -euxo pipefail

if [[ "${EUID:-}" -ne 0 ]]; then
echo 'This script must be run as root' >&2
exit 2
fi

apt-get update
apt-get install --no-install-recommends lsb-release

if [[ "$(lsb_release -sc)" != 'jammy' ]]; then
echo 'This script requires Ubuntu 22.04 (Jammy)' >&2
exit 3
fi

apt-get install --no-install-recommends $(cat <<EOF
ca-certificates
wget
EOF
)

wget -O drake.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

# Show version for debugging; use echo for newline / readability.
echo -e "\ndrake VERSION.TXT: $(cat /opt/drake/share/doc/drake/VERSION.TXT)\n"

/opt/drake/share/drake/setup/install_prereqs

apt-get install --no-install-recommends $(cat <<EOF
catkin
EOF
)
3 changes: 2 additions & 1 deletion drake_cmake_installed/.github/ubuntu_setup
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes

export DEBIAN_FRONTEND='noninteractive'

./scripts/setup/linux/ubuntu/jammy/binary_install_prereqs
cd $(dirname "${BASH_SOURCE}")/..
setup/install_prereqs
96 changes: 96 additions & 0 deletions drake_cmake_installed/setup/install_prereqs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/bash

# Copyright (c) 2020, Massachusetts Institute of Technology.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

set -euxo pipefail

case "$OSTYPE" in
darwin*)
# Mac specific installations
if [[ "${EUID}" -eq 0 ]]; then
echo 'This script must NOT be run as root' >&2
exit 1
fi

if [[ ! -d /opt/drake ]]; then
sudo mkdir -p /opt/drake
sudo chmod g+rwx /opt/drake
sudo chown "${USER}" /opt/drake
sudo chgrp admin /opt/drake
fi

# Install Drake dependencies.
curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-mac-arm64.tar.gz
trap 'rm -f drake.tar.gz' EXIT
tar -xf drake.tar.gz -C /opt

# Install additional dependencies needed to build example
brew bundle --file="$(dirname "${BASH_SOURCE}")/Brewfile"
;;

linux*)
# Ubuntu specific installations
if [[ "${EUID:-}" -ne 0 ]]; then
echo 'This script must be run as root' >&2
exit 2
fi

apt-get update
apt-get install --no-install-recommends lsb-release

if [[ "$(lsb_release -sc)" != 'jammy' ]]; then
echo 'This script requires Ubuntu 22.04 (Jammy)' >&2
exit 3
fi

apt-get install --no-install-recommends $(cat <<EOF
ca-certificates
wget
EOF
)

wget -O drake.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

apt-get update
apt-get install --no-install-recommends $(cat <<EOF
libgflags-dev
python3-all-dev
EOF
)
;;
esac

# Show version for debugging; use echo for newline / readability.
echo -e "\ndrake VERSION.TXT: $(cat /opt/drake/share/doc/drake/VERSION.TXT)\n"

/opt/drake/share/drake/setup/install_prereqs
29 changes: 0 additions & 29 deletions drake_cmake_installed/setup/mac/install_prereqs

This file was deleted.

10 changes: 5 additions & 5 deletions private/test/file_sync_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"drake_cmake_installed/.clang-format",
"drake_cmake_installed_apt/.clang-format",
),
(
"drake_bazel_download/.github/ubuntu_setup",
"drake_catkin_installed/.github/ubuntu_setup",
"drake_cmake_installed/.github/ubuntu_setup",
),
(
"drake_ament_cmake_installed/CPPLINT.cfg",
"drake_bazel_download/CPPLINT.cfg",
Expand All @@ -39,11 +44,6 @@
"drake_cmake_installed/LICENSE",
"drake_cmake_installed_apt/LICENSE",
),
(
"drake_bazel_download/.github/ubuntu_setup",
"drake_catkin_installed/.github/ubuntu_setup",
"drake_cmake_installed/.github/ubuntu_setup",
),
)

found_errors = False
Expand Down