@@ -102,16 +102,19 @@ jobs:
102
102
presto_error : ${{ steps.sig-check.outputs.presto_error }}
103
103
spark_bias : ${{ steps.sig-check.outputs.spark_functions }}
104
104
spark_error : ${{ steps.sig-check.outputs.spark_error }}
105
+ presto_aggregate_bias : ${{ steps.sig-check.outputs.presto_aggregate_functions }}
106
+ presto_aggregate_error : ${{ steps.sig-check.outputs.presto_aggregate_error }}
105
107
106
108
steps :
107
109
108
110
- name : Get latest commit from main
109
111
if : ${{ github.event_name != 'schedule' }}
112
+ working-directory : ${{ github.workspace }}
110
113
env :
111
114
GH_TOKEN : ${{ github.token }}
112
115
id : get-head
113
116
run : |
114
- if [ '${{ github.event_name = 'push' }}' == "true" ]; then
117
+ if [ '${{ github.event_name == 'push' }}' == "true" ]; then
115
118
# get the parent commit of the current one to get the relevant function signatures
116
119
head_main=$(gh api -q '.parents.[0].sha' '/repos/facebookincubator/velox/commits/${{ github.sha }}')
117
120
else
@@ -147,14 +150,14 @@ jobs:
147
150
mkdir -p /tmp/signatures
148
151
149
152
- name : Checkout Main
150
- if : ${{ github.even_name != 'schedule' && steps.get-sig.outputs.stash-hit != 'true' }}
153
+ if : ${{ github.event_name != 'schedule' && steps.get-sig.outputs.stash-hit != 'true' }}
151
154
uses : actions/checkout@v4
152
155
with :
153
156
ref : ${{ steps.get-head.outputs.head_main || 'main' }}
154
157
path : velox_main
155
158
156
159
- name : Build PyVelox
157
- if : ${{ github.even_name != 'schedule' && steps.get-sig.outputs.stash-hit != 'true' }}
160
+ if : ${{ github.event_name != 'schedule' && steps.get-sig.outputs.stash-hit != 'true' }}
158
161
working-directory : velox_main
159
162
run : |
160
163
python3 -m venv .venv
@@ -163,16 +166,17 @@ jobs:
163
166
make python-build
164
167
165
168
- name : Create Baseline Signatures
166
- if : ${{ github.even_name != 'schedule' && steps.get-sig.outputs.stash-hit != 'true' }}
169
+ if : ${{ github.event_name != 'schedule' && steps.get-sig.outputs.stash-hit != 'true' }}
167
170
working-directory : velox_main
168
171
run : |
169
172
source .venv/bin/activate
170
173
python3 -m pip install deepdiff
171
174
python3 scripts/signature.py export --spark /tmp/signatures/spark_signatures_main.json
172
175
python3 scripts/signature.py export --presto /tmp/signatures/presto_signatures_main.json
176
+ python3 scripts/signature.py export_aggregates --presto /tmp/signatures/presto_aggregate_signatures_main.json
173
177
174
178
- name : Save Function Signature Stash
175
- if : ${{ github.even_name == 'pull_request' && steps.get-sig.outputs.stash-hit != 'true' }}
179
+ if : ${{ github.event_name == 'pull_request' && steps.get-sig.outputs.stash-hit != 'true' }}
176
180
uses : assignUser/stash/save@v1
177
181
with :
178
182
path : /tmp/signatures
@@ -202,14 +206,14 @@ jobs:
202
206
- name : Save ccache
203
207
# see https://github.com/actions/upload-artifact/issues/543
204
208
continue-on-error : true
205
- if : ${{ github.even_name != 'schedule' }}
209
+ if : ${{ github.event_name != 'schedule' }}
206
210
uses : assignUser/stash/save@v1
207
211
with :
208
212
path : " ${{ env.CCACHE_DIR }}"
209
213
key : ccache-fuzzer-centos
210
214
211
215
- name : Build PyVelox
212
- if : ${{ github.even_name != 'schedule' }}
216
+ if : ${{ github.event_name != 'schedule' }}
213
217
env :
214
218
VELOX_BUILD_DIR : " _build/debug"
215
219
run : |
@@ -218,15 +222,19 @@ jobs:
218
222
python3 -m pip install -e .
219
223
220
224
- name : Create and test new function signatures
221
- if : ${{ github.even_name != 'schedule' }}
225
+ if : ${{ github.event_name != 'schedule' }}
222
226
id : sig-check
223
227
run : |
224
228
source .venv/bin/activate
225
229
python3 -m pip install deepdiff
226
230
python3 scripts/signature.py gh_bias_check presto spark
231
+ python3 scripts/signature.py export_aggregates --presto /tmp/signatures/presto_aggregate_signatures_contendor.json
232
+ python3 scripts/signature.py bias_aggregates /tmp/signatures/presto_aggregate_signatures_main.json \
233
+ /tmp/signatures/presto_aggregate_signatures_contendor.json /tmp/signatures/presto_aggregate_bias_functions \
234
+ /tmp/signatures/presto_aggregate_errors
227
235
228
236
- name : Upload Signature Artifacts
229
- if : ${{ github.even_name != 'schedule' }}
237
+ if : ${{ github.event_name != 'schedule' }}
230
238
uses : actions/upload-artifact@v4
231
239
with :
232
240
name : signatures
@@ -246,7 +254,7 @@ jobs:
246
254
done
247
255
248
256
- name : Save Function Signature Stash
249
- if : ${{ github.even_name == 'push' }}
257
+ if : ${{ github.event_name == 'push' }}
250
258
uses : assignUser/stash/save@v1
251
259
with :
252
260
path : /tmp/signatures
@@ -703,6 +711,81 @@ jobs:
703
711
path : |
704
712
/tmp/aggregate_fuzzer_repro
705
713
/tmp/server.log
714
+
715
+
716
+ presto-bias-java-aggregation-fuzzer-run :
717
+ name : Biased Aggregation Fuzzer with Presto as source of truth
718
+ needs : compile
719
+ runs-on : ubuntu-latest
720
+ container : ghcr.io/facebookincubator/velox-dev:presto-java
721
+ timeout-minutes : 120
722
+ if : ${{ needs.compile.outputs.presto_aggregate_bias == 'true' }}
723
+ env :
724
+ CCACHE_DIR : " ${{ github.workspace }}/.ccache/"
725
+ LINUX_DISTRO : " centos"
726
+ steps :
727
+
728
+ - name : Download aggregation fuzzer
729
+ uses : actions/download-artifact@v4
730
+ with :
731
+ name : aggregation
732
+
733
+ - name : " Checkout Repo"
734
+ uses : actions/checkout@v4
735
+ with :
736
+ path : velox
737
+ submodules : ' recursive'
738
+ ref : " ${{ inputs.ref }}"
739
+
740
+ - name : Fix git permissions
741
+ # Usually actions/checkout does this but as we run in a container
742
+ # it doesn't work
743
+ run : git config --global --add safe.directory /__w/velox/velox/velox
744
+
745
+ - name : Download Signatures
746
+ uses : actions/download-artifact@v4
747
+ with :
748
+ name : signatures
749
+ path : /tmp/signatures
750
+
751
+ - name : " Run Bias Aggregate Fuzzer"
752
+ run : |
753
+ cd velox
754
+ cp ./scripts/etc/hive.properties $PRESTO_HOME/etc/catalog
755
+ ls -lR $PRESTO_HOME/etc
756
+ $PRESTO_HOME/bin/launcher run -v > /tmp/server.log 2>&1 &
757
+ # Sleep for 60 seconds to allow Presto server to start.
758
+ sleep 60
759
+ /opt/presto-cli --server 127.0.0.1:8080 --execute 'CREATE SCHEMA hive.tpch;'
760
+ cd -
761
+ mkdir -p /tmp/aggregate_fuzzer_repro/
762
+ rm -rfv /tmp/aggregate_fuzzer_repro/*
763
+ chmod -R 777 /tmp/aggregate_fuzzer_repro
764
+ chmod +x velox_aggregation_fuzzer_test
765
+ echo "signatures folder"
766
+ ls /tmp/signatures/
767
+ echo "Biased functions:"
768
+ cat /tmp/signatures/presto_aggregate_bias_functions
769
+ echo "Running Fuzzer for $DURATION"
770
+ ./velox_aggregation_fuzzer_test \
771
+ --seed ${RANDOM} \
772
+ --duration_sec $DURATION \
773
+ --logtostderr=1 \
774
+ --minloglevel=1 \
775
+ --repro_persist_path=/tmp/aggregate_fuzzer_repro \
776
+ --enable_sorted_aggregations=true \
777
+ --only=$(cat /tmp/signatures/presto_aggregate_bias_functions) \
778
+ --presto_url=http://127.0.0.1:8080 \
779
+ && echo -e "\n\nAggregation fuzzer run finished successfully."
780
+
781
+ - name : Archive bias aggregate production artifacts
782
+ if : ${{ !cancelled() }}
783
+ uses : actions/upload-artifact@v4
784
+ with :
785
+ name : presto-bias-sot-aggregate-fuzzer-failure-artifacts
786
+ path : |
787
+ /tmp/aggregate_fuzzer_repro
788
+ /tmp/server.log
706
789
707
790
surface-signature-errors :
708
791
name : Signature Changes
@@ -721,3 +804,9 @@ jobs:
721
804
run : |
722
805
cat /tmp/signatures/presto_errors
723
806
exit 1
807
+
808
+ - name : Surface Aggregate function signature errors
809
+ if : ${{ needs.compile.outputs.presto_aggregate_error == 'true' }}
810
+ run : |
811
+ cat /tmp/signatures/presto_aggregate_errors
812
+ exit 1
0 commit comments