From f9b040db524076a0268da7ec38817bb3f8cd1d5f Mon Sep 17 00:00:00 2001 From: SongGuyang Date: Thu, 24 Sep 2020 13:40:37 +0800 Subject: [PATCH] add log-dir to new dashboard (#10885) --- python/ray/node.py | 1 + python/ray/services.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/python/ray/node.py b/python/ray/node.py index 3cdd2b2d9..885049815 100644 --- a/python/ray/node.py +++ b/python/ray/node.py @@ -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, diff --git a/python/ray/services.py b/python/ray/services.py index c8cb6e109..9094b1e4b 100644 --- a/python/ray/services.py +++ b/python/ray/services.py @@ -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]