ray/release/nightly_tests/shuffle/shuffle_test.py
SangBin Cho c8a5d7ba85
[TEST] Additional data processing nightly test (#16078)
* in progress

* in progress

* almost done

* Lint

* almost done

* All tests are available now

* Change the test a little more stressful

* Modify paramter to make tests a little more stressful
2021-06-09 22:38:53 -07:00

44 lines
1.3 KiB
Python

import argparse
import time
import os
import json
import subprocess
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--num-partitions", help="number of partitions", default=50, type=str)
parser.add_argument(
"--partition-size",
help="number of reducer actors used",
default="200e6",
type=str)
parser.add_argument(
"--no-streaming", help="Non streaming shuffle", action="store_true")
args = parser.parse_args()
start = time.time()
success = 1
commands = [
"python", "-m", "ray.experimental.shuffle", "--ray-address={}".format(
os.environ["RAY_ADDRESS"]),
f"--num-partitions={args.num_partitions}",
f"--partition-size={args.partition_size}"
]
if args.no_streaming:
commands.append("--no-streaming")
try:
subprocess.check_call(commands)
except Exception as e:
print(f"The test failed with {e}")
success = 0
delta = time.time() - start
# Report the running time as 0 if it fails so that
# it is easy to be discovered from the graph.
if not success:
delta = 0
with open(os.environ["TEST_OUTPUT_JSON"], "w") as f:
f.write(json.dumps({"shuffle_time": delta, "success": success}))