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

[CI Testing] Add manual GHA triggers for Drake PRs #371

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions .github/workflows/bazel_download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ jobs:
uses: actions/checkout@v4
- name: setup
working-directory: drake_bazel_download
run: .github/ubuntu_setup
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--package-url ${{ github.event.inputs.linux_jammy_package_tar }})
fi
.github/ubuntu_setup "${args[@]}"
shell: bash
- name: install_bazelisk
working-directory: drake_bazel_download
run: setup/install_bazelisk
shell: bash
- name: bazel_download build and test
working-directory: drake_bazel_download
run: .github/ci_build_test
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--drake-override)
fi
.github/ci_build_test "${args[@]}"
shell: bash
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@ on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
inputs:
linux_jammy_package_tar:
description: 'Drake linux-jammy-*-packaging .tar.gz artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz'
linux_jammy_package_deb:
description: 'Drake linux-jammy-*-packaging .deb artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-dev_latest-1_amd64-jammy.deb'
mac_arm_sonoma_package_tar:
description: 'Drake mac-arm-sonoma-*-packaging .tar.gz artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-mac-arm64.tar.gz'
linux_jammy_wheel:
description: 'Drake linux-jammy-*-wheel-*-release Python 3.10 artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-cp310-cp310-manylinux_2_35_x86_64.whl'
mac_arm_sonoma_wheel:
description: 'Drake mac-arm-sonoma-*-wheel-*-release Python 3.12 artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-cp312-cp312-macosx_14_0_arm64.whl'
concurrency:
# Cancel previous CI runs when additional commits are added to a pull request.
# This will not cancel CI runs associated with `schedule` or `push`.
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/cmake_installed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ jobs:
sudo rm -rf /Library/Frameworks/Python.framework/
- name: setup
working-directory: drake_cmake_installed
run: setup/install_prereqs
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--package-url ${{ github.event.inputs.mac_arm_sonoma_package_tar }})
fi
setup/install_prereqs "${args[@]}"
shell: zsh -efuo pipefail {0}
- name: cmake_installed build and test
working-directory: drake_cmake_installed
Expand All @@ -40,7 +45,12 @@ jobs:
uses: actions/checkout@v4
- name: setup
working-directory: drake_cmake_installed
run: .github/ubuntu_setup
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--package-url ${{ github.event.inputs.linux_jammy_package_tar }})
fi
.github/ubuntu_setup "${args[@]}"
shell: bash
- name: cmake_installed build and test
working-directory: drake_cmake_installed
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/cmake_installed_apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ jobs:
uses: actions/checkout@v4
- name: setup
working-directory: drake_cmake_installed_apt
run: .github/ubuntu_apt_setup
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--package-url ${{ github.event.inputs.linux_jammy_package_deb }})
fi
.github/ubuntu_apt_setup "${args[@]}"
shell: bash
- name: cmake_installed_apt build and test
working-directory: drake_cmake_installed_apt
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ jobs:
python-version: '3.12'
- name: venv setup and install
working-directory: drake_pip
run: setup/setup_env 3.12
run: |
args=(--python-version '3.12')
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--wheel-url ${{ github.event.inputs.mac_arm_sonoma_wheel }})
fi
setup/setup_env "${args[@]}"
shell: zsh -eufo pipefail {0}
- name: pip build and test
working-directory: drake_pip
Expand All @@ -44,7 +49,12 @@ jobs:
uses: actions/checkout@v4
- name: pip setup
working-directory: drake_pip
run: .github/ubuntu_setup
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--wheel-url ${{ github.event.inputs.linux_jammy_wheel }})
fi
.github/ubuntu_setup "${args[@]}"
shell: bash
- name: pip build and test
working-directory: drake_pip
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ jobs:
working-directory: drake_poetry
run: |
.github/setup
setup/install_prereqs 3.12
args=(--python-version '3.12')
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--wheel-url ${{ github.event.inputs.mac_arm_sonoma_wheel }})
fi
setup/install_prereqs "${args[@]}"
shell: zsh -efuo pipefail {0}
- name: poetry test
working-directory: drake_poetry
Expand All @@ -52,6 +56,10 @@ jobs:
run: |
.github/setup
source $HOME/.profile
setup/install_prereqs
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--wheel-url ${{ github.event.inputs.linux_jammy_wheel }})
fi
setup/install_prereqs "${args[@]}"
.github/ci_build_test
shell: bash
29 changes: 28 additions & 1 deletion drake_bazel_download/.github/ci_build_test
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,32 @@

set -euxo pipefail

drake_override=0

while [ "${1:-}" != "" ]; do
case "$1" in
--drake-override)
drake_override=1
;;
*)
echo 'Invalid command line argument' >&2
exit 1
esac
shift
done

drake_override_flag=()
if [[ ${drake_override} -eq 1 ]]; then
# Use what we installed to $HOME/drake,
# rather than the URL to the most recent nightly release
# found in drake_bazel_download/MODULE.bazel.
drake_override_flag+=("--override_repository=+_repo_rules2+drake=$HOME/drake")

# Setup $HOME/drake as a Bazel workspace via
# BUILD and WORKSPACE files.
ln -sf $(realpath drake.BUILD.bazel) "$HOME/drake/BUILD.bazel"
touch "$HOME/drake/WORKSPACE.bazel"
fi

bazel version
bazel test //...
bazel test "${drake_override_flag[@]}" //...
21 changes: 20 additions & 1 deletion drake_bazel_download/.github/ubuntu_setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,28 @@

set -euxo pipefail

install_args=()

