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

[Core] Check that temp_dir must be absolute path. #36431

Merged
merged 6 commits into from
Jun 16, 2023

Conversation

rynewang
Copy link
Contributor

@rynewang rynewang commented Jun 14, 2023

Why are these changes needed?

ray.init accepts a _temp_dir arg. The arg should be absolute path because it makes no sense to have a "relative path" on all nodes. However the code did not check that and proceeds as if it is absolute path. This makes the init code to hang and timeout.

Example issues for treating it as absolute: the latest_session symlink links to the temp_dir and if it is relative path it won't work.

Compatibility Analysis

The call ray.init() times out when the arg is relative path, so it never worked and now we forbid it. This won't break any existing usage.

Related issue number

Closes #30650.

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

Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

Can you add a test?

@rynewang
Copy link
Contributor Author

Can you add a test?

do you have a suggested place to place the test?

Copy link
Member

@cadedaniel cadedaniel left a comment

Choose a reason for hiding this comment

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

Nice fix! Can you add [Core] prefix to the PR title? a process we follow so that release notes are easier to make

python/ray/_private/parameter.py Show resolved Hide resolved
@rynewang rynewang changed the title Check that temp_dir must be absolute path. [Core] Check that temp_dir must be absolute path. Jun 14, 2023
@rynewang
Copy link
Contributor Author

force-pushed because the test commit did not have signed-off-by.

python/ray/tests/test_basic.py Outdated Show resolved Hide resolved
rynewang added 4 commits June 15, 2023 14:32
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
rynewang added 2 commits June 15, 2023 15:02
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
@rynewang
Copy link
Contributor Author

Looks like the test failures are not related to my change. @jjyao would you mind taking a look and merge?

@jjyao jjyao merged commit 93b079d into ray-project:master Jun 16, 2023
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
ray.init accepts a _temp_dir arg. The arg should be absolute path because it makes no sense to have a "relative path" on all nodes. However the code did not check that and proceeds as if it is absolute path. This makes the init code to hang and timeout.

Example issues for treating it as absolute: the latest_session symlink links to the temp_dir and if it is relative path it won't work.

Signed-off-by: Ruiyang Wang <rywang014@gmail.com>
Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
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.

[core] ray.init raises Error when giving _temp_dir argument
4 participants