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"
    ...
asked a year ago231 views
1 Answer
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
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions