Skip to content

[Storage] Fix exclusion for AWS bucket upload #5128

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

Merged
merged 19 commits into from
Apr 9, 2025
Merged

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Apr 7, 2025

In AWS S3 upload, --exclude flag requires a tailing ** to exclude a folder. This PR fixes this.

To reproduce, run the smoke test added in this PR on master:
pytest tests/test_smoke.py -k test_skyignore_exclusions --aws

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • smoke test above on master failed and succeed on this branch
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 7, 2025

/smoke-test -k test_skyignore_exclusions --aws
https://buildkite.com/skypilot-1/smoke-tests/builds/573

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 7, 2025

/smoke-test -k test_skyignore_exclusions --gcp
https://buildkite.com/skypilot-1/smoke-tests/builds/574

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 7, 2025

/smoke-test -k test_skyignore_exclusions --azure
https://buildkite.com/skypilot-1/smoke-tests/builds/575

@Michaelvll Michaelvll requested a review from cg505 April 7, 2025 16:48
cg505
cg505 previously approved these changes Apr 7, 2025
Copy link
Collaborator

@cg505 cg505 left a comment

Choose a reason for hiding this comment

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

thanks for the fix and new smoke test!

os.path.join(src_dir_path, excluded_path.rstrip('/')))):
# Remove any trailing slash and add '/**' to exclude all
# contents
processed_excludes.append(f'{excluded_path.rstrip("/")}/**')
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a blocker - do we need /** or is /* sufficient? see

if item.endswith('/'):
# aws s3 sync and gsutil rsync require * to exclude
# files/dirs under the specified directory.
to_be_excluded += '*'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! This part should be general. Just submitted a commit for this. Also, tested that single '*' works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, adding patterns could cause the handling of our zip upload to fail as we don't use pattern matching in the underlying code. I am removing the pattern matching globally. Running the smoke tests for storage again.

@Michaelvll
Copy link
Collaborator Author

/smoke-test -k storage --aws

@Michaelvll
Copy link
Collaborator Author

/smoke-test -k test_skyignore_exclusions --gcp

@Michaelvll
Copy link
Collaborator Author

/smoke-test -k test_skyignore_exclusions --azure

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 7, 2025

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 7, 2025

/smoke-test -k test_ignore_exclusions --azure
https://buildkite.com/skypilot-1/smoke-tests/builds/605

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 7, 2025

/smoke-test -k test_ignore_exclusions --gcp
https://buildkite.com/skypilot-1/smoke-tests/builds/606

@Michaelvll
Copy link
Collaborator Author

All tests above passed, except for an unrelated test: test_skyserve_update https://buildkite.com/skypilot-1/smoke-tests/builds/604#01961289-9327-40a8-ac2a-bf117f985fd9

@Michaelvll
Copy link
Collaborator Author

@cg505 There are a few more tests added and some additional changes to the core logic. PTAL

Comment on lines +114 to +115
List[str] containing files and folders to be ignored. There won't be any
patterns.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cg505 Could you help double check this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good.

@Michaelvll Michaelvll added this to the v0.9.0 milestone Apr 8, 2025
@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 8, 2025

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 8, 2025

/smoke-test -k test_ignore_exclusions --azure
https://buildkite.com/skypilot-1/smoke-tests/builds/622

@Michaelvll
Copy link
Collaborator Author

Michaelvll commented Apr 8, 2025

/smoke-test -k test_ignore_exclusions --gcp
https://buildkite.com/skypilot-1/smoke-tests/builds/623

Copy link
Collaborator

@cg505 cg505 left a comment

Choose a reason for hiding this comment

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

One minor fix

Comment on lines +114 to +115
List[str] containing files and folders to be ignored. There won't be any
patterns.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good.

@cg505 cg505 dismissed their stale review April 8, 2025 18:13

newer review

@cg505
Copy link
Collaborator

cg505 commented Apr 8, 2025

also seems there are some failing unit tests

@Michaelvll
Copy link
Collaborator Author

@cg505 PTAL

@Michaelvll
Copy link
Collaborator Author

/smoke-test

Copy link
Collaborator

@cg505 cg505 left a comment

Choose a reason for hiding this comment

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

lgtm!

@Michaelvll Michaelvll merged commit c8409ed into master Apr 9, 2025
22 checks passed
@Michaelvll Michaelvll deleted the jobs-exclude-files branch April 9, 2025 18:16
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.

None yet

2 participants