Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/actor_deaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/apex.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/impala.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/many_actor_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/many_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
resources={str(i): 5},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/many_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0",
dashboard_host="0.0.0.0",
_internal_config=config,
)
ray.init(address=cluster.address)
Expand Down
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/node_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
2 changes: 1 addition & 1 deletion ci/long_running_tests/workloads/pbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")
ray.init(address=cluster.address)

# Run the workload.
Expand Down
4 changes: 2 additions & 2 deletions ci/long_running_tests/workloads/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")

print("Downloading load testing tool")
subprocess.call([
Expand All @@ -31,7 +31,7 @@
"chmod +x hey_linux_amd64"
])

ray.init(address=cluster.address, include_webui=True, webui_host="0.0.0.0")
ray.init(address=cluster.address, dashboard_host="0.0.0.0")
serve.init()


Expand Down
7 changes: 2 additions & 5 deletions ci/long_running_tests/workloads/serve_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@
resources={str(i): 2},
object_store_memory=object_store_memory,
redis_max_memory=redis_max_memory,
webui_host="0.0.0.0")
dashboard_host="0.0.0.0")

ray.init(
address=cluster.address,
include_webui=True,
webui_host="0.0.0.0",
log_to_driver=False)
address=cluster.address, dashboard_host="0.0.0.0", log_to_driver=False)
serve.init()


Expand Down
2 changes: 1 addition & 1 deletion doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ the dashboard. For example,
Note: If Ray is running on a remote node, you will need to set up an
SSH tunnel with local port forwarding in order to access the dashboard
in your browser, e.g. by running 'ssh -L 8265:127.0.0.1:8265
<username>@<host>'. Alternatively, you can set webui_host="0.0.0.0" in
<username>@<host>'. Alternatively, you can set dashboard_host="0.0.0.0" in
the call to ray.init() to allow direct access from external machines.
======================================================================

Expand Down
3 changes: 3 additions & 0 deletions doc/source/ray-dashboard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Getting Started
---------------
You can access the dashboard through its default URL, **localhost:8265**.
(Note that the port number increases if the default port is not available).
If you prefer to explicitly set the port on which the dashboard will run, you can pass
the ``--dashboard-port`` argument with ``ray start`` in the command line, or you can pass the
keyword argument ``dashboard_port`` in your call to ``ray.init()``.

The URL is printed when ``ray.init()`` is called.

Expand Down
23 changes: 12 additions & 11 deletions python/ray/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,24 +539,25 @@ def start_reporter(self):
process_info,
]

