-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
fix: Store the resources in S3 buckets #611
base: main
Are you sure you want to change the base?
Conversation
Thanks so much for opening this pull request and for helping to improve SirixDB 🚀 |
This is a DRAFT pull request. The implementation is not complete yet. However I would really look out for your suggestions/advice on this, if you see that I am implementing in the wrong direction in terms of the use-case/issue |
I'm on my phone right now, but it seems to be fine so far, thanks :-) |
@sband I saw that you're writing to the local file backend as well as to S3. I'd probably simply write to S3 and read from S3. We can combine the storages later on with the combined storage and an async write to the second storage. What do you think? |
Yes. I agree to that. But as far as I know, to write an object in AWS S3, I have to first write it as a file and then put that file object on to S3 storage. Atleast that is what the SDK is supporting (please correct me if that is not the case). So to work around this issue and keeping in mind our discussion in the issue comments, I used the approach of creating the files from the object keyName. These files are created in the system tmp directory - using AmazonS3StorageReader#readObjectDataFromS3 . One thing I forgot was to delete these files from system tmp directory once these were successfully written on to the S3 storage. Do you have any other way where I could directly write to S3 object ? If yes, please let me know - that would be a new learning for me. |
Oh, I didn't look into the S3 API documentation, but you seem to be correct. Thus, the bucket name will be the database name, and the objects stored therein will be the Sirix resources (within the database)!? BTW: I saw that Sebastian used JClouds (usable for different cloud storage) back then. Would an additional IO package make sense? Also, you can store a local version (not temporary), as it requires the files nonetheless... otherwise, we'd probably almost always combine the local and S3 store, and we'd end up storing temp files and the "real" local folders/files. |
|
@JohannesLichtenberger ,
Thanks |
Can you make sure to include the dependency in |
Regarding the combined storage, I think you should make sure to write async, e.g.: https://github.com/sebastiangraf/treetank/blob/master/coremodules/core/src/main/java/org/treetank/io/combined/CombinedWriter.java I'd also suggest to create a real local file for the S3-based reader/writer instead of the temporary file. |
|
…l file system without deleting instead of using tmp parition
bundles/sirix-core/src/main/java/org/sirix/io/combined/CombinedStorageWriter.java
Outdated
Show resolved
Hide resolved
bundles/sirix-core/src/main/java/org/sirix/io/combined/CombinedStorageWriter.java
Outdated
Show resolved
Hide resolved
bundles/sirix-core/src/main/java/org/sirix/io/combined/CombinedStorageWriter.java
Outdated
Show resolved
Hide resolved
bundles/sirix-core/src/main/java/org/sirix/io/combined/CombinedStorageWriter.java
Outdated
Show resolved
Hide resolved
bundles/sirix-core/src/main/java/org/sirix/io/combined/CombinedStorageWriter.java
Outdated
Show resolved
Hide resolved
bundles/sirix-core/src/main/java/org/sirix/io/cloud/amazon/AmazonS3StorageReader.java
Outdated
Show resolved
Hide resolved
bundles/sirix-core/src/main/java/org/sirix/access/ResourceConfiguration.java
Outdated
Show resolved
Hide resolved
Re-opening, got closed due sync with forked master |
@JohannesLichtenberger could you please review, I think I have done all the changes. I looked at the possibility of writing test cases, but except the S3 storage read and write code, everything is same as FileStorageWriter and FileStorageReader, do you still think we need test cases for that ? S3 storage read and write code are pretty much standard API calls. Let me know your opinion on this. |
The tests seem to fail, but I'm in holidays right now and it would be better to check once I'm home on Sunday. I'd prefer to add integration tests, however. Can you also use the SirixDB.xml formatter in the project root and reformat your code? Other than that, thanks a lot for your work :-) |
Besides, the file based approaches are currently broken, I believe. Better use the |
@sband Hope it makes sense so far :-) |
Yes. Couldnt find time last weekend to make the changes. On it. Will make
some updates this week.
Thanks
Sanket
…On Mon, 5 Jun 2023, 19:47 Johannes Lichtenberger, ***@***.***> wrote:
@sband <https://github.com/sband> Hope it makes sense so far :-)
—
Reply to this email directly, view it on GitHub
<#611 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF7QUXOLXRIJ64LPXHKSRTXJXS7NANCNFSM6AAAAAAX7OLDP4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Regarding the integration tests, can you help me on this? As far as I understand, for integration tests we would need a working AWS connection which is not available. |
The second approach with a local s3 looks appealing; https://stackoverflow.com/questions/6615988/how-to-mock-amazon-s3-in-an-integration-test |
BTW: Currently something fails |
Ok not sure why, will have to find out. Locally nothing failed.
…On Thu, 8 Jun 2023, 17:58 Johannes Lichtenberger, ***@***.***> wrote:
BTW: Currently something fails
—
Reply to this email directly, view it on GitHub
<#611 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF7QUXVU3AZGCKJ5TLBNDDXKHANJANCNFSM6AAAAAAX7OLDP4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Can you work on the integration tests? Did you already try it with a real account...? |
Yes. Working on it. First resolved the failing tests issue. Would try to
complete this weekend since I have a free day.
Thanks
Sanket
…On Tue, 13 Jun 2023, 17:15 Johannes Lichtenberger, ***@***.***> wrote:
Can you work on the integration tests? Did you already try it with a real
account...?
—
Reply to this email directly, view it on GitHub
<#611 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF7QUSZEC5RMLVULI6YC73XLBHFTANCNFSM6AAAAAAX7OLDP4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
thank you :-) |
Currently it doesn't compile |
@sband do you have some time this week? |
Hi Johannes
I have been busy with some personal emergency this week so could find time.
I will try to rectify the tests this weekend.
Thanks
Sanket
…On Wed, 21 Jun 2023, 23:29 Johannes Lichtenberger, ***@***.***> wrote:
@sband <https://github.com/sband> do you have some time this week?
—
Reply to this email directly, view it on GitHub
<#611 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF7QUXLVRA5BFCFX53Q2QDXMMY7JANCNFSM6AAAAAAX7OLDP4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Oh, sorry to hear. Hopefully everything turned out well in the end. Take your time |
@sband do you think you'll have some time this week? :-) |
@sband ping, just like to know if you'll keep on working on the PR 👍 |
Hey. I will keep working on this PR. Just that I havent come out of the
personal thing yet. Mostly a weekend more. It was a surgery so have been
away.
…On Thu, 6 Jul 2023, 15:19 Johannes Lichtenberger, ***@***.***> wrote:
@sband <https://github.com/sband> ping, just like to know if you'll keep
on working on the PR 👍
—
Reply to this email directly, view it on GitHub
<#611 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF7QUVQC7XBMN4WSJKA7XLXO2C3DANCNFSM6AAAAAAX7OLDP4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Oh sure, get well soon! :-) hope I can encourage you to keep on working on Sirix in the future ;-) |
Hi @JohannesLichtenberger , |
Hope you've recovered completely :-) thanks for the heads up |
@sband you made any progress!? |
@sband trying to ping |
PR Run Status
PR Analysis
PR Feedback
Code feedbackfile: bundles/sirix-core/build.gradle
file: bundles/sirix-core/src/main/java/org/sirix/access/ResourceConfiguration.java
file: bundles/sirix-core/src/main/java/org/sirix/io/cloud/amazon/AmazonS3Storage.java
file: bundles/sirix-core/src/main/java/org/sirix/io/cloud/amazon/AmazonS3StorageWriter.java
file: libraries.gradle
file: bundles/sirix-core/src/test/java/org/sirix/io/cloud/amazon/AWSS3StorageTest.java
file: bundles/sirix-core/src/main/java/org/sirix/io/combined/CombinedStorage.java
|
PR Run Status
PR Analysis
PR Feedback
Code feedbackfile: bundles/sirix-core/src/main/java/org/sirix/io/cloud/amazon/AmazonS3Storage.java
file: bundles/sirix-core/src/main/java/org/sirix/io/cloud/amazon/AmazonS3StorageWriter.java
file: bundles/sirix-core/src/main/java/org/sirix/io/combined/CombinedStorageWriter.java
file: bundles/sirix-core/src/main/java/org/sirix/io/cloud/ICloudStorage.java
|
Initial draft for fixing issue #582