mirror of
https://github.com/wassname/ray.git
synced 2026-07-23 13:10:11 +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 unittest
|
||||
import ray
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
@@ -89,7 +90,8 @@ print("success")
|
||||
with tempfile.NamedTemporaryFile() as f:
|
||||
f.write(driver_script.encode("ascii"))
|
||||
f.flush()
|
||||
out = subprocess.check_output(["python", f.name]).decode("ascii")
|
||||
out = subprocess.check_output([sys.executable,
|
||||
f.name]).decode("ascii")
|
||||
|
||||
# Make sure the other driver succeeded.
|
||||
self.assertIn("success", out)
|
||||
@@ -129,7 +131,8 @@ print("success")
|
||||
with tempfile.NamedTemporaryFile() as f:
|
||||
f.write(driver_script.encode("ascii"))
|
||||
f.flush()
|
||||
out = subprocess.check_output(["python", f.name]).decode("ascii")
|
||||
out = subprocess.check_output([sys.executable,
|
||||
f.name]).decode("ascii")
|
||||
|
||||
@ray.remote
|
||||
def f():
|
||||
|
||||
Reference in New Issue
Block a user