[feat] Set Aim user-agent on the S3 artifacts storage client - #3416
Draft
goanpeca wants to merge 2 commits into
Draft
[feat] Set Aim user-agent on the S3 artifacts storage client#3416goanpeca wants to merge 2 commits into
goanpeca wants to merge 2 commits into
Conversation
Signed-off-by: Gonzalo Peña-Castellanos <goanpeca@gmail.com>
Signed-off-by: Gonzalo Peña-Castellanos <goanpeca@gmail.com>
|
|
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.
S3ArtifactStorage._get_s3_client()creates its boto3 client without any botocore config, so artifact traffic coming from Aim is indistinguishable from any other boto3 request on the storage side. This appends anaim/<version>token to the client'suser_agent_extra, which makes Aim requests identifiable in server-side access logs. Nothing about request semantics changes.The
S3ArtifactStorage_factorypath keeps its current behavior: a caller-suppliedendpoint_urlis still forwarded straight to boto3, aconfigpassed as a dict is still turned intobotocore.config.Config, and an existinguser_agent_extrais preserved with the Aim token appended instead of overwritten. The kwargs dict is now copied before being modified, so repeated client creation no longer mutates the factory closure.The second commit adds one line to
docs/source/using/artifacts.mdnoting that, becauseendpoint_urlis forwarded to boto3, the same backend works against any S3-compatible object store (Amazon S3, Backblaze B2, Cloudflare R2, MinIO). The example uses a placeholder endpoint.There are no existing unit tests around the artifacts storage clients, so none are added here. Happy to add one asserting the resulting
user_agent_extraif you would like coverage, and happy to open an issue first if you prefer to discuss the approach before review.