get_base_python_image_uri() returns URIs for unsupported Python versions
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 74/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- aws, python
研究方向
在 SageMaker Python SDK V3 程式碼中找到 get_base_python_image_uri(),並閱讀其 docstring,其中說明支援的值是 310 和 38。查看附近的測試,了解 Python 版本和映像 URI 的處理方式。完成標準是明確拒絕 311 等不支援的版本,同時 310 和 38 仍能產生預期的 URI。
由索引模型根據 Issue 內容生成。
描述
PySDK Version
- PySDK V2 (2.x)
- PySDK V3 (3.x)
Describe the bug
The get_base_python_image_uri() function returns image URIs for Python versions that don't have corresponding base images in ECR. When these URIs are used in SageMaker jobs, they fail with image not found errors.
To reproduce
from sagemaker.core.image_uris import get_base_python_image_uri
# Request Python 3.11 base image - THIS FAILS
uri_311 = get_base_python_image_uri(region="us-east-1", py_version="311")
print(f"Python 3.11 URI: {uri_311}")
# Attempt to use this URI in a SageMaker job will fail
# Request Python 3.10 base image - THIS WORKS
uri_310 = get_base_python_image_uri(region="us-east-1", py_version="310")
print(f"Python 3.10 URI: {uri_310}")
# Works fine with SageMaker jobs
Only Python 3.8 and 3.10 have corresponding base images in ECR. Attempting to use Python 3.11, 3.13, or any other unsupported version results in a failure when the SageMaker job tries to pull the image.
Expected behavior
The function should either:
- Only accept Python versions for which base images actually exist in ECR (currently 3.8 and 3.10)
- Raise a clear
ValueErrorlisting the supported Python versions - Update the docstring to document which Python versions are supported
Screenshots or logs
Error occurs only when using unsupported Python versions (e.g., 3.11):
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the CreateTrainingJob operation: Cannot find the requested image: 012345678901.dkr.ecr.us-west-2.amazonaws.com/sagemaker-base-python-311:1.0 with tag: 1.0 and digest: null. Please check if your ECR image exists and role arn:aws:iam::123456789012:role/SM-Training-ABCDEFGHIJ has proper pull permissions for SageMaker: ecr:BatchCheckLayerAvailability, ecr:BatchGetImage, ecr:GetDownloadUrlForLayer
The issue is that the base image sagemaker-base-python-311 does not exist in ECR. Using Python 3.10 works without this error.
System information
- SageMaker Python SDK version: 3.x
- Framework name: N/A (base Python image issue)
- Framework version: N/A
- Python version: 3.11, 3.13 (attempted), 3.10 working
- CPU or GPU: N/A
- Custom Docker image: N/A
Additional context
The function's docstring states "Can be 310 or 38", but the function accepts any string value for py_version without validation. This creates a discrepancy between documented and actual supported versions, and affects automated image discovery.
- 主要語言
- Python
- 星號
- 2.3k
- 分支
- 1.3k
- 平均合併
- 2 天 2 小時
- 30 天內合併 PR
- 71
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws/sagemaker-python-sdk 的其他 Issue
-
[Bug] ModelTrainer with no input channels emits InputDataConfig: [], which CreatePipeline rejects (min=1) — v2 omitted the key可能已有人在做 @sagemaker-bot 於 32 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
aws/sagemaker-python-sdk#6156 · 2 則留言 ·
維護者通常 1 天內回覆
-
sagemaker-train should depend on mlflow-skinny, following sagemaker-mlflow 0.5.0可能已有人在做 @mohamedzeidan2021 於 32 天前認領。 未關閉
難度 2/5 半天 新手友好度 72/100
aws/sagemaker-python-sdk#6152 ·
維護者通常 1 天內回覆
-
`ModelTrainer` bug with method to load hyperparameters from file for Amazon Nova Recipe可能已有人在做 @sagemaker-bot 於 32 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
aws/sagemaker-python-sdk#5770 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
aws/sagemaker-python-sdk#5588 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 68/100
aws/sagemaker-python-sdk#6542 · 1 則留言 ·
維護者通常 1 天內回覆
查看 aws/sagemaker-python-sdk 的全部 Issue
相似的 Issue
-
ReadQwen3PaperTask5 rejects correct answers that differ only in order, case, or underscore form可能已有人在做 @Kingpython123 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 90/100
Tongyi-MAI/MobileWorld#72 ·
-
_threads/application: Update typing annotations using `pyupgrade --py311-plus`可能已有人在做 @gudnimg 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
Health probes return 401 when authentication is enabled and the API is served under /orb可能已有人在做 @fgogolli 今天認領。 未關閉area: api priority: p2 size: S type: bug
難度 2/5 半天 新手友好度 75/100
finos/open-resource-broker#704 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 74/100
BCDA-APS/polar-bits#93 ·
-
bug
難度 1/5 1 小時以內 新手友好度 90/100
GoogleCloudPlatform/gce-rescue#218 ·
維護者通常 2 天內回覆