-
Notifications
You must be signed in to change notification settings - Fork 225
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
feat(storage/gcs): add support for Google Cloud Storage #2589
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2589 +/- ##
==========================================
- Coverage 71.78% 71.57% -0.21%
==========================================
Files 87 84 -3
Lines 8271 8085 -186
==========================================
- Hits 5937 5787 -150
+ Misses 1978 1947 -31
+ Partials 356 351 -5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you @erka !! Amazing as always
couple minor naming convention updates requested. I think since gs
isnt as well known/used as like s3, then maybe we should use something more clear like googlecloud
. wdyt? /cc @GeorgeMac
also really love the refactor to use gocloud across the board!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome as ever. One thing from me around slashes in prefixes.
One last take it or leave it: I think you could reduce all the different stores down to just one store implementation with different configuration, as you have with FS (I could be missing something). This could also be a later refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question and one suggested fix
Co-authored-by: Mark Phelps <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! thank you @erka ! I can put up a docs PR and we can try to get this out today or tomorrow in a release
@markphelps It looks like this could take some time to review this PR. Probably it could be included in the next release. |
@GeorgeMac could you please suggest how to modify this PR? Should I drop |
Co-authored-by: George <[email protected]>
@markphelps @GeorgeMac This |
It looks like you're right @erka 🤦 It was never threaded through. Missed that in review. It has been this way since day zero. |
@erka I am looking at how the test is setup here for the bug you're experience and realizing that there is another bug in the old S3 implementation, which means it should never have worked in the first place. The old implementation appears to not be picking up the This is the testdata pushed to s3 (minio): https://github.com/flipt-io/flipt/tree/main/build/testing/integration/readonly/testdata Apologies, you've dug up some skeletons in the closet 😂 Update: see my mad rant below, I was barking up the wrong tree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erka I got the following changes to work as expected for me 👇
What do you think about those. I think they're roughly inline with how things worked previously. Though we will never know as we never actually wired it up properly.
@GeorgeMac thank you for the hint. Probably this is a good time to think how prefix should work. That missing |
@erka yeah I think even my suggestion here might be subtly broken. If you add a case here: flipt/internal/storage/fs/object/s3/store_test.go Lines 96 to 100 in 386fc85
If you change the assertion at the bottom too: // namespace shouldn't exist as it has been filtered out by the prefix
require.NoError(t, store.View(func(s storage.ReadOnlyStore) error {
_, err := s.GetNamespace(context.TODO(), "production")
require.Error(err, "production namespace shouldn't be retrieavable")
_, err := s.GetNamespace(context.TODO(), "prefix")
require.NoError(err, "prefix namespace should be retrieavable")
return nil
})) It fails because the prefix namespace didn't actually get read. I've got some ideas on how we could get this all in line so that Update: the gblob implementation looks promising, but when used with a non slash terminated prefix it goes into an infinite loop on Walk constantly returning the root current dir |
Thanks for being so patient with me on this @erka ! I might need to sleep on it for today, but I have one idea I would like to explore which is to skip making an flipt/internal/storage/fs/snapshot.go Lines 107 to 135 in 386fc85
My thoughts here is that This just takes a list of |
Hey @erka I pushed up a branch over here based on your work: What do you think of this? I was going to make a PR onto your branch, but I can't write into your fork. I will open it up as a draft for now just to get CI testing it. The long and short of the change is it just creates a single store implementation under the |
…re backed by gcblob (#9) Co-authored-by: George MacRorie <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing and I think its good to go. Just need to add this new IT fs/gcs
to the GH workflows list:
flipt/.github/workflows/integration-test.yml
Lines 56 to 60 in 770e807
"fs/git", | |
"fs/local", | |
"fs/s3", | |
"fs/oci", | |
"fs/azblob", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Epic. Thanks so much @erka 🙇♂️
fixes #2288
Reference for docs with auth options https://cloud.google.com/docs/authentication#service-accounts
I would suggest that object config should be changed in more flat variant (no s3/azblob/gc object). Probably there will be one store and some configuration switch/builder of each object
type
.