Skip to content

Commit

Permalink
[Autoscaler] Prefix (autoscaler) instead of (scheduler) for autoscale…
Browse files Browse the repository at this point in the history
…r events (#31489)

Signed-off-by: praveeng <praveeng@anyscale.com>

# Why are these changes needed?

Autoscaler event logs are prefixed with (scheduler) which is misleading. This PR changes the prefix to be (autoscaler)

Tested building ray locally and running an application (see attached logs). Added unit tests.

# Related issue number

Closes #24807
  • Loading branch information
gvspraveen authored and AmeerHajAli committed Jan 12, 2023
1 parent b0357fd commit 0721a10
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/ray/_private/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ def color_for(data: Dict[str, str], line: str) -> str:
return colorama.Fore.CYAN

if data.get("pid") == "autoscaler":
pid = "scheduler +{}".format(time_string())
pid = "autoscaler +{}".format(time_string())
lines = filter_autoscaler_events(data.get("lines", []))
else:
pid = data.get("pid")
Expand Down
24 changes: 24 additions & 0 deletions python/ray/tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,30 @@ def f():
assert "Tip:" not in err_str


def test_autoscaler_prefix():
script = """
import ray
import time
ray.init(num_cpus=1)
@ray.remote(num_cpus=1)
class A:
pass
a = A.remote()
b = A.remote()
time.sleep(25)
"""

proc = run_string_as_driver_nonblocking(script)
out_str = proc.stdout.read().decode("ascii")
err_str = proc.stderr.read().decode("ascii")

print(out_str, err_str)
assert "(autoscaler" in out_str


@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.")
def test_fail_importing_actor(ray_start_regular, error_pubsub):
script = f"""
Expand Down

0 comments on commit 0721a10

Please sign in to comment.