get_base_python_image_uri() returns URIs for unsupported Python versions
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 74/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- aws, python
- Domínio
- cloud, machine-learning
Direção de pesquisa
Encontre get_base_python_image_uri() no código do SageMaker Python SDK V3 e leia sua docstring, que diz que os valores compatíveis são 310 e 38. Confira os testes próximos para ver como as versões do Python e os URIs de imagem são tratados. O trabalho estará concluído quando versões não compatíveis, como 311, forem rejeitadas claramente, enquanto 310 e 38 continuarem produzindo os URIs esperados.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 2.3k
- Forks
- 1.3k
- Merge médio
- 1d 23h
- PRs com merge (30d)
- 81
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de aws/sagemaker-python-sdk
-
[Bug] ModelTrainer with no input channels emits InputDataConfig: [], which CreatePipeline rejects (min=1) — v2 omitted the keyTalvez já em andamento @sagemaker-bot assumiu há 30 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
aws/sagemaker-python-sdk#6156 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
sagemaker-train should depend on mlflow-skinny, following sagemaker-mlflow 0.5.0Talvez já em andamento @mohamedzeidan2021 assumiu há 31 dias. Aberta
Dificuldade 2/5 Meio dia Facilidade para iniciantes 72/100
aws/sagemaker-python-sdk#6152 ·
Mantenedores costumam responder em até 1 dia
-
`ModelTrainer` bug with method to load hyperparameters from file for Amazon Nova RecipeTalvez já em andamento @sagemaker-bot assumiu há 30 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
aws/sagemaker-python-sdk#5770 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
aws/sagemaker-python-sdk#5588 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
aws/sagemaker-python-sdk#6542 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de aws/sagemaker-python-sdk
Issues semelhantes
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
awslabs/visual-asset-management-system#937 ·
Mantenedores costumam responder em até 1 dia
-
Admin member of a research group cannot see the HX2 allocation until they've been added to itAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
follow-up
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 2 dias