Skip to content

Commit

Permalink
[Serve] Add serve failure test to CI (ray-project#20392)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo committed Nov 16, 2021
1 parent 693063d commit ca90c63
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@
- bazel test --config=ci $(./scripts/bazel_export_options)
--test_tag_filters=-post_wheel_build
python/ray/serve/...
- bazel test --config=ci $(./scripts/bazel_export_options)
--test_tag_filters=team:serve
release/...

- label: ":python: Minimal install"
conditions: ["RAY_CI_PYTHON_AFFECTED"]
Expand Down
21 changes: 21 additions & 0 deletions release/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
load("@rules_python//python:defs.bzl", "py_test")

test_srcs = glob(["**/*.py"])

py_test(
name = "serve_failure_smoke_test",
size = "medium",
srcs = test_srcs,
env = {
"IS_SMOKE_TEST": "1",
},
main = "serve_failure.py",
tags = [
"exclusive",
"team:serve",
],
deps = [
"//:ray_lib",
"//python/ray/serve:serve_lib",
],
)
13 changes: 10 additions & 3 deletions release/long_running_tests/workloads/serve_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# RandomTest setup constants
CPUS_PER_NODE = 10

IS_SMOKE_TEST = "IS_SMOKE_TEST" in os.environ


def update_progress(result):
"""
Expand Down Expand Up @@ -54,7 +56,8 @@ def update_progress(result):
namespace="serve_failure_test",
address=cluster.address,
dashboard_host="0.0.0.0",
log_to_driver=True)
log_to_driver=True,
)
serve.start(detached=True)


Expand Down Expand Up @@ -124,7 +127,7 @@ def run(self):
start_time = time.time()
previous_time = start_time
while True:
for _ in range(100):
for _ in range(20):
actions, weights = zip(*self.weighted_actions)
action_chosen = random.choices(actions, weights=weights)[0]
print(f"Executing {action_chosen}")
Expand All @@ -146,7 +149,11 @@ def run(self):
previous_time = new_time
iteration += 1

if IS_SMOKE_TEST:
break


tester = RandomTest(max_deployments=NUM_NODES * CPUS_PER_NODE)
random_killer = RandomKiller.remote()
random_killer.run.remote()
RandomTest(max_deployments=NUM_NODES * CPUS_PER_NODE).run()
tester.run()

0 comments on commit ca90c63

Please sign in to comment.