def start_dashboard(self, require_webui):
def start_dashboard(self, require_dashboard):
"""Start the dashboard.

Args:
require_webui (bool): If true, this will raise an exception if we
fail to start the webui. Otherwise it will print a warning if
we fail to start the webui.
require_dashboard (bool): If true, this will raise an exception
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.new_log_files("dashboard")
self._webui_url, process_info = ray.services.start_dashboard(
require_webui,
self._ray_params.webui_host,
require_dashboard,
self._ray_params.dashboard_host,
self.redis_address,
self._temp_dir,
stdout_file=stdout_file,
stderr_file=stderr_file,
redis_password=self._ray_params.redis_password,
fate_share=self.kernel_fate_share)
fate_share=self.kernel_fate_share,
port=self._ray_params.dashboard_port)
assert ray_constants.PROCESS_TYPE_DASHBOARD not in self.all_processes
if process_info is not None:
self.all_processes[ray_constants.PROCESS_TYPE_DASHBOARD] = [
Expand Down Expand Up @@ -694,10 +695,10 @@ def start_head_processes(self):

self.start_monitor()

if self._ray_params.include_webui:
self.start_dashboard(require_webui=True)
elif self._ray_params.include_webui is None:
self.start_dashboard(require_webui=False)
if self._ray_params.include_dashboard:
self.start_dashboard(require_dashboard=True)
elif self._ray_params.include_dashboard is None:
self.start_dashboard(require_dashboard=False)

def start_ray_processes(self):
"""Start all of the processes on the node."""
Expand Down
16 changes: 10 additions & 6 deletions python/ray/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ class RayParams:
worker.
huge_pages: Boolean flag indicating whether to start the Object
Store with hugetlbfs support. Requires plasma_directory.
include_webui: Boolean flag indicating whether to start the web
include_dashboard: Boolean flag indicating whether to start the web
UI, which displays the status of the Ray cluster. If this value is
None, then the UI will be started if the relevant dependencies are
present.
webui_host: The host to bind the web UI server to. Can either be
dashboard_host: The host to bind the web UI server to. Can either be
localhost (127.0.0.1) or 0.0.0.0 (available from all interfaces).
By default, this is set to localhost to prevent access from
external machines.
dashboard_port: The port to bind the dashboard server to.
Defaults to 8265.
logging_level: Logging level, default will be logging.INFO.
logging_format: Logging format, default contains a timestamp,
filename, line number, and message. See ray_constants.py.
Expand Down Expand Up @@ -115,8 +117,9 @@ def __init__(self,
plasma_directory=None,
worker_path=None,
huge_pages=False,
include_webui=None,
webui_host="localhost",
include_dashboard=None,
dashboard_host="localhost",
dashboard_port=ray_constants.DEFAULT_DASHBOARD_PORT,
logging_level=logging.INFO,
logging_format=ray_constants.LOGGER_FORMAT,
plasma_store_socket_name=None,
Expand Down Expand Up @@ -153,8 +156,9 @@ def __init__(self,
self.plasma_directory = plasma_directory
self.worker_path = worker_path
self.huge_pages = huge_pages
self.include_webui = include_webui
self.webui_host = webui_host
self.include_dashboard = include_dashboard
self.dashboard_host = dashboard_host
self.dashboard_port = dashboard_port
self.plasma_store_socket_name = plasma_store_socket_name
self.raylet_socket_name = raylet_socket_name
self.temp_dir = temp_dir
Expand Down
1 change: 1 addition & 0 deletions python/ray/ray_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def env_bool(key, default):
# we attempt to start the service running at this port.
DEFAULT_PORT = 6379

DEFAULT_DASHBOARD_PORT = 8265
# Default resource requirements for actors when no resource requirements are
# specified.
DEFAULT_ACTOR_METHOD_CPU_SIMPLE = 1
Expand Down
74 changes: 61 additions & 13 deletions python/ray/scripts/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,16 @@ def cli(logging_level, logging_format):
type=int,
default=8265,
help="The local port to forward to the dashboard")
def dashboard(cluster_config_file, cluster_name, port):
@click.option(
"--remote-port",
required=False,
type=int,
default=8265,
help="The remote port your dashboard runs on")
def dashboard(cluster_config_file, cluster_name, port, remote_port):
"""Port-forward a Ray cluster's dashboard to the local machine."""
# Sleeping in a loop is preferable to `sleep infinity` because the latter
# only works on linux.
remote_port = 8265
if port:
dashboard_port = port
else:
Expand All @@ -99,9 +104,9 @@ def dashboard(cluster_config_file, cluster_name, port):
port_forward = [
(dashboard_port, remote_port),
]
click.echo(
"Attempting to establish dashboard at localhost:{}".format(
port_forward[0][0]))
click.echo(("Attempting to establish dashboard locally at"
" localhost:{} connected to"
" remote port {}").format(dashboard_port, remote_port))
# We want to probe with a no-op that returns quickly to avoid
# exceptions caused by network errors.
exec_cluster(
Expand Down Expand Up @@ -233,14 +238,35 @@ def dashboard(cluster_config_file, cluster_name, port):
"--include-webui",
default=None,
type=bool,
help="provide this argument if the UI should be started")
help="provide this argument if the UI should be started "
"(DEPRECATED: please use --include-dashboard.")
@click.option(
"--webui-host",
required=False,
default="localhost",
help="The host to bind the web UI server to. Can either be localhost "
"(127.0.0.1) or 0.0.0.0 (available from all interfaces). By default, this "
"is set to localhost to prevent access from external machines.")
help="the host to bind the dashboard server to, either localhost "
"(127.0.0.1) or 0.0.0.0 (available from all interfaces). By default,"
" this is localhost."
" (DEPRECATED: please use --dashboard-host)")
@click.option(
"--include-dashboard",
default=None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be starting it by default? A question for another PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am confused. It must be started by default right? Why is i the question for another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do start it by default already. In retrospect, my comment description here could've been more clear. I will rewrite. The default arg of None starts the dashboard.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. So you have to set --include-dashboard=False to not start it? I think I was confused by the flag name.

type=bool,
help="provide this argument to start the Ray dashboard GUI")
@click.option(
"--dashboard-host",
required=False,
default="localhost",
help="the host to bind the dashboard server to, either localhost "
"(127.0.0.1) or 0.0.0.0 (available from all interfaces). By default, this"
"is localhost.")
@click.option(
"--dashboard-port",
required=False,
type=int,
default=ray_constants.DEFAULT_DASHBOARD_PORT,
help="the port to bind the dashboard server to--defaults to {}".format(
ray_constants.DEFAULT_DASHBOARD_PORT))
@click.option(
"--block",
is_flag=True,
Expand Down Expand Up @@ -309,7 +335,8 @@ def start(node_ip_address, redis_address, address, redis_port, port,
redis_shard_ports, object_manager_port, node_manager_port,
min_worker_port, max_worker_port, memory, object_store_memory,
redis_max_memory, num_cpus, num_gpus, resources, head, include_webui,
webui_host, block, plasma_directory, huge_pages, autoscaling_config,
webui_host, include_dashboard, dashboard_host, dashboard_port, block,
plasma_directory, huge_pages, autoscaling_config,
no_redirect_worker_output, no_redirect_output,
plasma_store_socket_name, raylet_socket_name, temp_dir, include_java,
java_worker_options, load_code_from_local, internal_config):
Expand All @@ -323,6 +350,22 @@ def start(node_ip_address, redis_address, address, redis_port, port,
if port is not None and port != redis_port:
raise ValueError("Cannot specify both --port and --redis-port "
"as port is a rename of deprecated redis-port")
if include_webui is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not None we should probably either error or set the value for include_dashboard to what include_webui is set to

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to what you have for the host flags below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

logger.warn("The --include-webui argument will be deprecated soon"
"Please use --include-dashboard instead.")
if include_dashboard is not None:
include_dashboard = include_webui

dashboard_host_default = "localhost"
if webui_host != dashboard_host_default:
logger.warn("The --webui-host argument will be deprecated"
" soon. Please use --dashboard-host instead.")
if webui_host != dashboard_host and dashboard_host != "localhost":
raise ValueError(
"Cannot specify both --webui-host and --dashboard-host,"
" please specify only the latter")
else:
dashboard_host = webui_host

# Convert hostnames to numerical IP address.
if node_ip_address is not None:
Expand Down Expand Up @@ -363,8 +406,9 @@ def start(node_ip_address, redis_address, address, redis_port, port,
raylet_socket_name=raylet_socket_name,
temp_dir=temp_dir,
include_java=include_java,
include_webui=include_webui,
webui_host=webui_host,
include_dashboard=include_dashboard,
dashboard_host=dashboard_host,
dashboard_port=dashboard_port,
java_worker_options=java_worker_options,
load_code_from_local=load_code_from_local,
_internal_config=internal_config)
Expand Down Expand Up @@ -443,8 +487,12 @@ def start(node_ip_address, redis_address, address, redis_port, port,
raise Exception("If --head is not passed in, --redis-max-clients "
"must not be provided.")
if include_webui:
raise Exception("If --head is not passed in, the --include-webui "
raise Exception("If --head is not passed in, the --include-webui"
"flag is not relevant.")
if include_dashboard:
raise ValueError(
"If --head is not passed in, the --include-dashboard"
"flag is not relevant.")
if include_java is not None:
raise ValueError("--include-java should only be set for the head "
"node.")
Expand Down
Loading