Skip to content

Commit

Permalink
add name for actors
Browse files Browse the repository at this point in the history
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
  • Loading branch information
rynewang committed Dec 27, 2024
1 parent e4b9561 commit c79de07
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion python/ray/dashboard/head.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import ray.experimental.internal_kv as internal_kv
from ray._private import ray_constants
from ray._private.gcs_utils import GcsAioClient
from ray._private.ray_constants import env_integer
from ray._private.ray_constants import RAY_INTERNAL_DASHBOARD_NAMESPACE, env_integer
from ray._private.usage.usage_lib import TagKey, record_extra_usage_tag
from ray._raylet import GcsClient
from ray.dashboard.consts import DASHBOARD_METRIC_PORT
Expand Down Expand Up @@ -229,6 +229,7 @@ def _load_modules(self, modules_to_load: Optional[Set[str]] = None):
max_restarts=-1,
max_task_retries=-1,
scheduling_strategy=node_affinity_strategy,
name=f"{RAY_INTERNAL_DASHBOARD_NAMESPACE}_{cls.__name__}",
)
.remote(gcs_address=self.gcs_address)
)
Expand Down
22 changes: 16 additions & 6 deletions python/ray/dashboard/modules/node/tests/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ def test_nodes_update(enable_test_module, ray_start_with_dashboard):


def test_node_info(disable_aiohttp_cache, ray_start_with_dashboard):

assert wait_until_server_available(ray_start_with_dashboard["webui_url"]) is True
webui_url = ray_start_with_dashboard["webui_url"]
webui_url = format_web_url(webui_url)
node_id = ray_start_with_dashboard["node_id"]

# Get initial actors before any user workload.
response = requests.get(webui_url + f"/nodes/{node_id}")
response.raise_for_status()
detail = response.json()
assert detail["result"] is True, detail["msg"]
detail = detail["data"]["detail"]
initial_actors = detail["actors"]
print(f"initial_actors={initial_actors}")

@ray.remote
class Actor:
def getpid(self):
Expand All @@ -75,11 +90,6 @@ def getpid(self):
actor_pids = [actor.getpid.remote() for actor in actors]
actor_pids = set(ray.get(actor_pids))

assert wait_until_server_available(ray_start_with_dashboard["webui_url"]) is True
webui_url = ray_start_with_dashboard["webui_url"]
webui_url = format_web_url(webui_url)
node_id = ray_start_with_dashboard["node_id"]

# NOTE: Leaving sum buffer time for data to get refreshed
timeout_seconds = RAY_DASHBOARD_STATS_UPDATING_INTERVAL * 1.5

Expand All @@ -106,7 +116,7 @@ def getpid(self):
assert detail["raylet"]["isHeadNode"] is True
assert "raylet" in detail["cmdline"][0]
assert len(detail["workers"]) >= 2
assert len(detail["actors"]) == 2, detail["actors"]
assert len(detail["actors"]) == len(initial_actors) + 2, detail["actors"]

actor_worker_pids = set()
for worker in detail["workers"]:
Expand Down

0 comments on commit c79de07

Please sign in to comment.