mirror of
https://github.com/wassname/ray.git
synced 2026-08-16 11:27:09 +08:00
[Dashboard] Turn on new dashboard by default pt 2 (#11510)
This commit is contained in:
@@ -495,10 +495,18 @@ def start_ray_process(command,
|
||||
process.kill()
|
||||
raise
|
||||
|
||||
def _get_stream_name(stream):
|
||||
if stream is not None:
|
||||
try:
|
||||
return stream.name
|
||||
except AttributeError:
|
||||
return str(stream)
|
||||
return None
|
||||
|
||||
return ProcessInfo(
|
||||
process=process,
|
||||
stdout_file=stdout_file.name if stdout_file is not None else None,
|
||||
stderr_file=stderr_file.name if stderr_file is not None else None,
|
||||
stdout_file=_get_stream_name(stdout_file),
|
||||
stderr_file=_get_stream_name(stderr_file),
|
||||
use_valgrind=use_valgrind,
|
||||
use_gdb=use_gdb,
|
||||
use_valgrind_profiler=use_valgrind_profiler,
|
||||
@@ -1037,12 +1045,7 @@ def start_dashboard(require_dashboard,
|
||||
raise ValueError(
|
||||
f"The given dashboard port {port} is already in use")
|
||||
|
||||
if "RAY_USE_NEW_DASHBOARD" in os.environ:
|
||||
dashboard_dir = "new_dashboard"
|
||||
else:
|
||||
dashboard_dir = "dashboard"
|
||||
logdir = None
|
||||
|
||||
dashboard_dir = "new_dashboard"
|
||||
dashboard_filepath = os.path.join(RAY_PATH, dashboard_dir, "dashboard.py")
|
||||
command = [
|
||||
sys.executable,
|
||||
@@ -1052,18 +1055,18 @@ def start_dashboard(require_dashboard,
|
||||
f"--port={port}",
|
||||
f"--redis-address={redis_address}",
|
||||
f"--temp-dir={temp_dir}",
|
||||
f"--log-dir={logdir}",
|
||||
]
|
||||
if logdir:
|
||||
command += [f"--log-dir={logdir}"]
|
||||
|
||||
if redis_password:
|
||||
command += ["--redis-password", redis_password]
|
||||
|
||||
webui_dependencies_present = True
|
||||
dashboard_dependencies_present = True
|
||||
try:
|
||||
import aiohttp # noqa: F401
|
||||
import grpc # noqa: F401
|
||||
except ImportError:
|
||||
webui_dependencies_present = False
|
||||
dashboard_dependencies_present = False
|
||||
warning_message = (
|
||||
"Failed to start the dashboard. The dashboard requires Python 3 "
|
||||
"as well as 'pip install aiohttp grpcio'.")
|
||||
@@ -1071,8 +1074,7 @@ def start_dashboard(require_dashboard,
|
||||
raise ImportError(warning_message)
|
||||
else:
|
||||
logger.warning(warning_message)
|
||||
|
||||
if webui_dependencies_present:
|
||||
if dashboard_dependencies_present:
|
||||
process_info = start_ray_process(
|
||||
command,
|
||||
ray_constants.PROCESS_TYPE_DASHBOARD,
|
||||
@@ -1151,6 +1153,7 @@ def start_raylet(redis_address,
|
||||
worker_path,
|
||||
temp_dir,
|
||||
session_dir,
|
||||
log_dir,
|
||||
resource_spec,
|
||||
plasma_directory,
|
||||
object_store_memory,
|
||||
@@ -1189,6 +1192,7 @@ def start_raylet(redis_address,
|
||||
processes will execute.
|
||||
temp_dir (str): The path of the temporary directory Ray will use.
|
||||
session_dir (str): The path of this session.
|
||||
log_dir (str): The path of the dir where log files are created.
|
||||
resource_spec (ResourceSpec): Resources for this raylet.
|
||||
object_manager_port: The port to use for the object manager. If this is
|
||||
None, then the object manager will choose its own port.
|
||||
@@ -1320,12 +1324,14 @@ def start_raylet(redis_address,
|
||||
sys.executable,
|
||||
"-u",
|
||||
os.path.join(RAY_PATH, "new_dashboard/agent.py"),
|
||||
"--redis-address={}".format(redis_address),
|
||||
"--metrics-export-port={}".format(metrics_export_port),
|
||||
"--node-manager-port={}".format(node_manager_port),
|
||||
"--object-store-name={}".format(plasma_store_name),
|
||||
"--raylet-name={}".format(raylet_name),
|
||||
"--temp-dir={}".format(temp_dir),
|
||||
f"--redis-address={redis_address}",
|
||||
f"--metrics-export-port={metrics_export_port}",
|
||||
f"--dashboard-agent-port={metrics_agent_port}",
|
||||
f"--node-manager-port={node_manager_port}",
|
||||
f"--object-store-name={plasma_store_name}",
|
||||
f"--raylet-name={raylet_name}",
|
||||
f"--temp-dir={temp_dir}",
|
||||
f"--log-dir={log_dir}",
|
||||
]
|
||||
|
||||
if redis_password is not None and len(redis_password) != 0:
|
||||
@@ -1360,9 +1366,8 @@ 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)))
|
||||
command.append("--agent_command={}".format(
|
||||
subprocess.list2cmdline(agent_command)))
|
||||
if config.get("plasma_store_as_thread"):
|
||||
# command related to the plasma store
|
||||
command += [
|
||||
|
||||
Reference in New Issue
Block a user