Skip to content

Conversation

@pwgardipee
Copy link
Collaborator

What does this PR do?

Allows files to be directly uploaded to R2 buckets when the output_dir points to a lightning_storage folder.

https://www.loom.com/share/8ef98a2adc0c4f7b86543bab9679882d?sid=387f8cbd-48a2-417e-8058-2346d14736d3

Questions for @tchaton and/or @bhimrazy:

  1. We need the data_connection_id in order to fetch the temporary credentials for the r2 bucket. I wasn't able to find a graceful way of threading that through from the output_dir to the get_bucket_and_path function without adding a ton of code, so I just setting an env var and reading from that. This feels very hacky so let me know if you have any recommendations.
  2. It seems like we should have get_r2_bucket_credentials call an SDK method instead of making a direct API call. I can do this in a followup PR unless you think it's necessary now.

Fixes # (issue).

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@pwgardipee pwgardipee self-assigned this Sep 4, 2025
Copy link
Collaborator

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Good start. I would be good to add some tests.

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 70.07299% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 84%. Comparing base (0b19ba6) to head (3336fe1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff          @@
##           main   #705    +/-   ##
====================================
  Coverage    84%    84%            
====================================
  Files        52     52            
  Lines      7078   7200   +122     
====================================
+ Hits       5957   6076   +119     
- Misses     1121   1124     +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gitguardian
Copy link

gitguardian bot commented Sep 5, 2025

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@pwgardipee pwgardipee force-pushed the add-lightning_storage-direct-upload branch from d708a18 to b9c7a7c Compare September 8, 2025 13:48
@tchaton tchaton marked this pull request as ready for review September 8, 2025 16:22
@tchaton tchaton requested a review from Borda as a code owner September 8, 2025 16:22
Copy link
Collaborator

@robTheBuildr robTheBuildr left a comment

Choose a reason for hiding this comment

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

Found some testing code that needs to be removed.
Also need to clean up the "magic numbers" scattered in code

And probably base class for the Filesystem would be best

@pwgardipee pwgardipee changed the title [WIP] Add support for direct upload to r2 buckets Add support for direct upload to r2 buckets Sep 8, 2025
Copy link
Collaborator

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Looks great ! Could you add some benchmarks in a follow up.

@pwgardipee pwgardipee merged commit e3a62c9 into main Sep 9, 2025
35 checks passed
@pwgardipee pwgardipee deleted the add-lightning_storage-direct-upload branch September 9, 2025 12:23
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.

5 participants