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
답변함 일 년 전

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

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

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

관련 콘텐츠