Repository navigation
[Store] Structure S3ClientConfig environment settings #4098
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
Merged
Aionw
merged 2 commits into
kvcache-ai:main
from
bitborne:codex/s3-client-environ-convergence
Sep 17, 2026
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #include "s3_client_config.h" | ||
|
|
||
| #include "environ.h" | ||
| #include "environment_variables.h" | ||
|
|
||
| namespace mooncake { | ||
|
|
||
| S3ClientConfig S3ClientConfig::FromEnvironment() { | ||
| S3ClientConfig config; | ||
| config.region = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_REGION, config.region); | ||
| config.s3_endpoint = | ||
| Environ::ReadOr(S3ClientEnvironmentVariables::MOONCAKE_AWS_S3_ENDPOINT, | ||
| config.s3_endpoint); | ||
| config.bucket_name = | ||
| Environ::ReadOr(S3ClientEnvironmentVariables::MOONCAKE_AWS_BUCKET_NAME, | ||
| config.bucket_name); | ||
| config.access_key_id = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_ACCESS_KEY_ID, | ||
| config.access_key_id); | ||
| config.secret_access_key = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_SECRET_ACCESS_KEY, | ||
| config.secret_access_key); | ||
| config.use_virtual_addressing = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_USE_VIRTUAL_ADDRESSING, | ||
| config.use_virtual_addressing); | ||
| config.use_https = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_USE_HTTPS, config.use_https); | ||
| config.request_checksum_calculation = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_REQUEST_CHECKSUM_CALCULATION, | ||
| config.request_checksum_calculation); | ||
| config.response_checksum_validation = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_RESPONSE_CHECKSUM_VALIDATION, | ||
| config.response_checksum_validation); | ||
| config.connect_timeout_ms = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_CONNECT_TIMEOUT_MS, | ||
| config.connect_timeout_ms); | ||
| config.request_timeout_ms = Environ::ReadOr( | ||
| S3ClientEnvironmentVariables::MOONCAKE_AWS_REQUEST_TIMEOUT_MS, | ||
| config.request_timeout_ms); | ||
| return config; | ||
| } | ||
|
|
||
| } // namespace mooncake |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #pragma once | ||
|
|
||
| #include <cstdint> | ||
| #include <string> | ||
|
|
||
| namespace mooncake { | ||
|
|
||
| struct S3ClientConfig { | ||
| std::string region; | ||
| std::string s3_endpoint; | ||
| std::string bucket_name; | ||
| std::string access_key_id; | ||
| std::string secret_access_key; | ||
| bool use_virtual_addressing = true; | ||
| bool use_https = true; | ||
| std::string request_checksum_calculation; | ||
| std::string response_checksum_validation; | ||
| int64_t connect_timeout_ms = 10000; | ||
| int64_t request_timeout_ms = 30000; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
|
|
||
| static S3ClientConfig FromEnvironment(); | ||
| }; | ||
|
|
||
| } // namespace mooncake | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use std::chrono::milliseconds instead of int64_t here?