-
Notifications
You must be signed in to change notification settings - Fork 249
feat: Add bash script to build and run fuzz testing #2686
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| set -eu | ||
|
|
||
| SPARK_MASTER="${SPARK_MASTER:-local[*]}" | ||
| PROJECT_VERSION="$(mvn -q help:evaluate -Dexpression=project.version -DforceStdout)" | ||
| COMET_SPARK_JAR="../spark/target/$(mvn -f ../spark/pom.xml -q help:evaluate -Dexpression=project.artifactId -DforceStdout)-${PROJECT_VERSION}.jar" | ||
|
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. It would be cleaner and easier to debug (with |
||
| COMET_FUZZ_JAR="target/$(mvn -q help:evaluate -Dexpression=project.artifactId -DforceStdout)-${PROJECT_VERSION}-jar-with-dependencies.jar" | ||
| NUM_FILES="${NUM_FILES:-2}" | ||
| NUM_ROWS="${NUM_ROWS:-200}" | ||
| NUM_QUERIES="${NUM_QUERIES:-500}" | ||
|
|
||
| if [ ! -f "${COMET_SPARK_JAR}" ]; then | ||
| echo "Building Comet Spark jar..." | ||
| cd .. | ||
|
Contributor
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. Should we also be building native code here ?
Member
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. I'm following instructions in README to run |
||
| mvn install -DskipTests | ||
| cd fuzz-testing | ||
|
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. I think you can avoid navigating the folders with
Member
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. This can be done once #2691 is in. |
||
| else | ||
| echo "Building Fuzz testing jar..." | ||
| mvn package -DskipTests | ||
| fi | ||
|
|
||
| echo "Generating data..." | ||
| "${SPARK_HOME}/bin/spark-submit" \ | ||
| --master "${SPARK_MASTER}" \ | ||
| --class org.apache.comet.fuzz.Main \ | ||
| "${COMET_FUZZ_JAR}" \ | ||
| data --num-files="${NUM_FILES}" --num-rows="${NUM_ROWS}" \ | ||
| --exclude-negative-zero \ | ||
| --generate-arrays --generate-structs --generate-maps | ||
|
|
||
| echo "Generating queries..." | ||
| "${SPARK_HOME}/bin/spark-submit" \ | ||
| --master "${SPARK_MASTER}" \ | ||
| --class org.apache.comet.fuzz.Main \ | ||
| "${COMET_FUZZ_JAR}" \ | ||
| queries --num-files="${NUM_FILES}" --num-queries="${NUM_QUERIES}" | ||
|
|
||
| echo "Running fuzz tests..." | ||
| "${SPARK_HOME}/bin/spark-submit" \ | ||
| --master "${SPARK_MASTER}" \ | ||
| --conf spark.memory.offHeap.enabled=true \ | ||
| --conf spark.memory.offHeap.size=16G \ | ||
| --conf spark.plugins=org.apache.spark.CometPlugin \ | ||
| --conf spark.comet.enabled=true \ | ||
| --conf spark.shuffle.manager=org.apache.spark.sql.comet.execution.shuffle.CometShuffleManager \ | ||
| --conf spark.comet.exec.shuffle.enabled=true \ | ||
| --jars "${COMET_SPARK_JAR}" \ | ||
| --conf spark.driver.extraClassPath="${COMET_SPARK_JAR}" \ | ||
| --conf spark.executor.extraClassPath="${COMET_SPARK_JAR}" \ | ||
| --class org.apache.comet.fuzz.Main \ | ||
| "${COMET_FUZZ_JAR}" \ | ||
| run --num-files="${NUM_FILES}" --filename="queries.sql" | ||
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.
You may want to add some logic to detect the current working directory.
At the moment this script assumes that it is called with
./run.shbut some user may try to run it from the parent folder with./fuzz-testing/run.sh.