mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 19:32:11 +08:00
[Hotfix] Pin Pydantic Version (#11622)
This commit is contained in:
@@ -11,7 +11,7 @@ opencv-python-headless==4.3.0.36
|
||||
pandas
|
||||
pickle5
|
||||
pillow
|
||||
pydantic
|
||||
pydantic<1.7
|
||||
pygments
|
||||
pyyaml
|
||||
recommonmark
|
||||
|
||||
@@ -19,6 +19,37 @@ from ray.test_utils import wait_for_condition
|
||||
from ray._private.services import new_port
|
||||
|
||||
|
||||
def test_detached_deployment():
|
||||
# https://github.com/ray-project/ray/issues/11437
|
||||
|
||||
cluster = Cluster()
|
||||
head_node = cluster.add_node(node_ip_address="127.0.0.1", num_cpus=6)
|
||||
|
||||
# Create first job, check we can run a simple serve endpoint
|
||||
ray.init(head_node.address)
|
||||
first_job_id = ray.get_runtime_context().job_id
|
||||
client = serve.start(detached=True)
|
||||
client.create_backend("f", lambda _: "hello")
|
||||
client.create_endpoint("f", backend="f")
|
||||
assert ray.get(client.get_handle("f").remote()) == "hello"
|
||||
|
||||
ray.shutdown()
|
||||
|
||||
# Create the second job, make sure we can still create new backends.
|
||||
ray.init(head_node.address)
|
||||
assert ray.get_runtime_context().job_id != first_job_id
|
||||
|
||||
client = serve.connect()
|
||||
client.create_backend("g", lambda _: "world")
|
||||
client.create_endpoint("g", backend="g")
|
||||
assert ray.get(client.get_handle("g").remote()) == "world"
|
||||
|
||||
# Test passed, clean up.
|
||||
client.shutdown()
|
||||
ray.shutdown()
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not hasattr(socket, "SO_REUSEPORT"),
|
||||
reason=("Port sharing only works on newer verion of Linux. "
|
||||
@@ -172,36 +203,5 @@ def test_cluster_handle_affinity():
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
def test_detached_deployment():
|
||||
# https://github.com/ray-project/ray/issues/11437
|
||||
|
||||
cluster = Cluster()
|
||||
head_node = cluster.add_node(node_ip_address="127.0.0.1", num_cpus=6)
|
||||
|
||||
# Create first job, check we can run a simple serve endpoint
|
||||
ray.init(head_node.address)
|
||||
first_job_id = ray.get_runtime_context().job_id
|
||||
client = serve.start(detached=True)
|
||||
client.create_backend("f", lambda _: "hello")
|
||||
client.create_endpoint("f", backend="f")
|
||||
assert ray.get(client.get_handle("f").remote()) == "hello"
|
||||
|
||||
ray.shutdown()
|
||||
|
||||
# Create the second job, make sure we can still create new backends.
|
||||
ray.init(head_node.address)
|
||||
assert ray.get_runtime_context().job_id != first_job_id
|
||||
|
||||
client = serve.connect()
|
||||
client.create_backend("g", lambda _: "world")
|
||||
client.create_endpoint("g", backend="g")
|
||||
assert ray.get(client.get_handle("g").remote()) == "world"
|
||||
|
||||
# Test passed, clean up.
|
||||
client.shutdown()
|
||||
ray.shutdown()
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(pytest.main(["-v", "-s", __file__]))
|
||||
|
||||
@@ -37,7 +37,7 @@ scipy==1.4.1
|
||||
tabulate
|
||||
tensorboardX
|
||||
uvicorn
|
||||
pydantic
|
||||
pydantic<1.7
|
||||
dataclasses; python_version < '3.7'
|
||||
|
||||
# Requirements for running tests
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ optional_ray_files += ray_dashboard_files
|
||||
extras = {
|
||||
"debug": [],
|
||||
"serve": [
|
||||
"uvicorn", "flask", "requests", "pydantic",
|
||||
"uvicorn", "flask", "requests", "pydantic<1.7",
|
||||
"dataclasses; python_version < '3.7'"
|
||||
],
|
||||
"tune": [
|
||||
|
||||
Reference in New Issue
Block a user