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

[build_base] [Tune] Add more comprehensive support for remote upload_dir w/ endpoint and params #32479

Merged

Conversation

justinvyu
Copy link
Contributor

@justinvyu justinvyu commented Feb 13, 2023

Why are these changes needed?

Problem

Currently, URI handling with parameters is done in multiple places in different ways (using urllib.parse or splitting by '?' directly). In some places, it's not done at all, which causes errors when performing cloud checkpointing. In particular, Trial.remote_checkpoint_dir and Trainable._storage_path do not handle URI path appends correctly when URL params are present.

Example:

SyncConfig(upload_dir="s3://bucket?region=us-west-2&endpoint_override=http://localhost:5002")

Solution

This PR introduces a URI utility class that appends/gets the parent/name of a URI. All of the URI handling now goes through this utility, rather than doing os.path.join/manually parsing the string.

This PR also improves the moto mock s3 simulate_storage helper, and introduces a fixture in test_syncer and example usage in an end to end Tune run that saves to the cloud.

Related issue number

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 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: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
…Server

Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Copy link
Member

@Yard1 Yard1 left a comment

Choose a reason for hiding this comment

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

Really nice!

@justinvyu justinvyu changed the title [Tune] Add more comprehensive support for remote upload_dir w/ endpoint and params [build_base] [Tune] Add more comprehensive support for remote upload_dir w/ endpoint and params Feb 13, 2023
Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Copy link
Contributor

@krfricke krfricke left a comment

Choose a reason for hiding this comment

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

Awesome! Let's run cloud tests

@krfricke krfricke merged commit 2f2080f into ray-project:master Feb 15, 2023
justinvyu added a commit to justinvyu/ray that referenced this pull request Feb 15, 2023
… `upload_dir` w/ endpoint and params (ray-project#32479)"

This reverts commit 2f2080f.
xwjiang2010 pushed a commit that referenced this pull request Feb 15, 2023
… `upload_dir` w/ endpoint and params (#32479)" (#32571)

This reverts commit 2f2080f.
justinvyu added a commit to justinvyu/ray that referenced this pull request Feb 15, 2023
…r remote `upload_dir` w/ endpoint and params (ray-project#32479)" (ray-project#32571)"

This reverts commit 350fb13.
krfricke pushed a commit that referenced this pull request Feb 16, 2023
…_dir w/ url params (#32479)" (#32576)

This reverts the revert made here #32571.

This PR fixes two suites of tests that were failing:
1. workflows tests were failing due to the pinned `moto` version being too old.
2. `test_syncer` errors were caused by reusing the same bucket name between tests.

This PR also fixes the `restore` path for URIs with params, which was missing from the previous PR. The e2e sync test has been updated to also test restoration.

Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
…_dir` w/ endpoint and params (ray-project#32479)

Currently, URI handling with parameters is done in multiple places in different ways (using `urllib.parse` or splitting by `'?'` directly). In some places, it's not done at all, which **causes errors when performing cloud checkpointing.** In particular, `Trial.remote_checkpoint_dir` and `Trainable._storage_path` do not handle URI path appends correctly when URL params are present.

Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
… `upload_dir` w/ endpoint and params (ray-project#32479)" (ray-project#32571)

This reverts commit 2f2080f.

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
…_dir w/ url params (ray-project#32479)" (ray-project#32576)

This reverts the revert made here ray-project#32571.

This PR fixes two suites of tests that were failing:
1. workflows tests were failing due to the pinned `moto` version being too old.
2. `test_syncer` errors were caused by reusing the same bucket name between tests.

This PR also fixes the `restore` path for URIs with params, which was missing from the previous PR. The e2e sync test has been updated to also test restoration.

Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
peytondmurray pushed a commit to peytondmurray/ray that referenced this pull request Mar 22, 2023
peytondmurray pushed a commit to peytondmurray/ray that referenced this pull request Mar 22, 2023
…_dir w/ url params (ray-project#32479)" (ray-project#32576)

This reverts the revert made here ray-project#32571.

This PR fixes two suites of tests that were failing:
1. workflows tests were failing due to the pinned `moto` version being too old.
2. `test_syncer` errors were caused by reusing the same bucket name between tests.

This PR also fixes the `restore` path for URIs with params, which was missing from the previous PR. The e2e sync test has been updated to also test restoration.

Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…_dir` w/ endpoint and params (ray-project#32479)

Currently, URI handling with parameters is done in multiple places in different ways (using `urllib.parse` or splitting by `'?'` directly). In some places, it's not done at all, which **causes errors when performing cloud checkpointing.** In particular, `Trial.remote_checkpoint_dir` and `Trainable._storage_path` do not handle URI path appends correctly when URL params are present.

Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: elliottower <elliot@elliottower.com>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
… `upload_dir` w/ endpoint and params (ray-project#32479)" (ray-project#32571)

This reverts commit 2f2080f.

Signed-off-by: elliottower <elliot@elliottower.com>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…_dir w/ url params (ray-project#32479)" (ray-project#32576)

This reverts the revert made here ray-project#32571.

This PR fixes two suites of tests that were failing:
1. workflows tests were failing due to the pinned `moto` version being too old.
2. `test_syncer` errors were caused by reusing the same bucket name between tests.

This PR also fixes the `restore` path for URIs with params, which was missing from the previous PR. The e2e sync test has been updated to also test restoration.

Signed-off-by: Justin Yu <justinvyu@berkeley.edu>
Signed-off-by: elliottower <elliot@elliottower.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.

3 participants