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

S3 protocol #895

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

S3 protocol #895

wants to merge 8 commits into from

Conversation

LuisSanchez25
Copy link
Collaborator

@LuisSanchez25 LuisSanchez25 commented Oct 2, 2024

What is the problem / what does the code in this PR do

Adds S3 functionality to strax

Can you briefly describe how it works?

We can now use an S3 storage system to store data

Can you give a minimal working example (or illustrate with a figure)?

import strax
st = strax.Context()
s3_storage = strax.S3Frontent()
st.storage = [s3_storage]

Please include the following if applicable:

  • Update the docstring(s)
  • Update the documentation
  • Tests to check the (new) code is working as desired.
  • Does it solve one of the open issues on github?

Please make sure that all automated tests have passed before asking for a review (you can save the PR as a draft otherwise).

@dachengx
Copy link
Collaborator

dachengx commented Oct 2, 2024

Thanks, @LuisSanchez25. Would it be more appropriate to put these new StorageFrontend and StorageBackend to straxen like RucioRemoteFrontend https://github.com/XENONnT/straxen/blob/a412b4382eed3277fd599c105d69855df38bc7f8/straxen/storage/rucio_remote.py#L29?

@dachengx
Copy link
Collaborator

dachengx commented Oct 2, 2024

And I generally think this is a super good idea! We should benefit from the market resources!

@LuisSanchez25
Copy link
Collaborator Author

Hey @dachengx I am a bit unfamiliar with why the decision was made to put the Rucio frontend in straxen rather than in strax, that feels like a tool that would be beneficial for others outside of XENON right? So to me it might make more sense to move the Rucio storage to straxen but maybe I am just missing something.

Thanks! I am still in the process of fully testing this, I think it still needs some tweaks but I should have a working prototype soon!

@dachengx
Copy link
Collaborator

dachengx commented Oct 2, 2024

@LuisSanchez25 I think by design, strax is for the prototypes of all classes, like plugins and storage. straxen will inherit the classes and make the functions more specific. I think this is why they put the RucioRemoteFrontend to straxen.

Copy link
Collaborator

@dachengx dachengx left a comment

Choose a reason for hiding this comment

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

Thanks @LuisSanchez25 . I did not look into s3.py deeply because I see there are commented-out codes so maybe it is not finished?

I still would insist on moving the S3 functionality to straxen. strax should be just basic usage and processor etc.

You should not change save_file but do what should be done only in _save_chunk function.

result = _save_file(write_file, data, compressor)
os.rename(temp_fn, final_fn)
return result
if is_s3_path is False:
Copy link
Collaborator

Choose a reason for hiding this comment

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

if is_s3_path is False: -> if not is_s3_path:

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