feat: add endpoint_url support to s3_sync for MinIO compatibility#589
Open
koriyoshi2041 wants to merge 1 commit intoOpenPipe:mainfrom
Open
feat: add endpoint_url support to s3_sync for MinIO compatibility#589koriyoshi2041 wants to merge 1 commit intoOpenPipe:mainfrom
koriyoshi2041 wants to merge 1 commit intoOpenPipe:mainfrom
Conversation
…enPipe#435) Add an optional endpoint_url parameter to s3_sync and ensure_bucket_exists. When not provided, falls back to the AWS_ENDPOINT_URL environment variable. This enables S3-compatible services like MinIO without requiring callers to manage the env var themselves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #435.
Add an optional
endpoint_urlparameter tos3_sync()andensure_bucket_exists()inart.utils.s3. When not provided, both functions fall back to theAWS_ENDPOINT_URLenvironment variable. This enables S3-compatible services like MinIO without requiring callers to manage the env var themselves.Changes
s3_sync(): newendpoint_urlkeyword argument, passed as--endpoint-urlto the AWS CLIensure_bucket_exists(): same parameter, applied to both thehead-bucketcheck andcreate-bucketcommandsos.environ.get("AWS_ENDPOINT_URL")when the parameter isNonedeleteparameter ins3_sync()Usage
Fully backward-compatible — the parameter defaults to
Noneand all existing callers are unaffected.Test plan
s3_sync()includes--endpoint-urlwhen parameter is sets3_sync()includes--endpoint-urlwhenAWS_ENDPOINT_URLenv var is sets3_sync()omits--endpoint-urlwhen neither is setensure_bucket_exists()passes endpoint to all three CLI commandsuv run prek run --all-filespasses