-
Notifications
You must be signed in to change notification settings - Fork 625
[GLUTEN-11885][VL] Respect custom VELOX_HOME in build info generation #11905
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
Changes from 2 commits
82af0f4
0b18892
a58483e
ee37515
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ GLUTEN_ROOT=$(cd $(dirname -- $0)/..; pwd -P) | |
|
|
||
| EXTRA_RESOURCE_DIR=$GLUTEN_ROOT/gluten-core/target/generated-resources | ||
| BUILD_INFO="$EXTRA_RESOURCE_DIR"/gluten-build-info.properties | ||
| BACKEND_HOME="" | ||
|
|
||
| # Delete old build-info file before regenerating | ||
| rm -f "$BUILD_INFO" | ||
|
|
@@ -38,9 +39,9 @@ function echo_revision_info() { | |
| function echo_velox_revision_info() { | ||
| BACKEND_HOME=$1 | ||
| echo gcc_version=$(strings $GLUTEN_ROOT/cpp/build/releases/libgluten.so | grep "GCC:" | head -n 1) | ||
| echo velox_branch=$(git -C $BACKEND_HOME rev-parse --abbrev-ref HEAD) | ||
| echo velox_revision=$(git -C $BACKEND_HOME rev-parse HEAD) | ||
| echo velox_revision_time=$(git -C $BACKEND_HOME show -s --format=%ci HEAD) | ||
| echo velox_branch=$(git -C "$BACKEND_HOME" rev-parse --abbrev-ref HEAD) | ||
| echo velox_revision=$(git -C "$BACKEND_HOME" rev-parse HEAD) | ||
| echo velox_revision_time=$(git -C "$BACKEND_HOME" show -s --format=%ci HEAD) | ||
| } | ||
|
|
||
| function echo_clickhouse_revision_info() { | ||
|
|
@@ -49,6 +50,34 @@ function echo_clickhouse_revision_info() { | |
| echo ch_commit=$(cat $GLUTEN_ROOT/cpp-ch/clickhouse.version | grep -oP '(?<=^CH_COMMIT=).*') | ||
| } | ||
|
|
||
| function read_cmake_cache_path() { | ||
| CACHE_FILE="$GLUTEN_ROOT/cpp/build/CMakeCache.txt" | ||
| CACHE_KEY="$1" | ||
| if [ -f "$CACHE_FILE" ]; then | ||
| grep "^${CACHE_KEY}:PATH=" "$CACHE_FILE" | cut -d= -f2- | head -n 1 | ||
| fi | ||
| } | ||
|
|
||
| function resolve_velox_home() { | ||
| if [ -n "$BACKEND_HOME" ]; then | ||
| echo "$BACKEND_HOME" | ||
| return | ||
| fi | ||
|
|
||
| if [ -n "${VELOX_HOME:-}" ]; then | ||
| echo "$VELOX_HOME" | ||
| return | ||
| fi | ||
|
|
||
| CACHED_VELOX_HOME=$(read_cmake_cache_path VELOX_HOME) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this detection always reliable? Can we just use this for getting velox home?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in ee37515. The script now reads |
||
| if [ -n "$CACHED_VELOX_HOME" ]; then | ||
| echo "$CACHED_VELOX_HOME" | ||
| return | ||
| fi | ||
|
|
||
| echo "$GLUTEN_ROOT/ep/build-velox/build/velox_ep" | ||
| } | ||
|
|
||
| while (( "$#" )); do | ||
| echo "$1" | ||
| case $1 in | ||
|
|
@@ -60,12 +89,17 @@ while (( "$#" )); do | |
| echo backend_type="$BACKEND_TYPE" >> "$BUILD_INFO" | ||
| # Compute backend home path based on type | ||
| if [ "velox" = "$BACKEND_TYPE" ]; then | ||
| BACKEND_HOME="$GLUTEN_ROOT/ep/build-velox/build/velox_ep" | ||
| BACKEND_HOME=$(resolve_velox_home) | ||
| echo_velox_revision_info "$BACKEND_HOME" >> "$BUILD_INFO" | ||
| elif [ "ch" = "$BACKEND_TYPE" ] || [ "clickhouse" = "$BACKEND_TYPE" ]; then | ||
| echo_clickhouse_revision_info >> "$BUILD_INFO" | ||
| fi | ||
| ;; | ||
| --backend_home|--velox_home) | ||
| if [ -n "$2" ]; then | ||
| BACKEND_HOME="$2" | ||
| fi | ||
| ;; | ||
| --java) | ||
| echo java_version="$2" >> "$BUILD_INFO" | ||
| ;; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also need such modification for some other args?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the current script again, and I do not think we need the same change for the other args in this PR. The scalar handling here matters for
--velox_repo,--velox_branch, and especially--velox_homebecause they are reused when buildingVELOX_PARAMETERand when propagatingVELOX_HOMEto child processes. The other flags are only consumed locally in this script today. If there is another arg that also needs to cross that boundary, I can handle it in a follow-up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@officialasishkumar, thanks for the check. Since this functionality is not well covered by CI, could you verify it in local build with a custom Velox home used? You may simply check a local resource file generated by gluten-build-info.sh.