mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 13:19:38 +08:00
Start ray client server with 'ray start' (#13217)
This commit is contained in:
@@ -186,6 +186,23 @@ def test_wait_for_nodes(ray_start_cluster_head):
|
||||
assert ray.cluster_resources()["CPU"] == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"call_ray_start", [
|
||||
"ray start --head --ray-client-server-port 20000 " +
|
||||
"--min-worker-port=0 --max-worker-port=0 --port 0"
|
||||
],
|
||||
indirect=True)
|
||||
def test_ray_client(call_ray_start):
|
||||
from ray.util.client import ray
|
||||
ray.connect("localhost:20000")
|
||||
|
||||
@ray.remote
|
||||
def f():
|
||||
return "hello client"
|
||||
|
||||
assert ray.get(f.remote()) == "hello client"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
Reference in New Issue
Block a user