aws / aws/sagemaker-python-sdk

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

Fermée
#5,550 1 commentaire 7 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
2.3k
Forks
1.3k
Merge moyen
1 j 22 h
PR mergées (30 j)
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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, python
Domaine
cloud, machine-learning
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
Calme
Clarté
Clairement spécifiée
Accessibilité débutants
58/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.