mirror of
https://github.com/wassname/ray.git
synced 2026-07-08 17:52:27 +08:00
[ray_client]: Move from experimental to util (#13176)
Change-Id: I9f054881f0429092d265cd6944d89804cce9d946
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from ray.util.client.ray_client_helpers import ray_start_client_server
|
||||
|
||||
|
||||
def test_get_ray_metadata(ray_start_regular_shared):
|
||||
"""Test the ClusterInfo client data pathway and API surface
|
||||
"""
|
||||
with ray_start_client_server() as ray:
|
||||
ip_address = ray_start_regular_shared["node_ip_address"]
|
||||
|
||||
initialized = ray.is_initialized()
|
||||
assert initialized
|
||||
|
||||
nodes = ray.nodes()
|
||||
assert len(nodes) == 1, nodes
|
||||
assert nodes[0]["NodeManagerAddress"] == ip_address
|
||||
|
||||
current_node_id = "node:" + ip_address
|
||||
|
||||
cluster_resources = ray.cluster_resources()
|
||||
available_resources = ray.available_resources()
|
||||
|
||||
assert cluster_resources["CPU"] == 1.0
|
||||
assert current_node_id in cluster_resources
|
||||
assert current_node_id in available_resources
|
||||
Reference in New Issue
Block a user