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

Fix Thrift dependency when using system Arrow #10355

Closed
wants to merge 1 commit into from

Conversation

PHILO-HE
Copy link
Contributor

@PHILO-HE PHILO-HE commented Jul 1, 2024

With this 0d80228 commit included, velox will resolve dependency by firstly
finding lib arrow from system. In this path, linking with lib thrift is lacking, which
causes thrift header not found issue.

With this pr, velox will try to find thrift lib. If it is not found, velox will build arrow
from source with thrift bundled. If found, lib arrow will be linked with it. This pr
also lets setup scripts install thrift bundled in arrow.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 1, 2024
Copy link

netlify bot commented Jul 1, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit a547494
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/668dd7cc4128990008058520

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 1, 2024

@assignUser, @majetideepak, @pedroerp, this is an urgent fix for CI issue. Please prioritize to review it.

@PHILO-HE PHILO-HE changed the title Fix build issue related to thrift Fix CI build issue related to thrift Jul 1, 2024
@majetideepak majetideepak requested a review from assignUser July 1, 2024 09:09
CMake/FindArrow.cmake Outdated Show resolved Hide resolved
@majetideepak
Copy link
Collaborator

@PHILO-HE why was Thrift not installed from source in the original PR?

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 1, 2024

@PHILO-HE why was Thrift not installed from source in the original PR?

@majetideepak, thanks for your review. CMake only installs arrow libs, not its dependency libs. I will fix it in another pr. We can firstly land this patch to avoid blocking other pr.

BTW, just fixed your comment.

@majetideepak
Copy link
Collaborator

@PHILO-HE a simpler workaround to unblock CI is to bundle Arrow like before.
I opened a PR here #10360
Can you help fix the broken arrow thrift dependency? Thanks!

@majetideepak
Copy link
Collaborator

majetideepak commented Jul 1, 2024

My worry with installing thrift is that it might conflict with fbthrift. Let's first validate the thrift install before we enable auto for Arrow source in CI.

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 1, 2024

My worry with installing thrift is that it might conflict with fbthrift. Let's first validate the thrift install before we enable auto for Arrow source in CI.

@majetideepak, I see. I will continue the fix for thrift dependency here. Thanks!

@tigrux
Copy link
Contributor

tigrux commented Jul 2, 2024

Hello, if this commit, as it is, is merged then it will break the ubuntu builds.
In setup-ubuntu.sh, the package libthrift-dev needs to be removed from the list of packages that are installed.
Otherwise, the build will use the wrong thrift.

@PHILO-HE PHILO-HE changed the title Fix CI build issue related to thrift Fix build issue related to thrift Jul 2, 2024
Copy link
Collaborator

@majetideepak majetideepak left a comment

Choose a reason for hiding this comment

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

@PHILO-HE changes look good to me. Were you able to verify the fix locally?
We can revert the CI job for Linux release with adapters to use auto for Arrow.

@PHILO-HE PHILO-HE force-pushed the fix-thrift branch 2 times, most recently from 99365f8 to a28deb3 Compare July 2, 2024 14:19
@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 2, 2024

Hello, if this commit, as it is, is merged then it will break the ubuntu builds. In setup-ubuntu.sh, the package libthrift-dev needs to be removed from the list of packages that are installed. Otherwise, the build will use the wrong thrift.

@tigrux, I just removed libthrift-dev from setup-ubuntu.sh. Thanks for your comment!

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 2, 2024

@PHILO-HE changes look good to me. Were you able to verify the fix locally? We can revert the CI job for Linux release with adapters to use auto for Arrow.

@majetideepak, yes, I have verified locally. And just reverted Arrow from BUNDLED to AUTO. Thanks!

@majetideepak
Copy link
Collaborator

Looks good to me. I would like @assignUser to make another pass as well.

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 3, 2024

Looks good to me. I would like @assignUser to make another pass as well.

@majetideepak, I note assignUser's Github state is on vacation.
@rui-mo, do you have any comment?

Copy link
Collaborator

@rui-mo rui-mo left a comment

Choose a reason for hiding this comment

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

Thanks. Looks good to me.

Copy link
Collaborator

@majetideepak majetideepak left a comment

Choose a reason for hiding this comment

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

Thanks, @PHILO-HE

@majetideepak majetideepak added the ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall label Jul 3, 2024
@majetideepak majetideepak changed the title Fix build issue related to thrift Install bundled thrift after Arrow system install Jul 3, 2024
@majetideepak majetideepak changed the title Install bundled thrift after Arrow system install Install bundled Thrift after Arrow system install Jul 3, 2024
@majetideepak majetideepak removed the ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall label Jul 3, 2024
@majetideepak
Copy link
Collaborator

