S3Backend: tag boto3 user-agent and honor end_point_url without credentials#1271
Open
goanpeca wants to merge 1 commit into
Open
S3Backend: tag boto3 user-agent and honor end_point_url without credentials#1271goanpeca wants to merge 1 commit into
goanpeca wants to merge 1 commit into
Conversation
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
Three changes to
S3Backendininternvl_chat_gpt_oss/internvl/utils/s3_fileio.py:Add
user_agent_extra="internvl-chat-gpt-oss"to thebotocore.Configso InternVL TCS traffic is identifiable in server-side logs of any S3 provider (AWS, Backblaze B2, Ceph RGW, Cloudflare R2, CoreWeave, MinIO, etc.).Fix
end_point_urlbeing silently dropped in the no-credentials path. The original else-branch builtboto3.client('s3')with no endpoint and no Config, so apetreloss.confcluster withendpoint_urlbut noaccess_key(relying on boto3's default credential chain such as env vars or an IAM role) was silently routed to AWS S3 instead of the configured cluster.Collapse the if/else into a single
boto3.client(...)call. With both branches now passing the sameendpoint_urlandConfig, the only difference was the credential args, which boto3 treats as no-ops whenNone.Also a one-line docstring update listing common S3-compatible providers, and the
bachend→backendtypo fix.Test plan
No test directory exists in the repo, so verified manually for the four call shapes (no / with
end_point_url, no / with credentials). In every case the boto3 client carriesuser_agent_extra="internvl-chat-gpt-oss",read_timeout=5,connect_timeout=2, and the correct endpoint URL.No new runtime dependencies.