aws / aws/sagemaker-python-sdk

Missing jumpstart region_config.json file on Sagemaker distribution (SDK v2)

Chiusa
#5,550 1 commento 7 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
2.3k
Fork
1.3k
Merge medio
1g 22h
PR unite (30g)
35

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with MANIFEST.in and src/sagemaker/jumpstart/region_config.json, then inspect how the package is built and distributed. Build the source distribution and verify that sagemaker/jumpstart/region_config.json is included so importing sagemaker.jumpstart.constants no longer logs the missing-file error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, python
Ambito
cloud, machine-learning
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.