Skip to content

feat(bazel): use new rbe_autoconfig() and new container. - #29336

Closed
xingao267 wants to merge 1 commit into
angular:masterfrom
xingao267:toolchain
Closed

xingao267 wants to merge 1 commit into
angular:masterfrom
xingao267:toolchain

Conversation

@xingao267

@xingao267 xingao267 commented Mar 15, 2019 •

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

The CI is currently using a container not maintained by RBE Toolchain team. I'm updating it to a container maintained by us.

I also enabled usage of rbe_autoconfig() repository rule, a rule that can dynamically select toolchain configs from @bazel_toolchains repo if available or generate the configs on the fly if not available.

Does this PR introduce a breaking change?

  • Yes
  • No

@xingao267
xingao267 requested a review from a team March 15, 2019 17:58
@mhevery mhevery added the area: bazel Issues related to the published `@angular/bazel` build rules label Mar 19, 2019
@ngbot ngbot Bot added this to the needsTriage milestone Mar 19, 2019
@xingao267

Copy link
Copy Markdown
Contributor Author

Read for review now.

@xingao267

Copy link
Copy Markdown
Contributor Author

cc @nlopezgi

@xingao267 xingao267 changed the title DO NOT REVIEW, TESTING feat(bazel): use new rbe_autoconfig() and new container. feat(bazel): use new rbe_autoconfig() and new container. Mar 28, 2019
Comment thread tools/BUILD.bazel Resolved
Comment thread WORKSPACE Resolved
@xingao267

Copy link
Copy Markdown
Contributor Author

@alexeagle @mhevery could you help take a look?

@xingao267

Copy link
Copy Markdown
Contributor Author

@alexeagle @mhevery friendly ping~

@alexeagle alexeagle left a comment

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.

sorry I missed this - you can reach out over chat. My github notification volume is too high for me to keep up with it.

Comment thread .bazelrc Outdated

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.

what's your reasoning for removing the files from third_party?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We are deprecating those bazelrc file per bazel version from bazel-toolchains repo. And the generic one will not work for this project.

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.

I think this is still far too much configuration to ask users to copy-paste into their project to use remote build execution and will significantly hamper the story for Angular users who want to have this mostly managed for them. Could we schedule a quick chat with Geoffrey to discuss?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will schedule a meeting. +@nlopezgi who owns the new rbe_repo() rule.

Comment thread .bazelrc Outdated

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.

we don't have any Closure or Java code. why would we want these lines? this is why I had vendored the file from the bazel-toolchains repo.

Imagine that this file was used by Angular users. I wouldn't want their configuration to have all these bits either. It's totally unergonomic.

Comment thread WORKSPACE Outdated

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.

is this part of RBE on-boarding now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Comment thread WORKSPACE Outdated

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 are Clang and JDK involved? we don't have any Java or C++ code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For Java, see the reasoning here GoogleCloudPlatform/container-definitions#52. For Clang, there is at least one cc_binary target dependency in this repo: https://github.com/angular/angular/blob/master/packages/bazel/src/ng_rollup_bundle.bzl#L197 which is a cc_binary (https://github.com/google/brotli/blob/master/BUILD#L130). If you can remove that dependency, I can try to remove the clang layer from the container.

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.

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.

that PR has landed so this is unblocked, can remove clang now

@xingao267

Copy link
Copy Markdown
Contributor Author

@alexeagle I tried the new container without a c compiler installed. And it failed due to there is cc dependencies in com_google_protobuf. See test failures here https://circleci.com/gh/angular/angular/298502?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

@xingao267

Copy link
Copy Markdown
Contributor Author

I'm going to modify this PR to revert back to using the container with clang installed.

@xingao267

Copy link
Copy Markdown
Contributor Author

@alexeagle this is ready for review again.

Comment thread WORKSPACE Outdated

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.

as discussed on chat, the dependency on clang is a bug and should be fixed. I'd rather fix it before landing a workaround since paying tech debt is a lot harder than not introducing it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This tech debt and workaround is not introduced today or by this PR. The container that all current Angular's RBE builds use (gcr.io/asci-toolchain/nosla-ubuntu16_04-webtest) has Clang installed. Comparing to that container, this new container removed Go layer and few other debs that are not used by current Angular project, which is an improvement. And this container is being actively maintained and updated with new features and latest security patches.

Regarding removing the Angular's dependency on protoc or Clang, we should either open a bug to Bazel team or Angular project's maintainer to fix it. After that is done, our team can test and hopefully remove Clang layer from this container. But I don't think that work should block merging this PR at all.

After this PR is merged, maintainers no longer need to update .bazelrc
file, toolchain and platform related flags for RBE builds and tests
(unless there is a breaking change in Bazel related to those flags).

Maintainers just need to update the pin of @bazel-toolchains repo
regularly in the packages/bazel/package.bzl file according to
https://releases.bazel.build/bazel-toolchains.html to include the
latest checked-in toolchain configs. If rbe_autoconfig() cannot find
appropriate toolchain configs for the version of Bazel in the version of
@bazel_toolchains repo that is currently used by this project, it will pull
down the container and generate the configs on the fly as the beginning
of the build/test.
@xingao267
xingao267 requested a review from a team May 9, 2019 18:34
@alexeagle

Copy link
Copy Markdown
Contributor

Going to try kiilling the clang dependency by excluding the one skydoc target from the remote execution

@xingao267

Copy link
Copy Markdown
Contributor Author

@alexeagle alexeagle added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels May 9, 2019
alxhub pushed a commit that referenced this pull request May 9, 2019
After this PR is merged, maintainers no longer need to update .bazelrc
file, toolchain and platform related flags for RBE builds and tests
(unless there is a breaking change in Bazel related to those flags).

Maintainers just need to update the pin of @bazel-toolchains repo
regularly in the packages/bazel/package.bzl file according to
https://releases.bazel.build/bazel-toolchains.html to include the
latest checked-in toolchain configs. If rbe_autoconfig() cannot find
appropriate toolchain configs for the version of Bazel in the version of
@bazel_toolchains repo that is currently used by this project, it will pull
down the container and generate the configs on the fly as the beginning
of the build/test.

PR Close #29336
@alxhub alxhub closed this in 9abf114 May 9, 2019
BioPhoton pushed a commit to BioPhoton/angular that referenced this pull request May 21, 2019
After this PR is merged, maintainers no longer need to update .bazelrc
file, toolchain and platform related flags for RBE builds and tests
(unless there is a breaking change in Bazel related to those flags).

Maintainers just need to update the pin of @bazel-toolchains repo
regularly in the packages/bazel/package.bzl file according to
https://releases.bazel.build/bazel-toolchains.html to include the
latest checked-in toolchain configs. If rbe_autoconfig() cannot find
appropriate toolchain configs for the version of Bazel in the version of
@bazel_toolchains repo that is currently used by this project, it will pull
down the container and generate the configs on the fly as the beginning
of the build/test.

PR Close angular#29336
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: bazel Issues related to the published `@angular/bazel` build rules cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants