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
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 81
环境准备
- 没有 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 于 30 天前认领。 未关闭
难度 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 于 31 天前认领。 未关闭
难度 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 于 30 天前认领。 未关闭
难度 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
-
bug
难度 1/5 1 小时以内 新手友好度 86/100
awslabs/visual-asset-management-system#937 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
follow-up
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 2 天内回复