Start chain replicated GCS with Ray (#1538)

This commit is contained in:
Philipp Moritz
2018-03-07 10:18:58 -08:00
committed by Robert Nishihara
parent 6dbf4f6318
commit a9acfab3a6
9 changed files with 224 additions and 46 deletions
+12
View File
@@ -5,6 +5,8 @@ from __future__ import print_function
import json
import os
import redis
import subprocess
import tempfile
import time
import ray
@@ -130,3 +132,13 @@ def wait_for_pid_to_exit(pid, timeout=20):
return
time.sleep(0.1)
raise Exception("Timed out while waiting for process to exit.")
def run_and_get_output(command):
with tempfile.NamedTemporaryFile() as tmp:
p = subprocess.Popen(command, stdout=tmp)
if p.wait() != 0:
raise RuntimeError("ray start did not terminate properly")
with open(tmp.name, 'r') as f:
result = f.readlines()
return "\n".join(result)