[gRPC] Migrate raylet client implementation to grpc (#5120)

This commit is contained in:
Joey Jiang
2019-07-25 14:48:56 +08:00
committed by Hao Chen
parent 60f59639c1
commit 40395acadf
53 changed files with 1698 additions and 1156 deletions
+12 -8
View File
@@ -458,11 +458,9 @@ print("success")
# Make sure the first driver ran to completion.
assert "success" in out
nonexistent_id_bytes = _random_string()
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
# Define a driver that creates one task that depends on a nonexistent
# object. This task will be queued as waiting to execute.
driver_script = """
driver_script_template = """
import time
import ray
ray.init(redis_address="{}")
@@ -472,11 +470,15 @@ def g(x):
g.remote(ray.ObjectID(ray.utils.hex_to_binary("{}")))
time.sleep(1)
print("success")
""".format(redis_address, nonexistent_id_hex)
"""
# Create some drivers and let them exit and make sure everything is
# still alive.
for _ in range(3):
nonexistent_id_bytes = _random_string()
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
driver_script = driver_script_template.format(redis_address,
nonexistent_id_hex)
out = run_string_as_driver(driver_script)
# Simulate the nonexistent dependency becoming available.
ray.worker.global_worker.put_object(
@@ -484,10 +486,8 @@ print("success")
# Make sure the first driver ran to completion.
assert "success" in out
nonexistent_id_bytes = _random_string()
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
# Define a driver that calls `ray.wait` on a nonexistent object.
driver_script = """
driver_script_template = """
import time
import ray
ray.init(redis_address="{}")
@@ -497,11 +497,15 @@ def g():
g.remote()
time.sleep(1)
print("success")
""".format(redis_address, nonexistent_id_hex)
"""
# Create some drivers and let them exit and make sure everything is
# still alive.
for _ in range(3):
nonexistent_id_bytes = _random_string()
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
driver_script = driver_script_template.format(redis_address,
nonexistent_id_hex)
out = run_string_as_driver(driver_script)
# Simulate the nonexistent dependency becoming available.
ray.worker.global_worker.put_object(