Skip to content

Bazel distribtests#25318

Open
gnossen wants to merge 7 commits intogrpc:masterfrom
gnossen:bazel_distribtests
Open

Bazel distribtests#25318
gnossen wants to merge 7 commits intogrpc:masterfrom
gnossen:bazel_distribtests

Conversation

@gnossen
Copy link
Copy Markdown
Contributor

@gnossen gnossen commented Feb 1, 2021

This PR adds Bazel Distribtests, officially codifying our supported range of Bazel versions. Two new CI jobs are added, whose triggers are TBD:

  • Basic Distribtests - Runs bazel build on all supported Bazel versions, based on a manually curated list.
  • Bazel Latest Version Distribtest - Pulls down and builds with the latest version of Bazel.

Several targets are currently on a blocklist due to preexisting build failures. A next step is to triage this build errors and have them either fixed or removed.

One snag -- upb doesn't currently support our range of builds. An older version of their repo supports the 2.X series, while the commit I've introduced in this PR supports 3+. I've added a check for the Bazel version and manually swap out the upb version based on the Bazel version. This pattern should be moved to the upb repo so it can support multiple Bazel versions and we can remove the check from our repo.

@gnossen gnossen marked this pull request as ready for review February 1, 2021 17:20
@jtattermusch
Copy link
Copy Markdown
Contributor

FYI The toolchain problem is the same as in here: #25001


set -ex

shopt -s nullglob
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: why do you need this? same for the other .sh files.

"x64_windows_msys": ":cc-compiler-x64_windows_msys",
"x64_windows": ":cc-compiler-x64_windows",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
"k8": ":_dummy_toolchain",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why the changes? this file is autogenerated AFAIK so I don't feel comfortable updating it manually.
Would regenerating the BUILD help?
go/rbe-windows-user-guide

@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2017 gRPC authors.
# Copyright 2020 The gRPC authors.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems unrelated to this PR? revert?

# See the License for the specific language governing permissions and
# limitations under the License.

# Build portability tests with an updated submodule
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this comment is now out of date


cd "$(dirname "$0")"/../../..

EXCEPTIONS=(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: rename to EXCLUDED_TARGETS or EXCLUDED_PATTERNS (as you wish)?

@@ -0,0 +1,45 @@
# Copyright 2021 The gRPC authors.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

since you're adding this file, I think we need to cherrypick this PR into an import and see if this works internally as well.

@@ -0,0 +1,26 @@
# Copyright 2017 gRPC authors.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally I think we should avoid creating more kokoro jobs as these become hard to maintain, but for now I don't have a better alternative, so creating the 2 new kokoro jobs seems acceptable.

)


def bc_platform(**kwargs):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you really need the bc_platform function?

In my PR this seemed to be the same case as create_rbe_exec_properties_dict
https://github.com/grpc/grpc/pull/25001/files#diff-e084337b59570d9fb8e3d40828b096dddf9056a9096eb32b44ceeb7fbb0383fcR33

)

for VERSION in "${SUPPORTED_VERSIONS[@]}"; do
./test_single_bazel_version.sh "$VERSION"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: the output of 4 consecutive builds is going to be difficult to parse by humans.
Ideally these would be 4 independent "tasks".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we instead add 4-5 tasks into distribtest_targets.py and save on needing to define 2 new kokoro jobs?
That would also make the output of the separate builds separated.



export OVERRIDE_BAZEL_VERSION="$VERSION"
printf ' -%s' "${EXCEPTIONS[@]}" | xargs bazel build -- //...
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this can be addressed later, but one thing this distribtest doesn't cover is depending upon grpc as a library in a simple "helloworld" project. Like this we will know that gRPC builds fine, but not whether it can be safely imported as a dependency.

@stale
Copy link
Copy Markdown

stale bot commented Jun 2, 2021

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@stale
Copy link
Copy Markdown

stale bot commented Sep 19, 2021

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@jtattermusch
Copy link
Copy Markdown
Contributor

Is this still blocked on the bazel toolchain update (same as in #25001). It would be good to address this somehow and unblock this functionality. This PR has been open for >6months now.

@jtattermusch
Copy link
Copy Markdown
Contributor

I upgraded the repo to bazel 4.2.1, which makes many changes in this PR unnecessary:
#27410

@jtattermusch
Copy link
Copy Markdown
Contributor

This needs to be rebased / updated now that #27486 has been merged.

@stale
Copy link
Copy Markdown

stale bot commented Jan 3, 2022

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@jtattermusch
Copy link
Copy Markdown
Contributor

@gnossen let's revive this.

@jtattermusch
Copy link
Copy Markdown
Contributor

This PR is very out of date and we might not need the compatibility layer for bazel 2.x anymore (since we support bazel 3.x,4.x and 5.x now), so I'm going to remove myself from the reviewer list.
Consider updating / closing the PR.

@jtattermusch jtattermusch removed their assignment Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants