mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 17:02:43 +08:00
File HANDLE/descriptor translation layer for Windows (#7657)
* Use TCP sockets on Windows with custom HANDLE <-> FD translation layer * Get Plasma working on Windows Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
+16
-9
@@ -89,6 +89,7 @@ class Node:
|
||||
"workers/default_worker.py"))
|
||||
|
||||
self._resource_spec = None
|
||||
self._localhost = socket.gethostbyname("localhost")
|
||||
self._ray_params = ray_params
|
||||
self._redis_address = ray_params.redis_address
|
||||
self._config = ray_params._internal_config
|
||||
@@ -396,15 +397,21 @@ class Node:
|
||||
Args:
|
||||
socket_path (string): the socket file to prepare.
|
||||
"""
|
||||
if socket_path is not None:
|
||||
if os.path.exists(socket_path):
|
||||
raise RuntimeError(
|
||||
"Socket file {} exists!".format(socket_path))
|
||||
socket_dir = os.path.dirname(socket_path)
|
||||
try_to_create_directory(socket_dir)
|
||||
return socket_path
|
||||
return self._make_inc_temp(
|
||||
prefix=default_prefix, directory_name=self._sockets_dir)
|
||||
result = socket_path
|
||||
if sys.platform == "win32":
|
||||
if socket_path is None:
|
||||
result = "tcp://{}:{}".format(self._localhost,
|
||||
self._get_unused_port())
|
||||
else:
|
||||
if socket_path is None:
|
||||
result = self._make_inc_temp(
|
||||
prefix=default_prefix, directory_name=self._sockets_dir)
|
||||
else:
|
||||
if os.path.exists(socket_path):
|
||||
raise RuntimeError(
|
||||
"Socket file {} exists!".format(socket_path))
|
||||
try_to_create_directory(os.path.dirname(socket_path))
|
||||
return result
|
||||
|
||||
def start_reaper_process(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user