-
Notifications
You must be signed in to change notification settings - Fork 83
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
backend: add Google Cloud storage support #73
Conversation
@a-hilaly This looks great so far. Thanks a lot for the contribution, this is one of the most wanted backends because GCP is very popular nowadays. I'm sure you've noticed our contribution guidelines, we're also trying to improve those, PTAL #71. It'd be great if you could complete the PR checklist and rebase your branch. And ping me whenever you need a review. |
@kakkoyun Done ! For the |
@a-hilaly Thanks a lot. I'll have a look at it this weekend. |
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.
So far so good, I have highlighted a couple of points. If you could fix those, that'd be great.
A major blocker is the lack of tests, We should add tests, if it's possible proper integration tests, you can check examples in plugin_test.go
.
@kakkoyun Thanks for the review, i made the changes as requested. I still have the e2e tests to write. Will need to understand how they are working in order to add the correct tests. |
Hey @a-hilaly, since you worked on GCP and aware of the AWS integration, I would like to have your opinion on https://github.com/google/go-cloud. This project is an abstraction over AWS, GCP and Azure. Maybe we can use this for object store integrations and provide integrations for other vendors like Azure as well. I'm not suggesting anything, just food for thought. |
I think that's a very good idea ! it will be a tree birds one stone deal 😄 i also like the fact that it uses only the standard sdk for each cloud nothing more https://github.com/google/go-cloud/blob/master/go.mod |
Thanks for the comment. Good point I'll check it. |
@a-hilaly Would you be able to push this through? Let me know if you need any help. |
@kakkoyun Yes i'm working on this PR now. Need to rebase and add the plugin tests. Not sure how to use APIKey based access with minio (S3 uses SecretKey and AccessKey) |
@a-hilaly Cool thanks! I'm not sure if minio could be used to test google cloud storage locally, we need to check. If not there must be a someway to emulate google cloud storage, we should just find it. |
i made some research around GCS testing technics and i have found these two interesting projects:
I personally like the fake gcs server it could be very useful to write e2e tests. What do you think @kakkoyun ? |
@a-hilaly I'm %100 with you on this one, just go with e2e tests. We only have e2e tests right now anyway. |
@kakkoyun i tried to add the end to end tests, bucket creation and object creation works as expected but reading object fails with a weird error: ~/source/drone-cache(gcs-support*) » go test -v -timeout 30s github.com/meltwater/drone-cache/cache/backend -run ^TestCloudStorageTruth
=== RUN TestCloudStorageTruth
--- FAIL: TestCloudStorageTruth (0.71s)
cloud_storage_test.go:66: googleapi: got HTTP response code 403 with body: <?xml version='1.0' encoding='UTF-8'?><Error><Code>UserProjectAccountProblem</Code><Message>User project billing account not in good standing.</Message><Details>The billing account for project 47866975936 is disabled in state absent</Details></Error>
FAIL
FAIL github.com/meltwater/drone-cache/cache/backend 0.860s
FAIL i'll try to investigate more this error with different |
0cb82cc
to
1228fcb
Compare
Hey @a-hilaly, I will try to give this one a push this weekend or in the next week. What's left? Do you need help with something specific? |
Hey @kakkoyun, i couldn't have all the end2end test fixed. Specifically this part https://github.com/A-Hilaly/drone-cache/blob/gcs-support/cache/backend/cloud_storage_test.go#L69-L73 . I'm not sure why this happens, i'm suspecting the fake-gcs-server. |
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Fixes #61
Proposed Changes
cloud.google.com/go/storage
dependencyDescription
Checklist