Skip to content

Run Jenkins jobs on custom builds of Drake #376

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

Merged
merged 6 commits into from
Apr 11, 2025

Conversation

tyler-yankee
Copy link
Collaborator

@tyler-yankee tyler-yankee commented Mar 6, 2025

This introduces parameters on each of the Jenkins examples to be able to be run the CI jobs with alternative versions of Drake. Towards #22574, and a follow-up of #374.

Parameterization of Individual Examples

  • drake_bazel_external: uses Bazel's --override-module flag when calling bazel test //...
  • drake_bazel_external_legacy: sets the EXAMPLES_LOCAL_DRAKE_PATH environment variable to use the locally pulled copy of Drake
  • drake_cmake_external: adds options to the CMakeLists.txt for the commit hash and sha256 (no longer have to manually comment-out code for this - yay!)

Other Incidental Changes

  • Adds parameters to the setup/install_prereqs and .gitHub/ci_build_test scripts as necessary
  • Explicitly extracts Drake as drake (and adds to .bazelignore, etc.) rather than the default drake-master, since names would be inconsistent with arbitrary commit hashes

Result Workflow

A developer with a PR on Drake could test their changes on DEE by requesting a build from the bot:

@drake-jenkins-bot linux-jammy-unprovisioned-external-examples please

Of course, it's also possible to run via the Jenkins UI. The test Jenkins job has been deleted as part of Jenkins maintenance/updates, but the definition for it is coming via drake-jenkins-jobs #161.


This change is Reviewable

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+@williamjallen and +@Aiden2244 ... how about we do the same sort of thing for feature review on this that we did for #374? Let's hold off on testing @drake-jenkins-bot for now, since it probably should work but I'll need a PR on Drake first. If you want to run a test, run with parameters from this job and make sure to use this branch of DEE.

Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, LGTM missing from assignee aiden2244, platform LGTM missing (waiting on @Aiden2244 and @williamjallen)

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should also note that the pipeline script on the Jenkins job linked above will eventually be put into drake-jenkins-jobs, but I wanted to test and get something working before delving into that adventure.

Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, LGTM missing from assignee aiden2244, platform LGTM missing (waiting on @Aiden2244 and @williamjallen)

Copy link
Collaborator

@Aiden2244 Aiden2244 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: recent Jenkins run matches the example you provided earlier.

Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, platform LGTM missing (waiting on @williamjallen)

Copy link
Collaborator

@Aiden2244 Aiden2244 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, platform LGTM missing (waiting on @williamjallen)

Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a code-only review. Things look good in general, but I'm worried about the duplicated case statements between examples. Does anything verify that they are all the same? Even if all that matters is having the end result be the same, I worry that having different code to do the same or similar tasks in different places will create a maintenance nightmare in the future.

Reviewed 16 of 16 files at r1, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee williamjallen, platform LGTM missing (waiting on @Aiden2244)


drake_cmake_external/.github/ci_build_test line 23 at r1 (raw file):

chmod -R a+w build || true
rm -rf build

This whitespace-only change isn't relevant to the rest of the PR and should be reverted.

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unfortunate that the only thing preventing us from including (drake_bazel_external/setup/install_prereqs, drake_cmake_installed/setup/install_prereqs) in the file_sync_test is the last line, passing --with-bazel to Drake's prereq installation.

Since it's only two examples, and they have some logical grouping (with Jenkins CI), I could see maintenance being slightly annoying in certain cases but not a nightmare.

Reviewable status: 1 unresolved discussion, LGTM missing from assignee williamjallen, platform LGTM missing (waiting on @Aiden2244 and @williamjallen)


drake_cmake_external/.github/ci_build_test line 23 at r1 (raw file):

Previously, williamjallen (William Allen) wrote…

This whitespace-only change isn't relevant to the rest of the PR and should be reverted.

If I understand correctly, this is a whitespace after the newline termination. My editor must have automatically made the change.

