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

[runtime_env] Change default working_dir behavior to replace local cached version entirely #49313

Merged
merged 45 commits into from
Jan 21, 2025

Conversation

ujjawal-khare
Copy link
Contributor

@ujjawal-khare ujjawal-khare commented Dec 17, 2024

Summary

The runtime environment working directory is not refreshed upon multiple job submissions to the same Ray cluster due to a local cached version of the working directory existing and not fetching the updated version of the directory on S3. This PR changes the default behavior to delete and fetch from S3 again rather than use the cached local directory fetched on the first job submission. This change only applies to the case where multiple jobs are submitted in a row with the same working_dir url.

Related issue number

Closes #49036

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
Contributor

@dayshah dayshah left a comment

Choose a reason for hiding this comment

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

there's a merge conflict, can you update

python/ray/tests/test_runtime_env_working_dir.py Outdated Show resolved Hide resolved
@ujjawal-khare ujjawal-khare changed the title fix for cleaning working dir in case of same uri fix for cleaning working dir in case of same uri [WIP] Dec 27, 2024
Signed-off-by: ujjawal-khare <[email protected]>
Signed-off-by: ujjawal-khare <[email protected]>
ujjawal-khare and others added 3 commits December 27, 2024 12:18
@ujjawal-khare ujjawal-khare changed the title fix for cleaning working dir in case of same uri [WIP] fix for cleaning working dir in case of same uri Dec 27, 2024
@dayshah dayshah added the go add ONLY when ready to merge, run all tests label Dec 31, 2024
@rynewang
Copy link
Contributor

rynewang commented Jan 3, 2025

LGTM, needs Train approval @justinvyu

Comment on lines 252 to 254
return [
os.path.relpath(file_info.path.lstrip("/"), start=fs_path.lstrip("/"))
os.path.relpath(os.path.abspath(file_info.path), start=os.path.abspath(fs_path))
for file_info in fs.get_file_info(selector)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these changes needed for this PR? Converting to abspath before doing relpath is pretty confusing for non-local filesystems (such as S3) where abs path doesn't make sense.

Let's revert this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

@justinvyu The test case was failing Buildkite Link due to an issue with path handling. Specifically, the file system mount was unable to locate the directory because of a mismatch between file_info.path and fs_path. To resolve this, I converted the paths to abs_path to ensure consistency and proper resolution.

Copy link
Contributor

Choose a reason for hiding this comment

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

Where do you see that this test fails due to this line of code? The change above seems unrelated to this code.

As I mentioned above, we should not use abs path for this method anyways.

Copy link
Contributor

Choose a reason for hiding this comment

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

@justinvyu have reverted the change and tests are passing as well. Can you please check?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ujjawal-khare-27 Sorry for missing this -- after the revert my approval is no longer needed. I'll just merge the PR now.

@justinvyu justinvyu changed the title fix for cleaning working dir in case of same uri [runtime_env] Change default working_dir behavior to replace local cached version entirely Jan 21, 2025
@justinvyu justinvyu merged commit 717cafb into ray-project:master Jan 21, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ray Job] : Working Dir files does not get changed even if remote URI contents get changed
6 participants