@PHILO-HE can you address this issue as well? I want to avoid a conflict. #10378 (comment)
CC: @czentgr

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 3, 2024

@PHILO-HE can you address this issue as well? I want to avoid a conflict. #10378 (comment) CC: @czentgr

@majetideepak, just fixed that comment in the latest commit. Thanks!

@majetideepak majetideepak changed the title Install bundled Thrift after Arrow system install Fix thrift dependency when using system Arrow Jul 3, 2024
@majetideepak majetideepak changed the title Fix thrift dependency when using system Arrow Fix Thrift dependency when using system Arrow Jul 3, 2024
@majetideepak majetideepak added the ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall label Jul 3, 2024
@majetideepak majetideepak requested a review from czentgr July 3, 2024 06:27
@Yohahaha
Copy link
Contributor

Yohahaha commented Jul 3, 2024

@PHILO-HE do you verified this PR in Gluten?

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 3, 2024

@PHILO-HE do you verified this PR in Gluten?

@Yohahaha, just tested in my local. I'm creating a Gluten PR to see whether Gluten CI can pass. Thanks for your reminding!

@PHILO-HE
Copy link
Contributor Author

PHILO-HE commented Jul 4, 2024

No issue is found so far.
@bikramSingh91, could you merge this pr if you have no comment? Thanks!

Copy link
Collaborator

@czentgr czentgr left a comment

Choose a reason for hiding this comment

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

Thank you! I suppose you should also squash the commits?


# Install thrift.
cd _build/thrift_ep-prefix/src/thrift_ep-build
$SUDO cmake --install ./ --prefix /usr/local/
Copy link
Collaborator

Choose a reason for hiding this comment

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

$SUDO isn't defined here. Don't you also need to add the definition in this script like it is done for Ubuntu (and in the functions that call cmake etc)? It isn't inherited from setup-helper-functions.sh.
On Ubuntu it does this:

SUDO="${SUDO:-"sudo --preserve-env"}"

Nit: do we want to use ${SUDO} like in the other scripts?

Copy link
Contributor Author

@PHILO-HE PHILO-HE Jul 10, 2024

Choose a reason for hiding this comment

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

@czentgr, I just removed the use of ${SUDO} in this setup-centos9.sh and ${SUDO} is still not defined with sudo, consistent with other places where cmake_install is used in this script.
BTW, I find sudo is not installed in some centos-9 images used for velox CI. So just defining ${SUDO} without installing sudo can cause execution failure.

@PHILO-HE PHILO-HE force-pushed the fix-thrift branch 2 times, most recently from ba9382b to 188cf14 Compare July 10, 2024 00:21
@facebook-github-bot
Copy link
Contributor

@pedroerp has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@PHILO-HE
Copy link
Contributor Author

@pedroerp, could you please merge this pr? The CI failure is not relevant to this pr. Thanks!

@facebook-github-bot
Copy link
Contributor

@pedroerp merged this pull request in c3dd274.

Copy link

Conbench analyzed the 1 benchmark run on commit c3dd2742.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

PHILO-HE added a commit to PHILO-HE/velox that referenced this pull request Jul 13, 2024
Summary:
With this facebookincubator@0d80228 commit included, velox will resolve dependency by firstly
finding lib arrow from system. In this path, linking with lib thrift is lacking, which
causes thrift header not found issue.

With this pr, velox will try to find thrift lib. If it is not found, velox will build arrow
from source with thrift bundled. If found, lib arrow will be linked with it. This pr
also lets setup scripts install thrift bundled in arrow.

Pull Request resolved: facebookincubator#10355

Reviewed By: bikramSingh91

Differential Revision: D59595645

Pulled By: pedroerp

fbshipit-source-id: 9f26eee8347a6c650e70163554fa9b2b72f5bfac
Copy link
Collaborator

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

Thanks, this is a feasible workaround for now. 👍

-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DARROW_BUILD_STATIC=ON \
-DThrift_SOURCE=BUNDLED
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we remove this we should be able to keep the system thrift and also use that for velox.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@assignUser, seems thrift is not explicitly installed into system in any other places. Here, with Thrift_SOURCE set to BUNDLED and the following code to install it, velox build can use the thrift after setup script is executed. Right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, nice trick installing arrows build thrift :D

bdice added a commit to bdice/velox that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants