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
Custom S3 path support #2671
base: main
Are you sure you want to change the base?
Custom S3 path support #2671
Conversation
I am not sure how I feel about |
The env var name can be different. |
I should have explained what I was thinking better. I was thinking that the code could build the regex from the list of domain postfixes. For example: RIO_AWS_S3_DOMAINS=s3.acme.org,s3.foo.com Internal regex (likely needs to be fixed):
|
Probably a good idea to document this. How about here https://github.com/rasterio/rasterio/blob/main/docs/topics/vsi.rst? |
documentation added |
Hi 👋 TBH I'm not quite sure what this is solving. Is this new variable needed to make sure we recognize S3 object when not using 'S3://' prefix? If yes I would argue that if an S3 session is needed then the URL should be S3:// prefixed 🤷♂️ Rasterio tries to follow GDAL direction and I would tend to think that if this new REGEX variable is not in GDAL env first we shouldn't add it here (we could maybe propose this in GDAL 🤷♂️) |
Hello @vincentsarago I understand the will to keep rasterio aligned with GDAL. Digging for more information for this discussion, I figured out that in any case passing an virtual host s3 URLs allows to derive the S3 endpoint url and region, thus supporting multiple S3 endpoints in a single service is easier (e.g. in titiler, I'd like to be able to support accessing different S3 endpoints with the same instance) GDAL has it's own way of specifying path through All that said, i will probably close this PR since it won't work with GDAL anyway. |
@emmanuelmathot, thoughts about updating this PR to support |
@emmanuelmathot @snowman2 @vincentsarago I'm super late to the party, and I apologize. I appreciate the thought that's been put into this. GDAL has a vast configuration space which is hard to comprehend. I'm hesitant to add more, especially when it's very specific to AWS-like services not hosted by Amazon. I think FOSS4G projects might have made a mistake in giving special treatment to I think there is potential for the new Python file opener VSI plugin #2898 to help here. |
Proposed Changes:
This PR add support for creating S3 sessions for custom urls passing an environment variable
AWS_PATH_REGEX
.All matching path would the be handled as S3 input
PR Checklist: