Skip to content
New issue

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

[Usage Stats] Record usage stats when dashboard disabled #26042

Merged

Conversation

rkooo567
Copy link
Contributor

Why are these changes needed?

Since usage stats are recorded from the dashboard (which will become API server), it is not collected when the dashboard is not included (include_dashboard=False).

This PR fixes the issues by

  • change dashboard -> API server (to avoid confusing users that dashboard is still started when include_dashboard=False)
  • Only load modules that are irrelevant to the dashboard from the API server, so it will have the same impact as no dashboard.

Related issue number

Checks

  • 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 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 :(

dashboard/tests/test_dashboard.py Outdated Show resolved Hide resolved
include_dashboard: If true, this will load all modules of the
api server to start dashboard. Otherwise, it will only
start the modules that are not relevant to the dashboard.
raise_on_failure: If true, this will raise an exception
if we fail to start the dashboard. Otherwise it will print
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we fail to start the api server or dashboard (since now they are different things)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

API server. I will fix it (there's no time dashboard can be started when API server doesn't)

python/ray/_private/node.py Outdated Show resolved Hide resolved
python/ray/_private/services.py Outdated Show resolved Hide resolved
@@ -1488,7 +1499,7 @@ def start_dashboard(
dashboard_url = ""
return dashboard_url, process_info
except Exception as e:
if require_dashboard:
if raise_on_failure:
raise e from e
else:
logger.error(f"Failed to start the dashboard: {e}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

dashboard -> api server? make sure other places are updated consistently

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I will just keep the dashboard in this PR (it is a little random from end users saying API server now when the full refactoring is not done. For example, the process name is dashboard.py). I will address this comment when we change all dashboard -> API server.

Comment on lines +48 to +49
minimal: bool = False,
modules_to_load: Optional[Set[str]] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if minimal conflicts with modules_to_load?

Could you also remind me why do we need to pass in the --minimal flag instead of figuring out by itself inside dashboard process?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, we figure out the minimal modules inside the dashboard process. --minimal was passed to not start HTTP server (which is only available at ray[default]).

Right now, if it conflicts, it will fail to start a server (I will add a test). It is okay to not handle this well now because this is not exposed to users (and modules_to_load is only used for this use case although this can be used for replicating the API server with different functionalities in the future).

Also in the follow-up PR, I will clean up this code path (rename --minimal to --disable-http-server, and choose minimal modules at the proc start time and use modules_to_load to start them).

@rkooo567
Copy link
Contributor Author

@jjyao will address your comments soon

@rkooo567 rkooo567 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Jul 24, 2022
@rkooo567 rkooo567 removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Jul 26, 2022
dashboard/dashboard.py Outdated Show resolved Hide resolved
dashboard/modules/usage_stats/usage_stats_head.py Outdated Show resolved Hide resolved
@jjyao
Copy link
Collaborator

jjyao commented Jul 27, 2022

Failed tests seems related

//python/ray/tests:test_usage_stats                                     TIMEOUT in 3 out of 3 in 303.0s

@jjyao
Copy link
Collaborator

jjyao commented Jul 27, 2022

Oh, seems we are on the edge. Just need to change it from medium to large size.

@jjyao
Copy link
Collaborator

jjyao commented Jul 27, 2022

Marked the test as large: #27111. Could you pull it?

@rkooo567
Copy link
Contributor Author

Will do. Do you think we need to cherry pick this?

@rkooo567
Copy link
Contributor Author

pulled it just now

@jjyao
Copy link
Collaborator

jjyao commented Jul 28, 2022

Do you think we need to cherry pick this?
If it's low risk, I think we should cherry pick it.

@rkooo567 rkooo567 merged commit 16aa102 into ray-project:master Jul 29, 2022
@rkooo567
Copy link
Contributor Author

Let me see if this breaks anything for next 3~4 days. I think this PR is probably not very low risk PR because I have failed CI many times before merging it..

franklsf95 pushed a commit to franklsf95/ray that referenced this pull request Aug 2, 2022
…#26042)

Since usage stats are recorded from the dashboard (which will become API server), it is not collected when the dashboard is not included (include_dashboard=False).

This PR fixes the issues by

change dashboard -> API server (to avoid confusing users that dashboard is still started when include_dashboard=False)
Only load modules that are irrelevant to the dashboard from the API server, so it will have the same impact as no dashboard.

Signed-off-by: Frank Luan <[email protected]>
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
…#26042)

Since usage stats are recorded from the dashboard (which will become API server), it is not collected when the dashboard is not included (include_dashboard=False).

This PR fixes the issues by

change dashboard -> API server (to avoid confusing users that dashboard is still started when include_dashboard=False)
Only load modules that are irrelevant to the dashboard from the API server, so it will have the same impact as no dashboard.

Signed-off-by: Scott Graham <[email protected]>
gramhagen pushed a commit to gramhagen/ray that referenced this pull request Aug 15, 2022
…#26042)

Since usage stats are recorded from the dashboard (which will become API server), it is not collected when the dashboard is not included (include_dashboard=False).

This PR fixes the issues by

change dashboard -> API server (to avoid confusing users that dashboard is still started when include_dashboard=False)
Only load modules that are irrelevant to the dashboard from the API server, so it will have the same impact as no dashboard.
Chong-Li pushed a commit to alipay/ant-ray that referenced this pull request Aug 16, 2022
…#26042)

Since usage stats are recorded from the dashboard (which will become API server), it is not collected when the dashboard is not included (include_dashboard=False).

This PR fixes the issues by

change dashboard -> API server (to avoid confusing users that dashboard is still started when include_dashboard=False)
Only load modules that are irrelevant to the dashboard from the API server, so it will have the same impact as no dashboard.

Signed-off-by: Chong-Li <[email protected]>
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
…#26042)

Since usage stats are recorded from the dashboard (which will become API server), it is not collected when the dashboard is not included (include_dashboard=False).

This PR fixes the issues by

change dashboard -> API server (to avoid confusing users that dashboard is still started when include_dashboard=False)
Only load modules that are irrelevant to the dashboard from the API server, so it will have the same impact as no dashboard.

Signed-off-by: Stefan van der Kleij <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants