Skip to content
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

s3-like compatibility #112

Closed
zifeo opened this issue Jan 3, 2024 · 14 comments
Closed

s3-like compatibility #112

zifeo opened this issue Jan 3, 2024 · 14 comments

Comments

@zifeo
Copy link

zifeo commented Jan 3, 2024

while gocloud seems to support s3ForcePathStyle=true, it does not seem possible to use it with pmtiles:

2024/01/04 00:45:10 main.go:128: Failed to create new server, open bucket s3://REDACTED?awssdk=v2&endpoint=REDACTED&region=us-east-1&s3ForcePathStyle=true: unknown query parameter "s3ForcePathStyle"
@bdon
Copy link
Member

bdon commented Jan 4, 2024

If you are inputting the URLs can you use virtual host-style URLs instead? AWS has been trying to deprecate path style URLs for a while https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access so it seem like they should be 1:1 equivalent.

@zifeo
Copy link
Author

zifeo commented Jan 4, 2024

@bdon Thanks for getting back, unfortunately our storage provider does not offer virtual ones, only path style are supported.

@bdon
Copy link
Member

bdon commented Jan 4, 2024

Which storage provider or storage engine is this so others can reproduce?

@zifeo
Copy link
Author

zifeo commented Jan 4, 2024

@bdon Openstack Swift, but I suppose you can also use minio to replicate.

bdon added a commit that referenced this issue Jan 5, 2024
* this is to allow sdk v1 query params like s3ForcePathStyle, to work with Minio, etc.
@bdon
Copy link
Member

bdon commented Jan 5, 2024

PR here: #113

Currently we force the use of awssdkv2, but v1 is necessary to support those flags and work with Minio. Defaulting to v1 shouldn't have any functional impact. The alternative is to add more storage implementation-specific logic to go-pmtiles but that would defeat the purpose of using the gocloud abstraction.

Aligns with suggested way of using Minio in gocloud docs: https://gocloud.dev/howto/blob/#s3-compatible

bdon added a commit that referenced this issue Jan 5, 2024
Don't force aws sdk v2 for s3 buckets [#112]

* this is to allow sdk v1 query params like s3ForcePathStyle, to work with Minio and other storage systems: see https://gocloud.dev/howto/blob/#s3-compatible
@bdon
Copy link
Member

bdon commented Jan 5, 2024

I've merged it into main, please see if it fixes the issue and I'll make a minor release.

@zifeo
Copy link
Author

zifeo commented Jan 9, 2024

@bdon confirmed, thanks a lot!

@zifeo zifeo closed this as completed Jan 9, 2024
@bdon
Copy link
Member

bdon commented Jan 11, 2024

@bdon
Copy link
Member

bdon commented Sep 6, 2024

FYI, AWS is putting aws-sdk-go v1 into maintenance mode; v2 will be the default going forward: https://github.com/google/go-cloud/releases/tag/v0.39.0

For the next minor version I am bumping the gocloud version

@zifeo
Copy link
Author

zifeo commented Sep 6, 2024

@bdon Thanks for letting me know, what is the expect change? It seems unclear to me

@bdon
Copy link
Member

bdon commented Sep 6, 2024

Based on those release notes Gocloud will be removing aws-sdk-v1 in early 2025.

The AWS SDK V2 definitely supports forcing path-style S3 buckets, not quite sure how it's exposed through gocloud S3 connection strings.

@zifeo
Copy link
Author

zifeo commented Sep 6, 2024

@bdon
Copy link
Member

bdon commented Sep 16, 2024

1.22 defaults to awsv2: https://github.com/protomaps/go-pmtiles/releases/tag/v1.22.0

@zifeo
Copy link
Author

zifeo commented Sep 16, 2024

@bdon upgraded and it worked out of the box :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants