Integration of Webui with Ray (#32)

* Initial integration of webui with ray

* Re-organized calling of build-webui in setup.py

* Fixed Lint comments on js code

* Fixed more lint issues

* Fixed various issues

* Fixed directory in services.py

* Small changes.

* Changes to match lint
This commit is contained in:
Wapaul1
2016-11-17 22:33:29 -08:00
committed by Robert Nishihara
parent 7babe0d22f
commit 08707f9408
16 changed files with 693 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
recursive-include webui *
+17
View File
@@ -161,6 +161,22 @@ def start_worker(address_info, worker_path, cleanup=True):
if cleanup:
all_processes.append(p)
def start_webui(redis_port, cleanup=True):
"""This method starts the web interface.
Args:
redis_port (int): The redis server's port
cleanup (bool): True if using Ray in local mode. If cleanup is true, then
this process will be killed by services.cleanup() when the Python process
that imported services exits. This is True by default.
"""
executable = "nodejs" if sys.platform == "linux" or sys.platform == "linux2" else "node"
command = [executable, os.path.join(os.path.abspath(os.path.dirname(__file__)), "../webui/index.js"), str(redis_port)]
with open("/tmp/webui_out.txt", "wb") as out:
p = subprocess.Popen(command, stdout=out)
if cleanup:
all_processes.append(p)
def start_ray_local(node_ip_address="127.0.0.1", num_workers=0, worker_path=None):
"""Start Ray in local mode.
@@ -196,4 +212,5 @@ def start_ray_local(node_ip_address="127.0.0.1", num_workers=0, worker_path=None
start_worker(address_info, worker_path, cleanup=True)
time.sleep(0.3)
# Return the addresses of the relevant processes.
start_webui(redis_port)
return address_info
+6
View File
@@ -1,10 +1,15 @@
from __future__ import print_function
import os
import subprocess
from setuptools import setup, find_packages
import setuptools.command.install as _install
subprocess.check_call(["../../build-webui.sh"])
datafiles = [(root, [os.path.join(root, f) for f in files])
for root, dirs, files in os.walk("./webui")]
class install(_install.install):
def run(self):
subprocess.check_call(["../../build.sh"])
@@ -22,6 +27,7 @@ setup(name="ray",
"lib/python/libplasma.so"],
"photon": ["build/photon_scheduler",
"libphoton.so"]},
data_files=datafiles,
cmdclass={"install": install},
install_requires=["numpy",
"funcsigs",
View File