-
Notifications
You must be signed in to change notification settings - Fork 218
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
Add support for Azure Blob Storage (FS Object Backend) #2289
Comments
one alternative is we could use Go Cloud Blob SDK which would allow us to work with all the big 3 blob stores. it wraps their specific impls with a common API. I had success with this library in a previous role |
de ja vu! Great shout. |
I just really want you to know about Go Cloud Blob SDK |
This message is sponsored by Go Cloud Blob SDK |
Update(15/12): I just reworked the abstractions in the
storage/fs
package. So this description has been updated to reflect that.We should add support for pushing and pulling flag state via Azure Blob Storage (ABS).
https://azure.microsoft.com/en-gb/products/storage/blobs
Anyone interested in adding support for this is 💯 welcome to contribute!
We would be more than happy to help with advice and of course review.
Currently, we support pushing to AWS S3 via the
object
type storage backend (which is built ontop of the FS backends constructs). We should implement additional support for ABS in the same manner.Implementation Details
fs.FS
implementation over a ABS containerfs.SnapshotStore
implementation over the newabsfs.FS
object
subtypeabs.SnapshotStore
tonewObjectStore
Implement new `fs.FS` implementation
The purpose of this is expose the contents of a particular ABS container via the
fs.FS
interface.This is what the snapshotter expects to consumer when it makes an in-memory snapshot of flag state.
It will traverse this fs.FS like a local directory in search of Flipt flag state.
S3 Bucket reference implementation:
flipt/internal/s3fs/s3fs.go
Lines 21 to 34 in 1326c47
Implement new `fs.SnapshotStore` implementation
The
fs.SnapshotStore
interface is consumed by thefs.Store
to access read-only snapshot views of the underlying state. It is this snapshot stores responsbility to:S3 reference implementation:
flipt/internal/storage/fs/s3/store.go
Lines 20 to 35 in 1d70e15
Define new configuration
In order to configure a client, source and fs we will need connection details, authentication and other ABS configuration; we will need to make space for it in the configuration of Flipt.
This should be done in a consistent style to that of the S3 implementation.
Note: this will also require updates to our CUE and JSON schema for our configuration.
S3 reference implementation:
flipt/internal/config/storage.go
Lines 136 to 143 in 1326c47
Wire up new object store type
Add the new
SnapshotStore
implementation to thenewObjectStore
function to wire it in.S3 reference implementation:
flipt/internal/storage/fs/store/store.go
Lines 142 to 160 in 1d70e15
Add integration tests
We should see if we can setup integration tests in the same way as has been done with Minio and the S3 implementation.
S3 reference implementation:
flipt/build/testing/integration.go
Lines 209 to 239 in 1326c47
Useful Links
The text was updated successfully, but these errors were encountered: