Skip to content

Commit

Permalink
Remove hard-coded spark-submit-template.txt and add --template argume…
Browse files Browse the repository at this point in the history
…nt. Also make all arguments required.

Signed-off-by: Andy Grove <andygrove@nvidia.com>
  • Loading branch information
andygrove committed Oct 15, 2020
1 parent e34b9c0 commit 10713c5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions integration_tests/src/main/python/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def main():
spark.rapids.sql.enabled=true
spark.sql.adaptive.enabled=true
The spark-submit-template.txt file should contain the command to call spark-submit along
A template file must be provided, containing the command to call spark-submit along
with any cluster-specific configuration options and any spark configuration settings that
will be common to all benchmark runs. The template should end with a line-continuation
symbol since additional --conf options will be appended for each benchmark run.
Example spark-submit-template.txt:
Example template:
$SPARK_HOME/bin/spark-submit \
--master $SPARK_MASTER_URL \
Expand All @@ -66,21 +66,23 @@ def main():
"""

parser = argparse.ArgumentParser(description='Run TPC benchmarks.')
parser.add_argument('--benchmark',
parser.add_argument('--benchmark', required=True,
help='Name of benchmark to run (tpcds, tpcxbb, tpch)')
parser.add_argument('--input',
parser.add_argument('--template', required=True,
help='Path to a template script that invokes spark-submit')
parser.add_argument('--input', required=True,
help='Path to source data set')
parser.add_argument('--input-format',
parser.add_argument('--input-format', required=True,
help='Format of input data set (parquet or csv)')
parser.add_argument('--output',
parser.add_argument('--output', required=True,
help='Path to write query output to')
parser.add_argument('--output-format',
parser.add_argument('--output-format', required=True,
help='Format to write to (parquet or orc)')
parser.add_argument('--configs', type=str, nargs='+',
parser.add_argument('--configs', required=True, type=str, nargs='+',
help='One or more configuration filenames to run')
parser.add_argument('--query', type=str, nargs='+',
parser.add_argument('--query', required=True, type=str, nargs='+',
help='Queries to run')
parser.add_argument('--iterations',
parser.add_argument('--iterations', required=True,
help='The number of iterations to run (defaults to 1)')

args = parser.parse_args()
Expand All @@ -94,9 +96,7 @@ def main():
else:
sys.exit("invalid benchmark name")

spark_submit_template = "spark-submit-template.txt"

with open(spark_submit_template, "r") as myfile:
with open(args.template, "r") as myfile:
template = myfile.read()

for config_name in args.configs:
Expand Down

0 comments on commit 10713c5

Please sign in to comment.