Automatically detect and deploy the latest sagemaker model on sagemaker model registry to the endpoint. Value addition: replace/update the existing endpoint (with same name)

1

Hi,

I have a sagemaker pipeline (training pipeline) which creates a new version of the ML model on a periodical basis with retraining and pushes that version to model registry inside a studio. I want a deployment pipeline to automatically pick the latest model version from sagemaker model registry and deploy the model into an endpoint. I would like to know the full details of the deployment pipeline (services and generic script).

If you can also suggest me how to update/replace the existing older endpoint with the new one (or may be replacing the older model within the existing endpoint with the new model version) it would be a great value addition! The only constraint here is that the endpoint name should be same (say 'delivery-model-latest')

1개 답변
0
수락된 답변

Hi,

AWS SageMaker list-models ( see https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/list-models.html for CLI version - See https://boto3.amazonaws.com/v1/documentation/api/1.26.98/reference/services/sagemaker/client/list_models.html for Python) will allow you to list all models.

There is a sort-by parameter with which you can sort by creationTime.

Re. update, you can add you new model and remove the oldest one by following https://docs.aws.amazon.com/sagemaker/latest/dg/add-models-to-endpoint.html

If you need to be more sophisticated (blue/green deployment, etc.), please follow https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateEndpoint.html

Finally, best practices for model deployment: https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-best-practices.html

Best,

Didier

profile pictureAWS
전문가
답변함 4달 전
  • How to 'automatically' implement this? In other words, how would the deployment pipeline know that a recent model has appeared in model registry?

    Re. update, how to replace the first version with the second (I don't want two models at a time in the endpoint)?

  • Hi, you pipeline (after it created a new model) has to list the models active behind the endpoint. Then, using the creation time of such models, the pipeline removes the oldest model and replaces it with the newly created one.

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

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

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

관련 콘텐츠