`QualityCheckStep` misplaces the output KMS key and omits tags
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 72/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
Comece em QualityCheckStep, no método arguments de sagemaker.mlops.workflow.quality_check_step, onde o dicionário de requisição do job de processamento é montado. Mova KmsKeyId do dicionário de saída do S3 para ProcessingOutputConfig e adicione Tags de check_job_config à requisição. Execute o script de reprodução da issue com print(step.arguments); está concluído quando KmsKeyId estiver em ProcessingOutputConfig e Tags aparecer na saída.
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
QualityCheckStep.arguments builds a processing-job request manually.
The method puts KmsKeyId inside ProcessingS3Output. The SageMaker API
requires this field on ProcessingOutputConfig.
The method also omits the tags from CheckJobConfig.
The generated request has this incorrect structure:
{
"ProcessingOutputConfig": {
"Outputs": [
{
"S3Output": {
"KmsKeyId": "arn:aws:kms:..."
}
}
]
}
}
This behavior is present in SageMaker Python SDK v3.25.0.
To reproduce
Set these environment variables:
export AWS_REGION="us-east-2"
export SAGEMAKER_ROLE_ARN="arn:aws:iam::<account-id>:role/<sagemaker-execution-role>"
export KMS_KEY_ARN="arn:aws:kms:us-east-2:<account-id>:key/<key-id>"
Run this script:
import os
import boto3
from sagemaker.core.workflow.pipeline_context import PipelineSession
from sagemaker.mlops.workflow.check_job_config import CheckJobConfig
from sagemaker.mlops.workflow.quality_check_step import (
DataQualityCheckConfig,
QualityCheckStep,
)
session = PipelineSession(
boto_session=boto3.Session(region_name=os.environ["AWS_REGION"])
)
job_config = CheckJobConfig(
role=os.environ["SAGEMAKER_ROLE_ARN"],
instance_type="ml.m5.xlarge",
instance_count=1,
output_kms_key=os.environ["KMS_KEY_ARN"],
tags=[{"Key": "test", "Value": "quality-check"}],
sagemaker_session=session,
)
quality_config = DataQualityCheckConfig(
baseline_dataset="s3://example-bucket/baseline.csv",
dataset_format={"csv": {"header": True}},
output_s3_uri="s3://example-bucket/baseline-output/",
)
step = QualityCheckStep(
name="quality-check-reproduction",
quality_check_config=quality_config,
check_job_config=job_config,
register_new_baseline=True,
skip_check=True,
)
print(step.arguments)
The output contains ProcessingOutputConfig.Outputs[0].S3Output.KmsKeyId.
The output does not contain Tags.
Expected behavior
The request must put the KMS key on ProcessingOutputConfig:
{
"ProcessingOutputConfig": {
"KmsKeyId": "arn:aws:kms:...",
"Outputs": []
},
"Tags": [
{"Key": "test", "Value": "quality-check"}
]
}
Screenshots or logs
The v3.25 implementation contains:
if self.check_job_config.output_kms_key:
s3_output_dict["KmsKeyId"] = self.check_job_config.output_kms_key
The request builder does not read self.check_job_config.tags.
System information
- SageMaker Python SDK version: 3.25.0
- Framework name (eg. PyTorch) or algorithm (eg. KMeans): SageMaker Model Monitor
- Framework version: Not applicable
- Python version: 3.12
- CPU or GPU: CPU
- Custom Docker image (Y/N): No
Additional context
A temporary QualityCheckStep subclass can correct the request. The workaround
moves KmsKeyId to ProcessingOutputConfig and adds the configured tags.
A possible fix is:
processing_output_config = {"Outputs": processing_outputs}
if self.check_job_config.output_kms_key:
processing_output_config["KmsKeyId"] = self.check_job_config.output_kms_key
request_dict["ProcessingOutputConfig"] = processing_output_config
if self.check_job_config.tags:
request_dict["Tags"] = self.check_job_config.tags
- Linguagem predominante
- Python
- Estrelas
- 2.3k
- Forks
- 1.3k
- Merge médio
- 2d 16h
- PRs com merge (30d)
- 88
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
-
`HyperparameterTuner` drops `ModelTrainer` checkpoint and retry configurationTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
aws/sagemaker-python-sdk#6500 ·
Mantenedores costumam responder em até 2 dias
-
[Bug] ModelTrainer with no input channels emits InputDataConfig: [], which CreatePipeline rejects (min=1) — v2 omitted the keyTalvez já em andamento @sagemaker-bot assumiu há 21 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é 2 dias
-
sagemaker-train should depend on mlflow-skinny, following sagemaker-mlflow 0.5.0Talvez já em andamento @mohamedzeidan2021 assumiu há 22 dias. Aberta
Dificuldade 2/5 Meio dia Facilidade para iniciantes 72/100
aws/sagemaker-python-sdk#6152 ·
Mantenedores costumam responder em até 2 dias
-
[Bug] ModelTrainer drops TrainingJobName for PipelineSession, breaking use_custom_job_prefix on TrainingStepTalvez já em andamento @mohamedzeidan2021 assumiu há 26 dias. Abertacomponent: pipelines type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
aws/sagemaker-python-sdk#5776 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 2 dias
-
`ModelTrainer` bug with method to load hyperparameters from file for Amazon Nova RecipeTalvez já em andamento @sagemaker-bot assumiu há 21 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
aws/sagemaker-python-sdk#5770 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de aws/sagemaker-python-sdk
Issues semelhantes
-
[Bug]: `hermes plugins update` clones an entire monorepo twice - `subdir` is resolved but dropped at both catalog-update call sitesTalvez já em andamento @HootRock assumiu hoje. Abertacomp/cli P2 type/perf
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NousResearch/hermes-agent#142417 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug enhancement python
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#392 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
bug p2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
amd/gaia#5471 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Restore postgresql_vm_test_charm actions.yaml change (removed in canonical/postgresql-operator#2054)Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
canonical/postgresql-single-kernel-library#390 · 1 comentário ·
Mantenedores costumam responder em até 2 dias