winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.91k stars 194 forks source link

Update `cloud.Bucket` sim implementation to use `sim.Container` with MinIO #6300

Open Chriscbr opened 4 months ago

Chriscbr commented 4 months ago

Use Case

cloud.Bucket is an abstract object storage API which is designed to be cloud agnostic (the API's design prioritizes supporting APIs that are available in multiple cloud provider services, like AWS S3, Google Cloud Storage, and Azure Blob Storage). Currently the Wing SDK uses a hand-written object storage implementation found here: https://github.com/winglang/wing/blob/main/libs/wingsdk/src/target-sim/bucket.inflight.ts.

As an alternative, we could implement the API by running a docker container running an existing object storage implementation, like MinIO. The SDK has existing support for this via sim.Container.

Pros:

Cons:

Proposed Solution

No response

Implementation Notes

Related: https://github.com/winglang/wing/issues/6282

List of S3 APIs supported by MinIO: https://min.io/docs/minio/linux/reference/s3-api-compatibility.html

Component

SDK

Community Notes

garysassano commented 4 months ago

Do we actually need to change the cloud.Bucket implementation?

For how I see it, MinIO is simply the s3 winglib compiled for sim platform.

github-actions[bot] commented 1 month ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

Chriscbr commented 1 month ago

Do we actually need to change the cloud.Bucket implementation?

For how I see it, MinIO is simply the s3 winglib compiled for sim platform.

Sure, yeah I think it would make sense for cloud.Bucket to be implemented in terms of s3.Bucket. I think there's still merit to having cloud.Bucket as its own class since e.g. Azure Blob Storage does not implement the exact contract of S3 AFAIK. This would be relevant if folks want to write apps that can be deployed to either AWS or Azure.