mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 08:53:44 +08:00
Start processes using the same version of Python that was used to start Ray. (#760)
* Make local scheduler start workers using the same version of Python that was used to start the local scheduler. * Use current version of python to start new processes instead of hardcoded python executable. * Fix linting.
This commit is contained in:
committed by
Philipp Moritz
parent
c31c20ca9c
commit
13000b7503
@@ -5,6 +5,7 @@ from __future__ import print_function
|
||||
import os
|
||||
import random
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
@@ -81,13 +82,14 @@ def start_local_scheduler(plasma_store_name,
|
||||
assert plasma_store_name is not None
|
||||
assert plasma_manager_name is not None
|
||||
assert redis_address is not None
|
||||
start_worker_command = ("python {} "
|
||||
start_worker_command = ("{} {} "
|
||||
"--node-ip-address={} "
|
||||
"--object-store-name={} "
|
||||
"--object-store-manager-name={} "
|
||||
"--local-scheduler-name={} "
|
||||
"--redis-address={}"
|
||||
.format(worker_path,
|
||||
.format(sys.executable,
|
||||
worker_path,
|
||||
node_ip_address,
|
||||
plasma_store_name,
|
||||
plasma_manager_name,
|
||||
|
||||
@@ -412,7 +412,7 @@ def start_log_monitor(redis_address, node_ip_address, stdout_file=None,
|
||||
log_monitor_filepath = os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"log_monitor.py")
|
||||
p = subprocess.Popen(["python", log_monitor_filepath,
|
||||
p = subprocess.Popen([sys.executable, log_monitor_filepath,
|
||||
"--redis-address", redis_address,
|
||||
"--node-ip-address", node_ip_address],
|
||||
stdout=stdout_file, stderr=stderr_file)
|
||||
@@ -686,7 +686,7 @@ def start_worker(node_ip_address, object_store_name, object_store_manager_name,
|
||||
Python process that imported services exits. This is True by
|
||||
default.
|
||||
"""
|
||||
command = ["python",
|
||||
command = [sys.executable,
|
||||
worker_path,
|
||||
"--node-ip-address=" + node_ip_address,
|
||||
"--object-store-name=" + object_store_name,
|
||||
@@ -719,7 +719,7 @@ def start_monitor(redis_address, node_ip_address, stdout_file=None,
|
||||
"""
|
||||
monitor_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||
"monitor.py")
|
||||
command = ["python",
|
||||
command = [sys.executable,
|
||||
monitor_path,
|
||||
"--redis-address=" + str(redis_address)]
|
||||
p = subprocess.Popen(command, stdout=stdout_file, stderr=stderr_file)
|
||||
|
||||
Reference in New Issue
Block a user