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

[Client] disable auto init for get_runtime_context() #19127

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

mwtian
Copy link
Member

@mwtian mwtian commented Oct 6, 2021

Why are these changes needed?

ray.get_runtime_context() is sometimes called without Ray initialized, to test if the logic is indeed running with Ray. It seems we should not auto initialize Ray from calling this API.

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

@mwtian mwtian requested review from ijrsvt and ckw017 October 6, 2021 21:39
@ckw017
Copy link
Member

ckw017 commented Oct 6, 2021

For context, where is get_runtime_context used to test if the logic is on ray?

Copy link
Contributor

@ijrsvt ijrsvt left a comment

Choose a reason for hiding this comment

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

LGTM! This makes sense :)

Did not realize this function was useful before Ray started.

@mwtian
Copy link
Member Author

mwtian commented Oct 7, 2021

LGTM! This makes sense :)

Did not realize this function was useful before Ray started.

Me neither.

@ijrsvt ijrsvt merged commit fe413c3 into ray-project:master Oct 7, 2021
@jjyao
Copy link
Collaborator

jjyao commented May 30, 2023

Hi @mwtian, do you still have context on this PR. Why do we want to disable auto-init for get_runtime_context()?

@mwtian mwtian deleted the autoinit branch May 31, 2023 21:13
@mwtian
Copy link
Member Author

mwtian commented May 31, 2023

Hi @jjyao! I don't remember the details anymore other than what is in the PR description. I think get_runtime_context() was used just for detecting if a piece of code is running inside Ray client or cluster. And the logic can run without Ray, so it should not try to start Ray itself. I'm not sure if this use case still exists.

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.

4 participants