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
질문됨 2년 전825회 조회
1개 답변
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
지원 엔지니어
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