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

*: support bazel #33691

Merged
merged 6 commits into from
Jun 7, 2022
Merged

*: support bazel #33691

merged 6 commits into from
Jun 7, 2022

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Apr 2, 2022

What problem does this PR solve?

Issue Number: close #34083

Problem Summary:

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Apr 2, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bb7133
  • tisonkun

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 2, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2022

@hawkingrei hawkingrei requested a review from a team as a code owner April 2, 2022 09:47
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 2, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

3 similar comments
@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 3, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 10, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Apr 10, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

2 similar comments
@sre-bot
Copy link
Contributor

sre-bot commented Apr 10, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@sre-bot
Copy link
Contributor

sre-bot commented Apr 10, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@hawkingrei hawkingrei force-pushed the support_bazel branch 3 times, most recently from f4d614c to 7e04912 Compare April 13, 2022 04:26
@zz-jason
Copy link
Member

could you explain more about why adding this support?

@hawkingrei
Copy link
Member Author

hawkingrei commented Apr 13, 2022

could you explain more about why adding this support?

We run thousands of builds and tests in a day. But I find that we have not any local cache and remote cache to speed up ci. so I import the bazel into tidb to solve this problem. I believe that it can boost performance 10x.

@hawkingrei
Copy link
Member Author

could you explain more about why adding this support?

if I meet an unstable test in the CI, I will just rerun this test case by the bazel.
if I have a test case that it just tests util package and util package have not any changes, we can use the remote cache to skip this test.
image

image.png

@sre-bot
Copy link
Contributor

sre-bot commented Apr 13, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@sre-bot
Copy link
Contributor

sre-bot commented Apr 14, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

1 similar comment
@sre-bot
Copy link
Contributor

sre-bot commented Apr 14, 2022

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@hawkingrei hawkingrei force-pushed the support_bazel branch 4 times, most recently from 0ba8159 to 6eb738f Compare June 6, 2022 02:04
@breezewish
Copy link
Member

breezewish commented Jun 6, 2022

Just curious, if these BAZEL files are automatically generated, can they be git-ignored? It's usually not a good practice to include generated files in the git repository.

@hawkingrei
Copy link
Member Author

Just curious, if these BAZEL files are automatically generated, can they be git-ignored? It's usually not a good practice to include generated files in the git repository.

In fact, Some bazel files are automatically generated. for example flaky test (It isn't recommended) and some other config have to be controlled by development such as visibility and test size that controls the test timeout. so it must be with the repo.

BTW, the open resource repos using the bazel like abseil-cpp, cockroach, tensorflow have many BAZEl.build files in their repo.

@breezewish
Copy link
Member

breezewish commented Jun 6, 2022

Just curious, if these BAZEL files are automatically generated, can they be git-ignored? It's usually not a good practice to include generated files in the git repository.

In fact, Some bazel files are automatically generated. for example flaky test (It isn't recommended) and some other config have to be controlled by development such as visibility and test size that controls the test timeout. so it must be with the repo.

BTW, the open resource repos using the bazel like abseil-cpp, cockroach, tensorflow have many BAZEl.build files in their repo.

@hawkingrei Does this mean that we need to manually maintain these BAZEL.build files instead of using auto-generated ones, as the auto-generated ones may not be desired? I would like to know, for example, when I introduced a new package in the TiDB repository (or simply, added a new file), what steps should I take in order to make sure everything works? How these BAZEL files need to be generated? What kind of modification should I make? etc. If these steps are not property done, will my tests just being ignored in CI?

@breezewish
Copy link
Member

Maybe you also need to introduce a CI step to ensure that people doesn't forget to generate necessary BAZEL files? I'm not sure however.

@hawkingrei
Copy link
Member Author

Maybe you also need to introduce a CI step to ensure that people doesn't forget to generate necessary BAZEL files? I'm not sure however.

In fact, Generate bazel config is a task that takes some time in the CI. Althought it take less time than that tests without cache. so I will remove it in the future to speed ci again in the future.

However, Gezalle just can manage the dependency in the bazel config. it cannot manage the other thing. if we need to manage the config such as flasky test and so on. Gazalle just copy the old config to the new config. it is the main reason why we cannot remove bazel.build.

@hawkingrei
Copy link
Member Author

hawkingrei commented Jun 6, 2022

Just curious, if these BAZEL files are automatically generated, can they be git-ignored? It's usually not a good practice to include generated files in the git repository.

In fact, Some bazel files are automatically generated. for example flaky test (It isn't recommended) and some other config have to be controlled by development such as visibility and test size that controls the test timeout. so it must be with the repo.
BTW, the open resource repos using the bazel like abseil-cpp, cockroach, tensorflow have many BAZEl.build files in their repo.

@hawkingrei Does this mean that we need to manually maintain these BAZEL.build files instead of using auto-generated ones, as the auto-generated ones may not be desired? I would like to know, for example, when I introduced a new package in the TiDB repository (or simply, added a new file), what steps should I take in order to make sure everything works? How these BAZEL files need to be generated? What kind of modification should I make? etc. If these steps are not property done, will my tests just being ignored in CI?

For the common developers, It will be fine that they use gazelle to generate the config. For the repo admin, it needs to control the other thing by changing the config in the bazel. in these cases, we need to change the config and save it, so that gazelle can get this changement and keep them in the new config if the dependency has been updated.

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei hawkingrei requested a review from winoros June 7, 2022 05:28
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

I had a few questions which are the same from @tisonkun , and I agree with the feedback, at least for now.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 7, 2022
@bb7133
Copy link
Member

bb7133 commented Jun 7, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 971ee85

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 7, 2022
@ti-chi-bot
Copy link
Member

@hawkingrei: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit 2b4a4c6 into pingcap:master Jun 7, 2022
@hawkingrei hawkingrei deleted the support_bazel branch June 7, 2022 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make CI Faster Again
10 participants