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

Add setup functions for velox and build dependencies handled by package managers #8917

Closed

Conversation

majetideepak
Copy link
Collaborator

@majetideepak majetideepak commented Feb 29, 2024

In the current setup scripts, the packages handled by the package manager are always installed
in MacOS, Centos8, and Ubuntu. This is unnecessary if we want to install a specific package.
Make these installs optional by wrapping them around a function.
Split the brew packages on MacOS based on the build vs Velox requirements.

@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 Feb 29, 2024
Copy link

netlify bot commented Feb 29, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit a70d0a0
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6605ddac36575d0008be780a

@majetideepak majetideepak marked this pull request as ready for review March 1, 2024 03:04
@majetideepak majetideepak force-pushed the add-function-system branch from 69a6581 to 52835dc Compare March 1, 2024 03:33
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.

I like it! But from what I can tell you will also need to update the usage of the script across CI/dockerfiles right?

@@ -34,8 +34,8 @@ source $SCRIPTDIR/setup-helper-functions.sh
NPROC=$(getconf _NPROCESSORS_ONLN)

DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
MACOS_DEPS="ninja flex bison cmake ccache protobuf@21 icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl libsodium"

MACOS_VELOX_DEPS="flex bison protobuf@21 icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl libsodium"
Copy link
Collaborator

Choose a reason for hiding this comment

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

that protobuf will currently not be used due to our excat version matching

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://github.com/protocolbuffers/protobuf/releases/tag/v21.5
protobuf@21 is 3.21 which is our exact match?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed it when building on macos that it wasn't used but I didn't look into it more

@majetideepak
Copy link
Collaborator Author

But from what I can tell you will also need to update the usage of the script across CI/dockerfiles right?

if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ];
The default is to install prerequisites. I don't think any changes are required in the current dockerfiles or CI scripts.

@majetideepak majetideepak force-pushed the add-function-system branch 2 times, most recently from 7cbbe0e to 788aa79 Compare March 1, 2024 07:09
@majetideepak
Copy link
Collaborator Author

@assignUser, @kgpai Centos8 script ran here without any issues.
I tested macos changes locally and ubuntu changes on a VM.

@assignUser
Copy link
Collaborator

Ah I missed the default 👍

@majetideepak majetideepak force-pushed the add-function-system branch 2 times, most recently from ea16d8f to 4ae3ada Compare March 2, 2024 09:07
@majetideepak
Copy link
Collaborator Author

We will need to merge #8943 first since the Ubuntu setup script is not invoked correctly.

@majetideepak majetideepak force-pushed the add-function-system branch 3 times, most recently from 7a92a1a to 973e06a Compare March 20, 2024 21:18
@majetideepak
Copy link
Collaborator Author

@assignUser, @kgpai Any comments on this PR? Thanks!

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.

Looks good, some minor comments.

@@ -34,8 +34,8 @@ source $SCRIPTDIR/setup-helper-functions.sh
NPROC=$(getconf _NPROCESSORS_ONLN)

DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)}
MACOS_DEPS="ninja flex bison cmake ccache protobuf@21 icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl libsodium"

MACOS_VELOX_DEPS="flex bison protobuf@21 icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl libsodium"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed it when building on macos that it wasn't used but I didn't look into it more

# installing libunwind first fixes this.
${SUDO} apt install -y libunwind-dev
${SUDO} apt install -y \
g++ \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
g++ \
build-essential \

might be more accurate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

scripts/setup-centos8.sh Show resolved Hide resolved
dnf config-manager --set-enabled powertools
dnf update -y
dnf_install ninja-build cmake curl ccache gcc-toolset-9 git wget which
dnf_install autoconf automake python3 libtool
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
dnf_install autoconf automake python3 libtool
dnf_install autoconf automake python39 python39-devel libtool

It will install 3.6 by default, -devel is for pyvelox

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

Looks good, can you fix conflicts ?

@@ -88,7 +88,7 @@ jobs:

