Skip to content

[native ] Fix setup scripts to align with Velox setup scripts#22448

Merged
majetideepak merged 1 commit intoprestodb:masterfrom
majetideepak:fix-setup-script
Apr 23, 2024
Merged

[native ] Fix setup scripts to align with Velox setup scripts#22448
majetideepak merged 1 commit intoprestodb:masterfrom
majetideepak:fix-setup-script

Conversation

@majetideepak
Copy link
Collaborator

@majetideepak majetideepak commented Apr 8, 2024

Description

Velox setup scripts have been modified to not install the build dependencies by default.
Fix setup scripts to adopt that behavior.
Fix setup scripts to encapsulate presto packages into a function.
Fix setup-centos8.sh script to include Velox dependencies.

Motivation and Context

Above

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
== NO RELEASE NOTE ==

@majetideepak majetideepak force-pushed the fix-setup-script branch 2 times, most recently from d0cbecf to 012cffd Compare April 8, 2024 16:22
@majetideepak majetideepak changed the title [native ] Fix setup script [native ] Fix setup scripts Apr 10, 2024
@majetideepak majetideepak changed the title [native ] Fix setup scripts [native ] Fix setup scripts to optionally install build dependencies Apr 10, 2024
@majetideepak majetideepak force-pushed the fix-setup-script branch 2 times, most recently from 8bd92bc to a7b6887 Compare April 18, 2024 00:57
source "$(dirname "${BASH_SOURCE}")/../velox/scripts/setup-macos.sh"

MACOS_DEPS="${MACOS_DEPS} bison gperf"
MACOS_VELOX_DEPS="${MACOS_VELOX_DEPS} gperf"
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 include MACOS_VELOX_DEPS?
The sourcing of the velox setup-macos script would set this but is the idea that brew will install both velox and prestissimo deps. This would then alleviate the need to run the velox script separately (prior). I found that running only the prestissimo script will not work on the Linux because dnf or apt isn't run to install all the deps (e.g. compiler and such) when run for the first time.

Perhaps we should do this similarly for Linux to make sure such deps are installed?

Copy link
Collaborator Author

@majetideepak majetideepak Apr 18, 2024

Choose a reason for hiding this comment

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

I fixed the macos script.
The new setup scripts by default do not install anything.
We source the Velox setup scripts and install the (Presto, Velox) build deps from package manager (optional), (Presto, Velox) deps from the package manager, and then the (Presto, Velox) packages via download.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I found that running only the prestissimo script will not work on the Linux because dnf or apt isn't run to install all the deps

Can you try now?

@majetideepak majetideepak force-pushed the fix-setup-script branch 2 times, most recently from b232b51 to 4ed3b6f Compare April 18, 2024 20:17
@majetideepak majetideepak marked this pull request as ready for review April 18, 2024 20:20
@majetideepak majetideepak requested a review from a team as a code owner April 18, 2024 20:20
@majetideepak majetideepak requested a review from czentgr April 18, 2024 20:27
@majetideepak majetideepak force-pushed the fix-setup-script branch 3 times, most recently from 275cae1 to 322d67b Compare April 19, 2024 17:15
@majetideepak majetideepak requested a review from kgpai April 19, 2024 17:15
@majetideepak
Copy link
Collaborator Author

I verified these changes locally.

@majetideepak
Copy link
Collaborator Author

@czentgr can you make another pass? Thanks!

@majetideepak majetideepak changed the title [native ] Fix setup scripts to optionally install build dependencies [native ] Fix setup scripts to align with Velox setup scripts Apr 19, 2024
@majetideepak majetideepak force-pushed the fix-setup-script branch 2 times, most recently from 29035b5 to c43aa8c Compare April 19, 2024 17:28
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 one comment.

rm -rf /tmp/docker && \
mkdir -p /tmp/docker && \
cp scripts/setup-$(CONTAINER_NAME).sh scripts/$(CONTAINER_NAME)-container.dockfile velox/scripts/setup-helper-functions.sh /tmp/docker && \
cp scripts/setup-$(CONTAINER_NAME).sh scripts/$(CONTAINER_NAME)-container.dockfile velox/scripts/setup-centos8.sh velox/scripts/setup-helper-functions.sh /tmp/docker && \
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be velox/scripts/setup-${CONTAINER_NAME} ? ..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will fix!

Copy link
Contributor

Choose a reason for hiding this comment

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

I made a comment about this but I deleted a duplikcate comment so I guess it deleted both?
Anyway I said that in prestissimo the script is called setup-centos.sh while in Velox it is setup-centos8.sh.

The CONTAINER_NAME is set to centos. So we'd need setup-${CONTAINER_NAME}8 here. But this doesn't work if the container is ubuntu. If it is only CentOS then we are ok.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am removing this target as part of the #21929.
I am thinking we can use if-else for now :).

./configure --prefix=/usr/local/gperf/3_1 &&
make "-j$(nproc)" &&
make install &&
ln -s /usr/local/gperf/3_1/bin/gperf /usr/local/bin/
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we include a line about removing the symlink if it exists?
I've run into the problem where the symlink exists and line 45 will fail aborting the processing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I will add a check if the target exists.

MACOS_DEPS="${MACOS_DEPS} bison gperf"
export FB_OS_VERSION=v2024.04.01.00

export PATH=$(brew --prefix bison)/bin:$PATH
Copy link
Contributor

Choose a reason for hiding this comment

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

None of the prestissimo/velox deps require bison?
On Silicon Macs this will be a problem going forward but is likely set later by the users. But removing this we don't expect issues?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a temporary assignment on the current shell. I am thinking there should not be any issues since we don't run this script on every build and things build fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also, bison is installed in the Velox setup script.

@majetideepak
Copy link
Collaborator Author

@czentgr, @kgpai addressed your comments.

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.

LGTM.

Copy link
Contributor

@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!

Velox setup scripts have been modified to not install the build dependencies by default.
Fix setup scripts to adopt that behavior.
Fix setup scripts to encapsulate presto packages into a function.
Fix setup-centos8.sh script to include Velox dependencies.
@majetideepak majetideepak merged commit e687113 into prestodb:master Apr 23, 2024
@majetideepak majetideepak deleted the fix-setup-script branch May 15, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants