CM42
CM42

Reputation: 83

Unable to Define Auto Scaling for SageMaker Endpoint

I have deployed an AWS endpoint using a Docker container (I followed this).

Everything is working perfectly but now I need to put it in production and define an auto scaling strategy.

I tried 2 things:

  1. AWS console but the auto scaling button is greyed out.

  2. The method described here. My endpoint name is EmbeddingEndpoint and my variant name is SimpleVariant. So my final command is

aws application-autoscaling put-scaling-policy \
--policy-name scalable_policy_for_embedding \
--policy-type TargetTrackingScaling \
--resource-id endpoint/EmbeddingEndpoint/variant/SimpleVariant \
--service-namespace sagemaker \
--scalable-dimension sagemaker:variant:DesiredInstanceCount \
--target-tracking-scaling-policy-configuration file://policy_config.json

but I get this result :

An error occurred (ObjectNotFoundException) when calling the PutScalingPolicy operation: 
No scalable target registered for service namespace: sagemaker, resource ID: 
endpoint/EmbeddingEndpoint/variant/SimpleVariant, scalable dimension: 
sagemaker:variant:DesiredInstanceCount

Does someone have another solution, or is it that I didn't set the variable well ? Thank you in advance !

Upvotes: 1

Views: 1171

Answers (1)

pirateofebay
pirateofebay

Reputation: 1090

Your sagemaker service-namespace does not have any registered scaling targets. You need to first run register-scalable-target before running put-scaling-policy.

aws application-autoscaling register-scalable-target \
    --service-namespace sagemaker \
    --scalable-dimension sagemaker:variant:DesiredInstanceCount \
    --resource-id endpoint/EmbeddingEndpoint/variant/SimpleVariant

Upvotes: 2

Related Questions