Dashboard-host not working

Doing
ray start --head --dashboard-host=0.0.0.0
as suggested here Ray Dashboard — Ray 2.33.0
doesn’t work.
Instead the dashboard is always directed to 127.0.0.1:8265

Looking at ray node.py line 186:

 # Initialize webui url
  if head:
      self._webui_url = None
  else:
      if ray_params.webui is None:
          assert not self._default_worker
          self._webui_url = ray._private.services.get_webui_url_from_internal_kv()
      else:
          self._webui_url = (
              f"{ray_params.dashboard_host}:{ray_params.dashboard_port}"
          )

suggests that if head, the dashboard host is ignored. Is this expected?

I am on Windows.

I think this line changes the IP from 0.0.0.0 to 127.0.0.1: ray/python/ray/dashboard/http_server_head.py at d0b1edf83837ce207aaaefe1cdf9d57037dd6cfd · ray-project/ray · GitHub
And the change was from this PR: [Dashboard] Enable dashboard in the minimal ray installation by rkooo567 · Pull Request #21896 · ray-project/ray · GitHub

@sangcho Do you remember why we needed this change?

I think the change is older than that, PR 21896 just moved the code around. The is_unspecified line was added in PR 15506 and has the comment

The dashboard address may not be connectable. e.g. ray.init(dashboard_host='0.0.0.0') returns a http://0.0.0.0:8265 as the webui url.

Maybe @fyrestone or @kfstorm could add more context.

1 Like

Apologies, the flag --dashboard-host does work
I was not able to access the dashboard for another reason and I was tricked by this startup message into thinking that --dashboard-host=0.0.0.0 did not have an effect.

To connect to this Ray cluster:
    import ray
    ray.init()

  To submit a Ray job using the Ray Jobs CLI:
    RAY_ADDRESS='http://127.0.0.1:8265' ray job submit --working-dir . -- python my_script.py

  See https://docs.ray.io/en/latest/cluster/running-applications/job-submission/index.html
  for more information on submitting Ray jobs to the Ray cluster.

  To terminate the Ray runtime, run
    ray stop

  To view the status of the cluster, use
    ray status

  To monitor and debug Ray, view the dashboard at
    127.0.0.1:8265

All is working as expected.