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"
    ...
1 Risposta
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
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande