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:
Robert Nishihara
2017-07-21 00:05:10 +00:00
committed by Philipp Moritz
parent c31c20ca9c
commit 13000b7503
3 changed files with 12 additions and 7 deletions
+5 -2
View File
@@ -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():