while [ "${1:-}" != "" ]; do
case "$1" in
--package-url)
shift
if [[ $# -eq 0 ]]; then
echo 'No argument specified for --package-url' >&2
exit 1
fi
install_args+=(--package-url $1)
;;
*)
echo 'Invalid command line argument' >&2
exit 1
esac
shift
done

echo 'APT::Acquire::Retries "4";' > /etc/apt/apt.conf.d/80-acquire-retries
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes

export DEBIAN_FRONTEND='noninteractive'

setup/install_prereqs
setup/install_prereqs "${install_args[@]}"
19 changes: 17 additions & 2 deletions drake_bazel_download/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
inputs:
linux_jammy_package_tar:
description: 'Drake linux-jammy-*-packaging .tar.gz artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz'
concurrency:
# Cancel previous CI runs when additional commits are added to a pull request.
# This will not cancel CI runs associated with `schedule` or `push`.
Expand All @@ -27,13 +32,23 @@ jobs:
uses: actions/checkout@v4
- name: setup
working-directory: drake_bazel_download
run: .github/ubuntu_setup
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--package-url ${{ github.event.inputs.linux_jammy_package_tar }})
fi
.github/ubuntu_setup "${args[@]}"
shell: bash
- name: install_bazelisk
working-directory: drake_bazel_download
run: setup/install_bazelisk
shell: bash
- name: bazel_download build and test
working-directory: drake_bazel_download
run: .github/ci_build_test
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--drake-override)
fi
.github/ci_build_test "${args[@]}"
shell: bash
17 changes: 17 additions & 0 deletions drake_bazel_download/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,20 @@ above command prints out; however, be aware that your working directories may
cause differences. This is important when using tools like
`drake::FindResource` / `pydrake.common.FindResource`.
You may generally want to stick to using `bazel run` when able.

### Using a local checkout of Drake

To use an installation of Drake on disk instead of downloaded from github, pass the flag
``--override_repository=+_repo_rules2+drake=/home/user/stuff/drake`` to bazel on the command line
or add a line such as the following to ``user.bazelrc`` in the current directory:

```bash
build --override_repository=+_repo_rules2+drake=/home/user/stuff/drake
```

Note that the local installation of Drake needs the following two files
inside its top-level directory:

* an empty `WORKSPACE.bazel` file
* a symlink or copy of `drake.BUILD.bazel` (found in the current directory
of this example) named `BUILD.bazel`
24 changes: 22 additions & 2 deletions drake_bazel_download/setup/install_prereqs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@

set -euxo pipefail

package_url=

while [ "${1:-}" != "" ]; do
case "$1" in
--package-url)
shift
if [[ $# -eq 0 ]]; then
echo 'No argument specified for --package-url' >&2
exit 1
fi
package_url="$1"
;;
*)
echo 'Invalid command line argument' >&2
exit 1
esac
shift
done

maybe_sudo=
if [[ "${EUID}" -ne 0 ]]; then
maybe_sudo=sudo
Expand All @@ -51,8 +70,9 @@ EOF
)

# Download the drake source
wget -O drake.tar.gz \
https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz
drake_url="https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz"
[[ ! -z "${package_url}" ]] && drake_url="${package_url}"
wget -O drake.tar.gz ${drake_url}
trap 'rm -f drake.tar.gz' EXIT
tar -xf drake.tar.gz -C $HOME

Expand Down
21 changes: 20 additions & 1 deletion drake_cmake_installed/.github/ubuntu_setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,28 @@

set -euxo pipefail

install_args=()

while [ "${1:-}" != "" ]; do
case "$1" in
--package-url)
shift
if [[ $# -eq 0 ]]; then
echo 'No argument specified for --package-url' >&2
exit 1
fi
install_args+=(--package-url $1)
;;
*)
echo 'Invalid command line argument' >&2
exit 1
esac
shift
done

echo 'APT::Acquire::Retries "4";' > /etc/apt/apt.conf.d/80-acquire-retries
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes

export DEBIAN_FRONTEND='noninteractive'

setup/install_prereqs
setup/install_prereqs "${install_args[@]}"
23 changes: 21 additions & 2 deletions drake_cmake_installed/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
inputs:
linux_jammy_package_tar:
description: 'Drake linux-jammy-*-packaging .tar.gz artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz'
mac_arm_sonoma_package_tar:
description: 'Drake mac-arm-sonoma-*-packaging .tar.gz artifact URL'
required: true
default: 'https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-mac-arm64.tar.gz'
concurrency:
# Cancel previous CI runs when additional commits are added to a pull request.
# This will not cancel CI runs associated with `schedule` or `push`.
Expand All @@ -37,7 +46,12 @@ jobs:
sudo rm -rf /Library/Frameworks/Python.framework/
- name: setup
working-directory: drake_cmake_installed
run: setup/install_prereqs
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--package-url ${{ github.event.inputs.mac_arm_sonoma_package_tar }})
fi
setup/install_prereqs "${args[@]}"
shell: zsh -efuo pipefail {0}
- name: cmake_installed build and test
working-directory: drake_cmake_installed
Expand All @@ -52,7 +66,12 @@ jobs:
uses: actions/checkout@v4
- name: setup
working-directory: drake_cmake_installed
run: .github/ubuntu_setup
run: |
args=()
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
args+=(--package-url ${{ github.event.inputs.linux_jammy_package_tar }})
fi
.github/ubuntu_setup "${args[@]}"
shell: bash
- name: cmake_installed build and test
working-directory: drake_cmake_installed
Expand Down
Loading
Loading