Skip to content

Commit bee2e17

Browse files
peterenescumeta-codesync[bot]
authored andcommitted
feat: Support VeloxQueryRunner in Github Expression Fuzzer (facebookincubator#15483)
Summary: Pull Request resolved: facebookincubator#15483 Add Regression Fuzzer (i.e. Expression Fuzzer with LocalRunnerService as a source-of-truth) to Fuzzer Job test suite. This fuzzer sends serialized plans to a thrift service build on the base commit to test solely on new changes. Differential Revision: D86911550
1 parent d8484d9 commit bee2e17

File tree

10 files changed

+377
-74
lines changed

10 files changed

+377
-74
lines changed

.github/workflows/scheduled.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ jobs:
383383
path: velox/_build/debug/velox/exec/fuzzer/velox_spatial_join_fuzzer
384384
retention-days: ${{ env.RETENTION }}
385385

386+
- name: Upload local runner service runner
387+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
388+
with:
389+
name: local_runner_service_runner
390+
path: velox/_build/debug/velox/exec/fuzzer/velox_local_runner_service_runner
391+
retention-days: ${{ env.RETENTION }}
392+
386393
presto-fuzzer-run:
387394
name: Presto Fuzzer
388395
if: ${{ needs.compile.outputs.presto_bias != 'true' }}
@@ -459,6 +466,96 @@ jobs:
459466
path: |
460467
/tmp/fuzzer_repro
461468
469+
presto-fuzzer-with-local-runner-run:
470+
name: Presto Fuzzer with Local Runner
471+
if: ${{ needs.compile.outputs.presto_bias != 'true' }}
472+
runs-on: ubuntu-latest
473+
container: ghcr.io/facebookincubator/velox-dev:centos9
474+
needs: compile
475+
timeout-minutes: 120
476+
steps:
477+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
478+
if: github.event_name == 'pull_request'
479+
id: changes
480+
with:
481+
filters: |
482+
presto:
483+
- 'velox/expression/!(test)**'
484+
- 'velox/exec/!(test)**'
485+
- 'velox/common/!(test)**'
486+
- 'velox/core/!(test)**'
487+
- 'velox/vector/!(test)**'
488+
489+
- name: Set presto specific fuzzer duration
490+
env:
491+
# Run for 30 minutes instead of 15, when files relevant to presto are touched
492+
pr_duration: ${{ steps.changes.outputs.presto == 'true' && 1800 || 900 }}
493+
# Run for 60 minutes if its a scheduled run
494+
other_duration: ${{ inputs.duration || (github.event_name == 'push' && 1800 || 3600) }}
495+
is_pr: ${{ github.event_name == 'pull_request' }}
496+
run: |
497+
if [ "$is_pr" == "true" ]; then
498+
duration=$pr_duration
499+
else
500+
duration=$other_duration
501+
fi
502+
503+
echo "DURATION=$duration" >> $GITHUB_ENV
504+
505+
- name: Download presto fuzzer
506+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
507+
with:
508+
name: presto
509+
510+
- name: Download local runner service runner
511+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
512+
with:
513+
name: local_runner_service_runner
514+
515+
- name: Run Presto Fuzzer with Local Runner
516+
run: |
517+
mkdir -p /tmp/fuzzer_repro/logs/
518+
chmod -R 777 /tmp/fuzzer_repro
519+
chmod +x velox_expression_fuzzer_test
520+
chmod +x velox_local_runner_service_runner
521+
# Start LocalRunnerService in the background
522+
./velox_local_runner_service_runner > /tmp/fuzzer_repro/logs/local_runner_service.log 2>&1 &
523+
LOCAL_RUNNER_PID=$!
524+
echo "Started LocalRunnerService with PID: ${LOCAL_RUNNER_PID}"
525+
# Sleep for 10 seconds to allow service to start
526+
sleep 10
527+
random_seed=${RANDOM}
528+
echo "Random seed: ${random_seed}"
529+
./velox_expression_fuzzer_test \
530+
--seed ${random_seed} \
531+
--enable_variadic_signatures \
532+
--velox_fuzzer_enable_complex_types \
533+
--velox_fuzzer_enable_decimal_type \
534+
--lazy_vector_generation_ratio 0.2 \
535+
--common_dictionary_wraps_generation_ratio=0.3 \
536+
--velox_fuzzer_enable_column_reuse \
537+
--velox_fuzzer_enable_expression_reuse \
538+
--max_expression_trees_per_step 2 \
539+
--retry_with_try \
540+
--enable_dereference \
541+
--duration_sec $DURATION \
542+
--minloglevel=0 \
543+
--stderrthreshold=2 \
544+
--log_dir=/tmp/fuzzer_repro/logs \
545+
--repro_persist_path=/tmp/fuzzer_repro \
546+
--local_runner_service_url=http://127.0.0.1:9091 \
547+
&& echo -e "\n\nFuzzer run finished successfully."
548+
# Stop the LocalRunnerService
549+
kill $LOCAL_RUNNER_PID || true
550+
551+
- name: Archive production artifacts
552+
if: ${{ !cancelled() }}
553+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
554+
with:
555+
name: presto-fuzzer-with-local-runner-failure-artifacts
556+
path: |
557+
/tmp/fuzzer_repro
558+
462559
presto-sot-fuzzer-run:
463560
name: Expression Fuzzer with Presto SOT
464561
needs: compile

CMake/FindArrow.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ find_package_handle_standard_args(
3232
if(Arrow_FOUND AND NOT TARGET arrow)
3333
add_library(arrow STATIC IMPORTED GLOBAL)
3434
add_library(arrow_testing STATIC IMPORTED GLOBAL)
35-
add_library(thrift ALIAS thrift::thrift)
35+
# Only create thrift alias if it doesn't already exist (e.g., from FBThrift)
36+
if(NOT TARGET thrift)
37+
add_library(thrift ALIAS thrift::thrift)
38+
endif()
3639

3740
set_target_properties(
3841
arrow

CMake/resolve_dependency_modules/arrow/CMakeLists.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,20 @@ if(VELOX_ENABLE_ARROW)
4747
)
4848
set(ARROW_LIBDIR ${ARROW_PREFIX}/install/lib)
4949

50-
add_library(thrift STATIC IMPORTED GLOBAL)
51-
if(NOT Thrift_FOUND)
52-
set(THRIFT_ROOT ${ARROW_PREFIX}/src/arrow_ep-build/thrift_ep-install)
53-
set(THRIFT_LIB ${THRIFT_ROOT}/lib/libthrift.a)
50+
# Only create thrift target if it doesn't already exist (e.g., from FBThrift)
51+
if(NOT TARGET thrift)
52+
add_library(thrift STATIC IMPORTED GLOBAL)
53+
if(NOT Thrift_FOUND)
54+
set(THRIFT_ROOT ${ARROW_PREFIX}/src/arrow_ep-build/thrift_ep-install)
55+
set(THRIFT_LIB ${THRIFT_ROOT}/lib/libthrift.a)
5456

55-
file(MAKE_DIRECTORY ${THRIFT_ROOT}/include)
56-
set(THRIFT_INCLUDE_DIR ${THRIFT_ROOT}/include)
57-
endif()
57+
file(MAKE_DIRECTORY ${THRIFT_ROOT}/include)
58+
set(THRIFT_INCLUDE_DIR ${THRIFT_ROOT}/include)
59+
endif()
5860

59-
set_property(TARGET thrift PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${THRIFT_INCLUDE_DIR})
60-
set_property(TARGET thrift PROPERTY IMPORTED_LOCATION ${THRIFT_LIB})
61+
set_property(TARGET thrift PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${THRIFT_INCLUDE_DIR})
62+
set_property(TARGET thrift PROPERTY IMPORTED_LOCATION ${THRIFT_LIB})
63+
endif()
6164

6265
set(VELOX_ARROW_BUILD_VERSION 15.0.0)
6366
set(
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
include_guard(GLOBAL)
15+
16+
# FBThrift is Meta's Thrift RPC framework
17+
# GitHub: https://github.com/facebook/fbthrift
18+
19+
set(VELOX_FBTHRIFT_BUILD_VERSION "2024.11.18.00")
20+
set(
21+
VELOX_FBTHRIFT_BUILD_SHA256_CHECKSUM
22+
b38f22448b56fd0692f2dcea47c92ea3cae025f453ef032b20ff848c1a483653
23+
)
24+
set(
25+
VELOX_FBTHRIFT_SOURCE_URL
26+
"https://github.com/facebook/fbthrift/archive/refs/tags/v${VELOX_FBTHRIFT_BUILD_VERSION}.tar.gz"
27+
)
28+
29+
velox_resolve_dependency_url(FBTHRIFT)
30+
31+
message(STATUS "Building fbthrift from source")
32+
33+
# FBThrift depends on folly, fmt, fizz, wangle, and mvfst
34+
velox_set_source(folly)
35+
velox_resolve_dependency(folly CONFIG REQUIRED)
36+
37+
velox_set_source(fmt)
38+
velox_resolve_dependency(fmt CONFIG REQUIRED)
39+
40+
velox_set_source(fizz)
41+
velox_resolve_dependency(fizz CONFIG REQUIRED)
42+
43+
velox_set_source(wangle)
44+
velox_resolve_dependency(wangle CONFIG REQUIRED)
45+
46+
velox_set_source(mvfst)
47+
velox_resolve_dependency(mvfst CONFIG REQUIRED)
48+
49+
FetchContent_Declare(
50+
fbthrift
51+
URL ${VELOX_FBTHRIFT_SOURCE_URL}
52+
URL_HASH ${VELOX_FBTHRIFT_BUILD_SHA256_CHECKSUM}
53+
OVERRIDE_FIND_PACKAGE
54+
EXCLUDE_FROM_ALL
55+
)
56+
57+
# Configure fbthrift build options
58+
set(BUILD_TESTS OFF CACHE BOOL "Build fbthrift tests")
59+
set(BUILD_EXAMPLES OFF CACHE BOOL "Build fbthrift examples")
60+
set(THRIFT_COMPILER_ONLY OFF CACHE BOOL "Build only thrift compiler")
61+
set(THRIFT_LIB_ONLY OFF CACHE BOOL "Build only thrift libraries")
62+
63+
FetchContent_MakeAvailable(fbthrift)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
include_guard(GLOBAL)
15+
16+
# Fizz is Meta's TLS 1.3 implementation library
17+
# GitHub: https://github.com/facebookincubator/fizz
18+
19+
set(VELOX_FIZZ_BUILD_VERSION "2024.11.18.00")
20+
set(
21+
VELOX_FIZZ_BUILD_SHA256_CHECKSUM
22+
ee84e2d43ed8a1b26b8d27d01d954091915278070bab068a81803dd673b5b3fe
23+
)
24+
set(
25+
VELOX_FIZZ_SOURCE_URL
26+
"https://github.com/facebookincubator/fizz/archive/refs/tags/v${VELOX_FIZZ_BUILD_VERSION}.tar.gz"
27+
)
28+
29+
velox_resolve_dependency_url(FIZZ)
30+
31+
message(STATUS "Building fizz from source")
32+
33+
# Fizz depends on folly
34+
velox_set_source(folly)
35+
velox_resolve_dependency(folly CONFIG REQUIRED)
36+
37+
FetchContent_Declare(
38+
fizz
39+
URL ${VELOX_FIZZ_SOURCE_URL}
40+
URL_HASH ${VELOX_FIZZ_BUILD_SHA256_CHECKSUM}
41+
OVERRIDE_FIND_PACKAGE
42+
EXCLUDE_FROM_ALL
43+
)
44+
45+
# Configure fizz build options
46+
set(BUILD_TESTS OFF CACHE BOOL "Build fizz tests")
47+
set(BUILD_EXAMPLES OFF CACHE BOOL "Build fizz examples")
48+
49+
FetchContent_MakeAvailable(fizz)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
include_guard(GLOBAL)
15+
16+
# mvfst is Meta's QUIC transport library
17+
# GitHub: https://github.com/facebook/mvfst
18+
19+
set(VELOX_MVFST_BUILD_VERSION "2024.11.18.00")
20+
set(
21+
VELOX_MVFST_BUILD_SHA256_CHECKSUM
22+
4855fa55044769021877ae60683a9650bd2ad724d84b0a7897a7d802f610a4ee
23+
)
24+
set(
25+
VELOX_MVFST_SOURCE_URL
26+
"https://github.com/facebook/mvfst/archive/refs/tags/v${VELOX_MVFST_BUILD_VERSION}.tar.gz"
27+
)
28+
29+
velox_resolve_dependency_url(MVFST)
30+
31+
message(STATUS "Building mvfst from source")
32+
33+
# mvfst depends on folly and fizz
34+
velox_set_source(folly)
35+
velox_resolve_dependency(folly CONFIG REQUIRED)
36+
37+
velox_set_source(fizz)
38+
velox_resolve_dependency(fizz CONFIG REQUIRED)
39+
40+
FetchContent_Declare(
41+
mvfst
42+
URL ${VELOX_MVFST_SOURCE_URL}
43+
URL_HASH ${VELOX_MVFST_BUILD_SHA256_CHECKSUM}
44+
OVERRIDE_FIND_PACKAGE
45+
EXCLUDE_FROM_ALL
46+
)
47+
48+
# Configure mvfst build options
49+
set(BUILD_TESTS OFF CACHE BOOL "Build mvfst tests")
50+
set(BUILD_EXAMPLES OFF CACHE BOOL "Build mvfst examples")
51+
52+
FetchContent_MakeAvailable(mvfst)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) Facebook, Inc. and its affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
include_guard(GLOBAL)
15+
16+
# Wangle is Meta's C++ Networking Library
17+
# GitHub: https://github.com/facebook/wangle
18+
19+
set(VELOX_WANGLE_BUILD_VERSION "2024.11.18.00")
20+
set(
21+
VELOX_WANGLE_BUILD_SHA256_CHECKSUM
22+
7ff1886f1c8bbe2a0f972fc09de909e30d764f28f31f04c0c873eab8be72484e
23+
)
24+
set(
25+
VELOX_WANGLE_SOURCE_URL
26+
"https://github.com/facebook/wangle/archive/refs/tags/v${VELOX_WANGLE_BUILD_VERSION}.tar.gz"
27+
)
28+
29+
velox_resolve_dependency_url(WANGLE)
30+
31+
message(STATUS "Building wangle from source")
32+
33+
# Wangle depends on folly and fizz
34+
velox_set_source(folly)
35+
velox_resolve_dependency(folly CONFIG REQUIRED)
36+
37+
velox_set_source(fizz)
38+
velox_resolve_dependency(fizz CONFIG REQUIRED)
39+
40+
FetchContent_Declare(
41+
wangle
42+
URL ${VELOX_WANGLE_SOURCE_URL}
43+
URL_HASH ${VELOX_WANGLE_BUILD_SHA256_CHECKSUM}
44+
OVERRIDE_FIND_PACKAGE
45+
EXCLUDE_FROM_ALL
46+
)
47+
48+
# Configure wangle build options
49+
set(BUILD_TESTS OFF CACHE BOOL "Build wangle tests")
50+
set(BUILD_EXAMPLES OFF CACHE BOOL "Build wangle examples")
51+
52+
FetchContent_MakeAvailable(wangle)

CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -639,17 +639,15 @@ if(${VELOX_BUILD_TESTING})
639639
# to be installed on the system, instead of being built by gRPC.
640640
velox_set_source(c-ares)
641641
velox_resolve_dependency(c-ares)
642-
643642
velox_set_source(gRPC)
644643
velox_resolve_dependency(gRPC)
645-
endif()
646644

647-
if(VELOX_ENABLE_REMOTE_FUNCTIONS)
648-
# TODO: Move this to use resolve_dependency(). For some reason, FBThrift
649-
# requires clients to explicitly install fizz and wangle.
650-
find_package(fizz CONFIG REQUIRED)
651-
find_package(wangle CONFIG REQUIRED)
652-
find_package(FBThrift CONFIG REQUIRED)
645+
velox_set_source(fizz)
646+
velox_resolve_dependency(fizz CONFIG REQUIRED)
647+
velox_set_source(wangle)
648+
velox_resolve_dependency(wangle CONFIG REQUIRED)
649+
velox_set_source(fbthrift)
650+
velox_resolve_dependency(fbthrift CONFIG REQUIRED)
653651
endif()
654652

655653
if(VELOX_ENABLE_GCS)

0 commit comments

Comments
 (0)