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

Bundle grpc/protobuf in tiflash #3896

Merged
merged 28 commits into from
Jan 21, 2022
Merged

Conversation

zanmato1984
Copy link
Contributor

@zanmato1984 zanmato1984 commented Jan 19, 2022

What problem does this PR solve?

Problem Summary: Currently developing tiflash requires pre-installing grpc/protobuf (and in a weird way), this is a lot pain for most developers. We'd better bundle grpc/protobuf within tiflash, like other third party libraries.

What is changed and how it works?

Add grpc/protobuf and dependent submodules, and enhance cmake finding. Most cmake changes are copied from upstream ClickHouse with some minor tweaks.

Another problem is how to co-work with kvproto/tipb/client-c(which depends on kvproto as well) who depend on grpc/protobuf as well. Thanks to @JaySon-Huang 's great work in pingcap/kvproto#775, pingcap/tipb#230, this has been made relatively easy. I made separated changes pingcap/kvproto#853, pingcap/tipb#257, tikv/client-c#84 in these submodules.

Check List

Side effects

Basically no side effects if you build tiflash using bundled grpc/protobuf (the default option), except for the first time you'll have to pull more submodules and build them, but that's mostly a one-time deal.

If you go with the old-fashioned way, i.e., build tiflash using your own grpc/protobuf, you can use cmake option:

cmake -DUSE_INTERNAL_PROTOBUF_LIBRARY=FALSE -DUSE_INTERNAL_GRPC_LIBRARY=FALSE ...

If your gprc/protobuf is not located in system default path, you can use extra option to specify it:

cmake -DUSE_INTERNAL_PROTOBUF_LIBRARY=FALSE -DUSE_INTERNAL_GRPC_LIBRARY=FALSE -DPREBUILT_LIBS_ROOT="<PATH1>;<PATH2>..." ...

This has been tested on:

  • My local Mac, with pre-installed dynamic grpc/protobuf lib (brew installed) - working;
  • My local Mac, with pre-installed static grpc/protobuf lib (built from source, twice) - working;
  • Linux, with pre-installed dynamic grpc/protobuf lib (apt/yum) - untested;
  • Linux, with pre-installed static grpc/protobuf lib (built from source, twice) - failed by linking error, not sure why and I'm not planning dig into it for now;

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 Jan 19, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang

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 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 19, 2022
@zanmato1984
Copy link
Contributor Author

/run-all-tests

@zanmato1984
Copy link
Contributor Author

/run-all-tests

@solotzg
Copy link
Contributor

solotzg commented Jan 19, 2022

How about openssl?

@sre-bot
Copy link
Collaborator

sre-bot commented Jan 19, 2022

Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/1069/cobertura/
(Coverage detail url is limited office network access)

lines: 44.7% (51498 out of 115169)
branches: 7.0% (89810 out of 1275204)

.gitmodules Outdated Show resolved Hide resolved
@zanmato1984
Copy link
Contributor Author

How about openssl?

This PR doesn't change the way how openssl is used. We may come back to it in another thread.

@zanmato1984
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@zanmato1984: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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
Copy link
Member

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

Commit hash: 571a628

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 21, 2022
@JaySon-Huang
Copy link
Contributor

/cc @SchrodingerZhu , This PR would affect the build docker image of the toolchain upgrade.

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jan 21, 2022
@zanmato1984
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@zanmato1984: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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
Copy link
Member

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

Commit hash: a5853d4

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 21, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Jan 21, 2022

Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/1109/cobertura/
(Coverage detail url is limited office network access)

lines: 44.7% (51532 out of 115235)
branches: 7.0% (89834 out of 1274914)

@ti-chi-bot ti-chi-bot merged commit 522d4ac into pingcap:master Jan 21, 2022
@zanmato1984 zanmato1984 deleted the bundle-grpc branch January 21, 2022 11:18
LittleFall referenced this pull request in LittleFall/tics Mar 21, 2022
Fully rename project to tiflash (#3901)

Conflicts:
	libs/libdaemon/cmake/find_unwind.cmake

Remove useless curl dependency (#3974)

Bundle all dependencies: zlib, openssl and curl (#3987)

Conflicts:
	contrib/poco

update contrib/poco

update ci/cd process

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

fix zlib-ng

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>
LittleFall referenced this pull request in LittleFall/tics Mar 21, 2022
Fully rename project to tiflash (#3901)

Conflicts:
	libs/libdaemon/cmake/find_unwind.cmake

Remove useless curl dependency (#3974)

Bundle all dependencies: zlib, openssl and curl (#3987)

Conflicts:
	contrib/poco

update contrib/poco

update ci/cd process

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

fix zlib-ng

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>
LittleFall pushed a commit to LittleFall/tiflash that referenced this pull request Apr 6, 2022
Fully rename project to tiflash (pingcap#3901)

Conflicts:
	libs/libdaemon/cmake/find_unwind.cmake

Remove useless curl dependency (pingcap#3974)

Bundle all dependencies: zlib, openssl and curl (pingcap#3987)

Conflicts:
	contrib/poco

update contrib/poco

update ci/cd process

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

fix zlib-ng

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

extra fix

formatted
LittleFall pushed a commit to LittleFall/tiflash that referenced this pull request Apr 6, 2022
Fully rename project to tiflash (pingcap#3901)

Conflicts:
	libs/libdaemon/cmake/find_unwind.cmake

Remove useless curl dependency (pingcap#3974)

Bundle all dependencies: zlib, openssl and curl (pingcap#3987)

Conflicts:
	contrib/poco

update contrib/poco

update ci/cd process

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

fix zlib-ng

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

extra fix

formatted

fix: remove dttool, unify definition

fix: add functions

fix: replace ClickHouse to TiFlash
LittleFall pushed a commit to LittleFall/tiflash that referenced this pull request Apr 6, 2022
Fully rename project to tiflash (pingcap#3901)

Conflicts:
	libs/libdaemon/cmake/find_unwind.cmake

Remove useless curl dependency (pingcap#3974)

Bundle all dependencies: zlib, openssl and curl (pingcap#3987)

Conflicts:
	contrib/poco

update contrib/poco

update ci/cd process

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

fix zlib-ng

Signed-off-by: Zhigao Tong <tongzhigao@pingcap.com>

extra fix

formatted

fix: remove dttool, unify definition

fix: add functions

fix: replace ClickHouse to TiFlash

fix: update dtpb cmake

fix: compile issue

fmt

fix: gtests

fix: gtests scripts
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/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants