how to add/update autoscaling policy for an async endpoint in sagemaker?

0

I have an async sagemaker endpoint, with an auto scaling policy (sample code below) . Everytime I update the model.tar.gz file , i delete the old endpoint and create a new one, with the same name and same setting. do i have to delete and re-create the autoscaling as well?

client = boto3.client("application-autoscaling") 
response = client.register_scalable_target(
    ServiceNamespace="sagemaker",
    ResourceId=resource_id,
    ScalableDimension="sagemaker:variant:DesiredInstanceCount",
    MinCapacity=0,
    MaxCapacity=5,
)
response = client.put_scaling_policy(
    PolicyName="Invocations-ScalingPolicy",
    ServiceNamespace="sagemaker", 
    ResourceId=  "endpoint/myendpoint/variant/test"
    ...
質問済み 2年前249ビュー
1回答
0

Hi,

According to our doc, if the role used includes permissions to deregister the model, Application Auto Scaling deregisters those models as scalable targets without notifying you. If the permission is not strong enough, the process fails and you must delete automatic scaling policies and deregister scalable targets before deleting the endpoint.

In other words, once you see an endpoint deleted, the corresponding auto scaling policy should have been deleted and targets de-registered. Even if you create a new endpoint with the same, you still need to register the target and attach policies.

AWS
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