- name: "Install dependencies"
if: ${{ github.event_name == 'pull_request' }}
run: source velox/scripts/setup-ubuntu.sh
run: source velox/scripts/setup-ubuntu.sh && install_build_prerequisites && install_velox_deps_from_apt
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would it be nicer to pass an argument , say install to setup-ubuntu etc that then will run install_build_prerequisites and install_velox_deps_from_apt .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

argument install is ambiguous since it does not specify what to install.
I can add another function install_apt_deps which includes the functions install_build_prerequisites and install_velox_deps_from_apt. How does that sound?
source velox/scripts/setup-ubuntu.sh && install_apt_deps

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks Deepak - that would also work

else
if [ "${INSTALL_PREREQUISITES:-Y}" == "Y" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to add an else saying skipping installation of build prerequisites because of flag so and so..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@majetideepak
Copy link
Collaborator Author

I noticed it when building on macos that it wasn't used but I didn't look into it more

@assignUser what package is this?

@assignUser
Copy link
Collaborator

@majetideepak that was about protobuf@3 iirc but it has been a while so things might have changed both in the script and in brew ^^

@assignUser
Copy link
Collaborator

assignUser commented Mar 22, 2024

Depending on which PR lands first some additional changes will be needed here or in #8862 @kgpai

Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

Looks good, but I would like to ensure that we dont land with red signals from CI; I am hoping to land #9267 soon and hopefully you can rebase on top of that so that we get an all green build.

@@ -88,7 +88,7 @@ jobs:

- name: "Install dependencies"
if: ${{ github.event_name == 'pull_request' }}
run: source velox/scripts/setup-ubuntu.sh
run: source velox/scripts/setup-ubuntu.sh && install_build_prerequisites && install_velox_deps_from_apt
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks Deepak - that would also work

echo "Skipping installation of build dependencies since INSTALL_PREREQUISITES is not set"
fi
# Activate gcc9; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-9/enable || exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to do this twice ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One is in the if branch, and the other is in the else branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe move it out then...

Copy link
Collaborator Author

@majetideepak majetideepak Mar 29, 2024

Choose a reason for hiding this comment

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

Can't move out. In the else branch, we can only enable this after installing build dependencies but before building the packages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The if branch must be only taken if the build dependencies are already installed. The user is expecting to build specific packages.

@majetideepak majetideepak force-pushed the add-function-system branch 2 times, most recently from cb5cac0 to 11a49ab Compare March 28, 2024 04:09
echo "Skipping installation of build dependencies since INSTALL_PREREQUISITES is not set"
fi
# Activate gcc9; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-9/enable || exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe move it out then...

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@kgpai merged this pull request in 8a1d225.

Copy link

Conbench analyzed the 1 benchmark run on commit 8a1d2255.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Real-Chen-Happy pushed a commit to Real-Chen-Happy/velox that referenced this pull request Apr 2, 2024
…ge managers (facebookincubator#8917)

Summary:
In the current setup scripts, the packages handled by the package manager are always installed
in Centos8 and Ubuntu. This is unnecessary if we want to install a specific package.
Make these installs optional by wrapping them around a function.
Split the brew packages on MacOS based on the build vs Velox requirements.

Pull Request resolved: facebookincubator#8917

Reviewed By: xiaoxmeng

Differential Revision: D55506473

Pulled By: kgpai

fbshipit-source-id: 3e4fc31080faac6006dede1808ac9d76cb4b5f60
@majetideepak majetideepak deleted the add-function-system branch May 23, 2024 06:03
Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Jun 7, 2024
…ge managers (facebookincubator#8917)

Summary:
In the current setup scripts, the packages handled by the package manager are always installed
in Centos8 and Ubuntu. This is unnecessary if we want to install a specific package.
Make these installs optional by wrapping them around a function.
Split the brew packages on MacOS based on the build vs Velox requirements.

Pull Request resolved: facebookincubator#8917

Reviewed By: xiaoxmeng

Differential Revision: D55506473

Pulled By: kgpai

fbshipit-source-id: 3e4fc31080faac6006dede1808ac9d76cb4b5f60
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants