aws / aws/sagemaker-python-sdk
Missing jumpstart region_config.json file on Sagemaker distribution (SDK v2)
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 1.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 35
Description
**PySDK Version**
- PySDK V2 (2.257.0)
**Describe the bug**
Error being logged when trying to load src/sagemaker/jumpstart/region_config.json not included in the MANIFEST.in file.
**To reproduce**
1. Install Sagemaker SDK version 2.257.0 using Poetry
2. Install ddtrace (e.g. v3.16.2)
3. Deploy and boot a Python service with sagemaker and ddtrace dependency
4. sagemaker/jumpstart/constants.py loads this file at import time and, when it’s missing, logs an ERROR with exc_info=True and continues with an empty set—so the app doesn’t crash but monitoring (e.g. Datadog via ddtrace) reports the error.
**Expected behavior**
The region_config.json included in the distribution binaries, avoiding the jumpstart error logs instead of just ignoring it.
**Screenshots or logs**
`
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/sagemaker/jumpstart/constants.py", line 69, in _load_region_config
with open(filepath) as f:
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ddtrace/appsec/_common_module_patches.py", line 135, in wrapped_open_CFDDB7ABBA9081B6
raise e.with_traceback(
File "/usr/local/lib/python3.11/site-packages/sagemaker/jumpstart/constants.py", line 69, in _load_region_config
with open(filepath) as f:
^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/sagemaker/jumpstart/region_config.json'
`
**System information**
- **SageMaker Python SDK version**: 2.257.0
- **Framework name (eg. PyTorch) or algorithm (eg. KMeans)**: N/A (FastAPI service)
- **Framework version**: (N/A)
- **Python version**: 3.11.9
- **CPU or GPU**: CPU
- **Custom Docker image (Y/N)**: N
**Additional context**
Possible solution we see is to add this line to add so the JumpStart region config is included in the source distribution (sdist):
`include src/sagemaker/jumpstart/region_config.json`
The sagemaker/jumpstart/constants.py loads this file at import time and, when it’s missing, logs an ERROR with exc_info=True and continues with an empty set—so the app doesn’t crash but monitoring (e.g. Datadog via ddtrace) reports the error.
Contributor guide
Assessment
This issue has not been assessed yet.