mirror of
https://github.com/wassname/ray.git
synced 2026-07-04 00:33:25 +08:00
Use grpc for communication from worker to local raylet (task submission and direct actor args only) (#6118)
* Skeleton for SubmitTask proto * Pass through node manager port, connect in raylet client * Switch submit task to grpc * Check port in use * doc * Remove default port, set port randomly from driver * update * Fix test * Fix object manager test
This commit is contained in:
+10
-9
@@ -153,6 +153,7 @@ def get_address_info_from_redis_helper(redis_address,
|
||||
return {
|
||||
"object_store_address": relevant_client["ObjectStoreSocketName"],
|
||||
"raylet_socket_name": relevant_client["RayletSocketName"],
|
||||
"node_manager_port": relevant_client["NodeManagerPort"]
|
||||
}
|
||||
|
||||
|
||||
@@ -1045,6 +1046,7 @@ def start_dashboard(host,
|
||||
|
||||
def start_raylet(redis_address,
|
||||
node_ip_address,
|
||||
node_manager_port,
|
||||
raylet_name,
|
||||
plasma_store_name,
|
||||
worker_path,
|
||||
@@ -1052,7 +1054,6 @@ def start_raylet(redis_address,
|
||||
session_dir,
|
||||
resource_spec,
|
||||
object_manager_port=None,
|
||||
node_manager_port=None,
|
||||
redis_password=None,
|
||||
use_valgrind=False,
|
||||
use_profiler=False,
|
||||
@@ -1068,6 +1069,8 @@ def start_raylet(redis_address,
|
||||
Args:
|
||||
redis_address (str): The address of the primary Redis server.
|
||||
node_ip_address (str): The IP address of this node.
|
||||
node_manager_port(int): The port to use for the node manager. This must
|
||||
not be 0.
|
||||
raylet_name (str): The name of the raylet socket to create.
|
||||
plasma_store_name (str): The name of the plasma store socket to connect
|
||||
to.
|
||||
@@ -1078,8 +1081,6 @@ def start_raylet(redis_address,
|
||||
resource_spec (ResourceSpec): Resources for this raylet.
|
||||
object_manager_port: The port to use for the object manager. If this is
|
||||
None, then the object manager will choose its own port.
|
||||
node_manager_port: The port to use for the node manager. If this is
|
||||
None, then the node manager will choose its own port.
|
||||
redis_password: The password to use when connecting to Redis.
|
||||
use_valgrind (bool): True if the raylet should be started inside
|
||||
of valgrind. If this is True, use_profiler must be False.
|
||||
@@ -1098,6 +1099,9 @@ def start_raylet(redis_address,
|
||||
Returns:
|
||||
ProcessInfo for the process that was started.
|
||||
"""
|
||||
# The caller must provide a node manager port so that we can correctly
|
||||
# populate the command to start a worker.
|
||||
assert node_manager_port is not None and node_manager_port != 0
|
||||
config = config or {}
|
||||
config_str = ",".join(["{},{}".format(*kv) for kv in config.items()])
|
||||
|
||||
@@ -1137,13 +1141,14 @@ def start_raylet(redis_address,
|
||||
# Create the command that the Raylet will use to start workers.
|
||||
start_worker_command = ("{} {} "
|
||||
"--node-ip-address={} "
|
||||
"--node-manager-port={} "
|
||||
"--object-store-name={} "
|
||||
"--raylet-name={} "
|
||||
"--redis-address={} "
|
||||
"--temp-dir={}".format(
|
||||
sys.executable, worker_path, node_ip_address,
|
||||
plasma_store_name, raylet_name, redis_address,
|
||||
temp_dir))
|
||||
node_manager_port, plasma_store_name,
|
||||
raylet_name, redis_address, temp_dir))
|
||||
if redis_password:
|
||||
start_worker_command += " --redis-password {}".format(redis_password)
|
||||
|
||||
@@ -1151,10 +1156,6 @@ def start_raylet(redis_address,
|
||||
# manager to choose its own port.
|
||||
if object_manager_port is None:
|
||||
object_manager_port = 0
|
||||
# If the node manager port is None, then use 0 to cause the node manager
|
||||
# to choose its own port.
|
||||
if node_manager_port is None:
|
||||
node_manager_port = 0
|
||||
|
||||
if load_code_from_local:
|
||||
start_worker_command += " --load-code-from-local "
|
||||
|
||||
Reference in New Issue
Block a user