fix(user_tools): honor AWS profile S3 endpoints#2106
Draft
WilliamK112 wants to merge 1 commit into
Draft
Conversation
Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.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.
Description
Fixes #2087.
This adds a small S3 endpoint resolver shared by the Python
S3Fshandler and local job argument construction. Existing explicit/environment behavior is preserved, with profile configuration used only when no endpoint environment variable is set.Endpoint precedence is now:
endpoint_overrideargumentAWS_ENDPOINT_URL_S3AWS_ENDPOINT_URLAWS_CONFIG_FILEor~/.aws/configThe profile lookup considers
AWS_PROFILE,AWS_DEFAULT_PROFILE, anddefault, and supports profile-levelendpoint_urlplus nested/service-specific S3 endpoint config. Missing or invalid AWS config files are ignored so existing behavior is unchanged when no profile endpoint is available.Tests
PYTHONPATH=src .venv/bin/python -m pytest -vv tests/spark_rapids_tools_ut/test_csppath.pyPYTHONPATH=src .venv/bin/python -m flake8 src/spark_rapids_tools/storagelib/s3/aws_config.py src/spark_rapids_tools/storagelib/s3/s3fs.py src/spark_rapids_pytools/cloud_api/sp_types.py tests/spark_rapids_tools_ut/test_csppath.pyPYTHONPATH=src .venv/bin/python -m pylint -d fixme --load-plugins pylint_pydantic --rcfile=../.pylintrc src/spark_rapids_tools/storagelib/s3/aws_config.py src/spark_rapids_tools/storagelib/s3/s3fs.py src/spark_rapids_pytools/cloud_api/sp_types.py tests/spark_rapids_tools_ut/test_csppath.pygit diff --check