8000 [Dashboard] Allow getting dashboard URL via RuntimeContext by chuang0221 · Pull Request #52676 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Dashboard] Allow getting dashboard URL via RuntimeContext #52676

New issue 8000

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chuang0221
Copy link
Contributor

Why are these changes needed?

Currently, getting the Ray Dashboard URL programmatically requires capturing the context object returned by ray.init().
This is often inconvenient, especially in interactive environments like Jupyter notebooks, where the initial ray.init() call might have occurred in a previous cell and the context object wasn't stored.

This change introduces a more convenient way to access the dashboard URL anytime after Ray has been initialized, directly through the runtime context. This aligns with the purpose of ray.get_runtime_context() providing runtime information.

The primary use case is simple access within a script or notebook:

import ray

ctx = ray.get_runtime_context()
print(ctx.get_dashboard_url())

This PR implements the get_dashboard_url() method on ray.runtime_context.RuntimeContext. Corresponding unit tests and documentation updates are included.

Related issue number

Closes #52629

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: chuang0221 <chuangellow@gmail.com>
Signed-off-by: chuang0221 <chuangellow@gmail.com>
@chuang0221 chuang0221 requested a review from a team as a code owner April 29, 2025 07:31
@chuang0221 chuang0221 marked this pull request as draft April 29, 2025 07:31
@chuang0221 chuang0221 changed the title Add runtime context dashboard url [Dashboard] Allow getting dashboard URL via RuntimeContext Apr 29, 2025
@chuang0221 chuang0221 marked this pull request as ready for review April 29, 2025 11:33
Copy link
Contributor
@wingkitlee0 wingkitlee0 left a comment

Choose a reason for hiding this comment

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

left some minor comments


INFO worker.py:1487 -- Connected to Ray cluster. View the dashboard at 127.0.0.1:8265.

There are two ways to get the dashboard URL programmatically:
Copy link
Contributor

Choose a reason for hiding this comment

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

For a "getting started" doc, it should be okay to suggest only one recommended option. Let Ray team decide whether the new get_dashboard_url() can be used as the default method..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I agree that for the "getting started" documentation, it’s best to recommend a single, clear method. For now, I’ll keep both options until we get further feedback from the Ray team.

Signed-off-by: chuang0221 <chuangellow@gmail.com>
@chuang0221
Copy link
Contributor Author

The CI test failure doesn't seem to be related to my changes.

@hainesmichaelc hainesmichaelc added the community-contribution Contributed by the community label Apr 30, 2025
@masoudcharkhabi masoudcharkhabi added the dashboard Issues specific to the Ray Dashboard label May 1, 2025
Copy link
github-actions bot commented Jun 9, 2025

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 9, 2025
@wingkitlee0
Copy link
Contributor

@richardliaw can you help us get some eyes on this PR? thanks

@github-actions github-actions bot removed the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 10, 2025
Copy link

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 25, 2025
@cszhu cszhu removed the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Contributed by the community dashboard Issues specific to the Ray Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] A get_dashboard_url() API
5 participants
0