[Hotfix] Pin Pydantic Version (#11622)

This commit is contained in:
Simon Mo
2020-10-26 16:52:19 -07:00
committed by GitHub
parent 1a1ff28d18
commit fe4a78b7c7
4 changed files with 34 additions and 34 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ opencv-python-headless==4.3.0.36
pandas
pickle5
pillow
pydantic
pydantic<1.7
pygments
pyyaml
recommonmark
+31 -31
View File
@@ -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__]))
+1 -1
View 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
View File
@@ -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": [