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

Allow for externally-supplied storage_options to S3 loader and further down to Reductionist #182

Merged
merged 30 commits into from
Feb 14, 2024

Conversation

valeriupredoi
Copy link
Collaborator

@valeriupredoi valeriupredoi commented Feb 12, 2024

Description

This is a locally-constructed, and off the back of #180 version of #178 - merely translating @davidhassell 's work here, but with a twist 😁

What we did here:

  • Active now ingests two new kwargs storage_options=None (type: dict) and active_storage_url=None (type: str) by means of which a user can specify S3 credentials straight into Active (or pass them from a higher level eg cf-python). These can be varied, and tested for - e.g. a collection of items like the credentials needed to get into a standard S3 bucket, or an anon=True bucket. See tests/test_compression.py and tests/test_compression_remote_reductionist.py - there we use storage_options and active_storage_url kwargs to perfectly reproduce connecting to a localhost/Minio data object from a local Reductionist, and also to connect to a valid yet anon=True bucket via a remote Reductionist (this latter stops at Access Denied since Reductionist is not yet able to support anon=True buckets)
  • these storage options have now been integrated in the open mechanisms in Active and netcdf_to_zarr

Closes #177 and the valiant #178

Before you get started

Checklist

  • This pull request has a descriptive title and labels
  • This pull request has a minimal description (most was discussed in the issue, but a two-liner description is still desirable)
  • Unit tests have been added (if codecov test fails)
  • Any changed dependencies have been added or removed correctly (if need be)
  • All tests pass

Copy link
Collaborator

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

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

Hi V - looks fine to me, apart from the whole pre-configured options thing. I'm in the office tomorrow if you want to chat about it.

activestorage/active.py Show resolved Hide resolved
activestorage/active.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (bb769e5) 87.11% compared to head (8812593) 88.11%.

Files Patch % Lines
activestorage/active.py 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
+ Coverage   87.11%   88.11%   +1.00%     
==========================================
  Files           8        8              
  Lines         613      648      +35     
==========================================
+ Hits          534      571      +37     
+ Misses         79       77       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@valeriupredoi
Copy link
Collaborator Author

OK we are in very good shape - this thing does a dance and half, pretty much toasts the bread and spreads the butter too, don't mind the S3 tests failing, those are supposed to fail given Reductionist doesn't support anon=True buckets, but the cf-python integration and all else is there. Needs a bit more unit testing, but let's first talk about it tomorrow 🍺

Copy link
Collaborator

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

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

Hi V, all after our chat :) Those two modified tests put in as suggestions. Good to go when after that.

activestorage/active.py Outdated Show resolved Hide resolved
activestorage/active.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

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

Done

@valeriupredoi
Copy link
Collaborator Author

Done

mega, many thanks @davidhassell 🍻

@valeriupredoi valeriupredoi merged commit 8517401 into main Feb 14, 2024
9 of 10 checks passed
@valeriupredoi valeriupredoi deleted the storage_options_local_branch branch February 14, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request standards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create storage_options and active_storage_url API
2 participants