ray/release/nightly_tests/setup_chaos.py
SangBin Cho cd7a32f1a5
[Nightly test] Chaos test fixture (#20277)
This PR is mostly for implementing "fixture" for nightly test. Note that the current fixture implementation is not that great, and we can probably improve this in the future after refactoring e2e.py.
2021-11-24 17:13:29 -08:00

38 lines
1.1 KiB
Python

import argparse
import ray
from ray._private.test_utils import get_and_run_node_killer
def parse_script_args():
parser = argparse.ArgumentParser()
parser.add_argument("--node-kill-interval", type=int, default=60)
parser.add_argument(
"--no-start",
action="store_true",
default=False,
help=("If set, node killer won't be starting to kill nodes when "
"the script is done. Driver needs to manually "
"obtain the node killer handle and invoke run method to "
"start killing nodes. If not set, as soon as "
"the script is done, nodes will be killed every "
"--node-kill-interval seconds."))
return parser.parse_known_args()
def main():
"""Start the chaos testing.
Currently chaos testing only covers random node failures.
"""
args, _ = parse_script_args()
ray.init(address="auto")
get_and_run_node_killer(
args.node_kill_interval,
namespace="release_test_namespace",
lifetime="detached",
no_start=args.no_start)
print("Successfully deployed a node killer.")
main()