[Dashboard] Fix and Recommit Reverted Group by Actor Class PR (#10186)

* Revert "Revert "[Dashboard] Group by Actor Class (#10147)" (#10180)"

This reverts commit e4d2ca620a.

* Fix metrics test to agree with the new logical view API

* lint2

Co-authored-by: Max Fitton <max@semprehealth.com>
This commit is contained in:
Max Fitton
2020-08-18 20:55:58 -07:00
committed by GitHub
co-authored by Max Fitton
parent ba0f531da0
commit 9c5e5a9757
10 changed files with 286 additions and 180 deletions
+16 -37
View File
@@ -206,14 +206,15 @@ def test_raylet_info_endpoint(shutdown_only):
except Exception as ex:
print("failed response: {}".format(response.text))
raise ex
actor_info = raylet_info["result"]["actors"]
actors_info = raylet_info["result"]["actors"]
try:
assert len(actor_info) == 1
_, parent_actor_info = actor_info.popitem()
assert parent_actor_info["numObjectRefsInScope"] == 13
assert parent_actor_info["numLocalObjects"] == 10
children = parent_actor_info["children"]
assert len(children) == 2
assert len(actors_info) == 3
c_actor_info = [
actor for actor in actors_info.values()
if "ActorC" in actor["actorTitle"]
][0]
assert c_actor_info["numObjectRefsInScope"] == 13
assert c_actor_info["numLocalObjects"] == 10
break
except AssertionError:
if time.time() > start_time + 30:
@@ -230,16 +231,8 @@ def test_raylet_info_endpoint(shutdown_only):
cpu_resources += slot["allocation"]
return cpu_resources
assert cpu_resources(parent_actor_info) == 2
assert parent_actor_info["numExecutedTasks"] == 4
for _, child_actor_info in children.items():
if child_actor_info["state"] == -1:
assert child_actor_info["requiredResources"]["CustomResource"] == 1
else:
assert child_actor_info[
"state"] == ray.gcs_utils.ActorTableData.ALIVE
assert len(child_actor_info["children"]) == 0
assert cpu_resources(child_actor_info) == 1
assert cpu_resources(c_actor_info) == 2
assert c_actor_info["numExecutedTasks"] == 4
profiling_id = requests.get(
webui_url + "/api/launch_profiling",
@@ -329,26 +322,12 @@ def test_raylet_pending_tasks(shutdown_only):
actor_info = raylet_info["result"]["actors"]
assert len(actor_info) == 1
_, infeasible_actor_info = actor_info.popitem()
# Verify there are 4 spawned actors.
children = infeasible_actor_info["children"]
assert len(children) == 4
pending_actor_detected = 0
for child_id, child in children.items():
if ("invalidStateType" in child
and child["invalidStateType"] == "pendingActor"):
pending_actor_detected += 1
# 4 GPUActors are spawned although there are only 3 GPUs.
# One actor should be in the pending state.
assert pending_actor_detected == 1
assert (wait_until_succeeded_without_exception(
test_pending_actor,
(AssertionError, requests.exceptions.ConnectionError),
addresses,
timeout_ms=30000,
retry_interval_ms=1000) is True)
wait_until_succeeded_without_exception(
test_pending_actor,
(AssertionError, requests.exceptions.ConnectionError),
addresses,
timeout_ms=30000,
retry_interval_ms=1000)
@pytest.mark.skipif(