[Dashboard] Start the new dashboard (#9860)

This commit is contained in:
fyrestone
2020-08-13 11:01:46 +08:00
committed by GitHub
parent 16486a8df3
commit 739933e5b8
34 changed files with 1077 additions and 103 deletions
+7 -3
View File
@@ -617,8 +617,11 @@ class Node:
if we fail to start the dashboard. Otherwise it will print
a warning if we fail to start the dashboard.
"""
stdout_file, stderr_file = self.get_log_file_handles(
"dashboard", unique=True)
if "RAY_USE_NEW_DASHBOARD" in os.environ:
stdout_file, stderr_file = None, None
else:
stdout_file, stderr_file = self.get_log_file_handles(
"dashboard", unique=True)
self._webui_url, process_info = ray.services.start_dashboard(
require_dashboard,
self._ray_params.dashboard_host,
@@ -800,7 +803,8 @@ class Node:
self.start_plasma_store()
self.start_raylet()
self.start_reporter()
if "RAY_USE_NEW_DASHBOARD" not in os.environ:
self.start_reporter()
if self._ray_params.include_log_monitor:
self.start_log_monitor()
+27 -1
View File
@@ -1162,8 +1162,14 @@ def start_dashboard(require_dashboard,
raise ValueError("The given dashboard port {}"
" is already in use".format(port))
if "RAY_USE_NEW_DASHBOARD" in os.environ:
dashboard_dir = "new_dashboard"
else:
dashboard_dir = "dashboard"
dashboard_filepath = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "dashboard/dashboard.py")
os.path.dirname(os.path.abspath(__file__)), dashboard_dir,
"dashboard.py")
command = [
sys.executable,
"-u",
@@ -1398,6 +1404,23 @@ def start_raylet(redis_address,
if load_code_from_local:
start_worker_command += ["--load-code-from-local"]
# Create agent command
agent_command = [
sys.executable,
"-u",
os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"new_dashboard/agent.py"),
"--redis-address={}".format(redis_address),
"--node-manager-port={}".format(node_manager_port),
"--object-store-name={}".format(plasma_store_name),
"--raylet-name={}".format(raylet_name),
"--temp-dir={}".format(temp_dir),
]
if redis_password is not None and len(redis_password) != 0:
agent_command.append("--redis-password={}".format(redis_password))
command = [
RAYLET_EXECUTABLE,
"--raylet_socket_name={}".format(raylet_name),
@@ -1426,6 +1449,9 @@ def start_raylet(redis_address,
if start_initial_python_workers_for_first_job:
command.append("--num_initial_python_workers_for_first_job={}".format(
resource_spec.num_cpus))
if "RAY_USE_NEW_DASHBOARD" in os.environ:
command.append("--agent_command={}".format(
subprocess.list2cmdline(agent_command)))
if config.get("plasma_store_as_thread"):
# command related to the plasma store
plasma_directory, object_store_memory = determine_plasma_store_config(
+2 -1
View File
@@ -133,6 +133,7 @@ extras["all"] = list(set(chain.from_iterable(extras.values())))
# the change in the matching section of requirements.txt
install_requires = [
"aiohttp",
"aiohttp_cors",
"aioredis",
"click >= 7.0",
"colorama",
@@ -408,7 +409,7 @@ def api_main(program, *args):
nonlocal result
if excinfo[1].errno != errno.ENOENT:
msg = excinfo[1].strerror
logger.error("cannot remove {}: {}" % (path, msg))
logger.error("cannot remove {}: {}".format(path, msg))
result = 1
for subdir in CLEANABLE_SUBDIRS: