Sagemaker cross-account deployments

1

I am trying to setup an aws code pipeline project that will deploy a sagemaker model from a model registry cross-account from our qa account.

The plan is to deploy the latest approval model from the registry . I followed steps https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-deploy.html#model-registry-deploy-xaccount but the code below fails when trying to find the latest approved model to deploy. Is their another API endpoint that allows me to look up by ARN instead of using list_model_package_groups?

# try to find the latest approved model package from  model registry from our dev/qa VPC 
groups = self.sm.list_model_package_groups(NameContains=self.model_package, SortOrder='Descending')
most_recent_group = groups['ModelPackageGroupSummaryList'][0]
packages = self.sm.list_model_packages(ModelPackageGroupName=most_recent_group['ModelPackageGroupName'],
                                       SortOrder='Descending', ModelApprovalStatus='Approved')
most_recent_packages = packages['ModelPackageSummaryList']
most_recent_package = most_recent_packages[0]
model_name = '-'.join(most_recent_package['ModelPackageArn'].split('/')[-2:])
model_package_arn = most_recent_package['ModelPackageArn']
container_list = [{'ModelPackageName': model_package_arn}]
self.sm.create_model(
    ModelName=model_name,
    ExecutionRoleArn=self.role,
    Containers=container_list
)
return model_name
preguntada hace 2 años826 visualizaciones
1 Respuesta
0

Hello,

Thank you for using SageMaker Service.

I understand that you are facing error while deploying model which happens to be under different account and want to know how to overcome the error while listing down the lates model registered or identify other API call which could lookup the latest Model register using ARN.

We would like to know the exact error message that has occurred at your end to narrow down the issue and help you overcome this.

To better understanding of the error and your implementation, I'd recommend you to open a case with Premium Support SageMaker team so that you can share complete error message and required logs tp help you overcome this issue.

Open a support case with AWS using the link:

https://console.aws.amazon.com/support/home?#/case/create

AWS
INGENIERO DE SOPORTE
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas