add log-dir to new dashboard (#10885)

This commit is contained in:
SongGuyang 2020-09-24 13:40:37 +08:00 committed by GitHub
parent 4fa6523e4e
commit f9b040db52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -634,6 +634,7 @@ class Node:
self._ray_params.dashboard_host,
self.redis_address,
self._temp_dir,
self._logs_dir,
stdout_file=stdout_file,
stderr_file=stderr_file,
redis_password=self._ray_params.redis_password,

View file

@ -992,6 +992,7 @@ def start_dashboard(require_dashboard,
host,
redis_address,
temp_dir,
logdir,
port=ray_constants.DEFAULT_DASHBOARD_PORT,
stdout_file=None,
stderr_file=None,
@ -1009,6 +1010,7 @@ def start_dashboard(require_dashboard,
redis_address (str): The address of the Redis instance.
temp_dir (str): The temporary directory used for log files and
information for this Ray session.
logdir (str): The log directory used to generate dashboard log.
stdout_file: A file handle opened for writing to redirect stdout to. If
no redirection should happen, then this should be None.
stderr_file: A file handle opened for writing to redirect stderr to. If
@ -1040,6 +1042,7 @@ def start_dashboard(require_dashboard,
dashboard_dir = "new_dashboard"
else:
dashboard_dir = "dashboard"
logdir = None
dashboard_filepath = os.path.join(
os.path.dirname(os.path.abspath(__file__)), dashboard_dir,
@ -1053,6 +1056,8 @@ def start_dashboard(require_dashboard,
f"--redis-address={redis_address}",
f"--temp-dir={temp_dir}",
]
if logdir:
command += [f"--log-dir={logdir}"]
if redis_password:
command += ["--redis-password", redis_password]