I'd argue we're making enough modifications to this file in this PR, that a change to keep the whitespace and newline style consistent with the rest of the code base should be warranted.

Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments have been addressed with reasonable justifications for the current approach.

Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, platform LGTM missing (waiting on @Aiden2244)

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+@jwnimmer-tri for platform review, please!

Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, LGTM missing from assignee jwnimmer-tri, platform LGTM missing (waiting on @Aiden2244 and @jwnimmer-tri)

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 16 of 16 files at r1, all commit messages.
Reviewable status: 4 unresolved discussions, LGTM missing from assignee williamjallen, platform LGTM from [jwnimmer-tri] (waiting on @Aiden2244)


drake_bazel_external/.bazelignore line 1 at r1 (raw file):

# Used for setup, do not build

nit This comment seems stale now? It is used for the build (sometimes).

Ditto in legacy.


drake_bazel_external_legacy/.github/ci_build_test line 10 at r1 (raw file):

# found in drake_bazel_external_legacy/WORKSPACE.
export EXAMPLES_LOCAL_DRAKE_PATH=$(realpath drake)
trap 'unset EXAMPLES_LOCAL_DRAKE_PATH' EXIT

nit Why is this here? Nothing runs after this script, does it? And certainly not with its same shell environment anyway?


drake_cmake_external/README.md line 40 at r1 (raw file):

* `DRAKE_COMMIT_HASH`: the commit hash
* `DRAKE_COMMIT_SHA256`: the checksum of the archive downloaded from GitHub
(download https://github.com/RobotLocomotion/drake/archive/<DRAKE_COMMIT_HASH>.tar.gz

nit I don't like copy-pasting the instructions for checksums into two places. We should remove one copy and (if necessary) replace it with an xref to the intact copy. If we think README is the best place, then the CMakeLists can just declare the variables and xref the README for the semantics and instructions.


drake_cmake_external/.github/ci_build_test line 38 at r1 (raw file):

  cmake_args+=(-DDRAKE_COMMIT_HASH=${drake_commit_hash})

  # Find the SHA-256 by downloading and running shasum.

I'm not sure why this is here. Can't we just leave it blank / unset? That's what we used to do.

If the CMakeLists requires that it's set now, then that's a regression that we need to fix in the CMakeLists. Users should not be strictly required to set it.

Copy link
Collaborator Author

@tyler-yankee tyler-yankee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 3 unresolved discussions, LGTM missing from assignee williamjallen, platform LGTM from [jwnimmer-tri] (waiting on @Aiden2244 and @jwnimmer-tri)


drake_bazel_external_legacy/.github/ci_build_test line 10 at r1 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

nit Why is this here? Nothing runs after this script, does it? And certainly not with its same shell environment anyway?

Yeah that's fair. I was originally just thinking to clean up after ourselves but there shouldn't be a need here.


drake_cmake_external/README.md line 40 at r1 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

nit I don't like copy-pasting the instructions for checksums into two places. We should remove one copy and (if necessary) replace it with an xref to the intact copy. If we think README is the best place, then the CMakeLists can just declare the variables and xref the README for the semantics and instructions.

Makes sense, I'll remove it from the CMakeLists and xref the README (leaving the comment # Options to override Drake's latest source on master with a specific commit. in CMakeLists, though).


drake_cmake_external/.github/ci_build_test line 38 at r1 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

I'm not sure why this is here. Can't we just leave it blank / unset? That's what we used to do.

If the CMakeLists requires that it's set now, then that's a regression that we need to fix in the CMakeLists. Users should not be strictly required to set it.

We can leave it blank and remove this code. I hadn't actually realized that.

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, platform LGTM from [jwnimmer-tri] (waiting on @Aiden2244)

Copy link
Contributor

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, platform LGTM from [jwnimmer-tri] (waiting on @Aiden2244)

Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving again to make Reviewable happy...

Reviewed all commit messages.
Reviewable status: all discussions resolved, LGTM missing from assignee williamjallen, platform LGTM from [jwnimmer-tri] (waiting on @Aiden2244)

Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! all discussions resolved, platform LGTM from [jwnimmer-tri] (waiting on @Aiden2244)

@tyler-yankee tyler-yankee merged commit 1b63c01 into RobotLocomotion:main Apr 11, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants