Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_applicationautoscaling: Enable SageMaker serverless provisioned concurrency utilization predefined metric #29065

Closed
2 tasks
mulhod opened this issue Feb 10, 2024 · 3 comments · Fixed by #29066
Labels
@aws-cdk/aws-applicationautoscaling Related to AWS Application Auto Scaling effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@mulhod
Copy link

mulhod commented Feb 10, 2024

Describe the feature

It appears to be currently impossible to use the provisioned concurrency utilization predefined metric for a SageMaker serverless endpoint. I know how to do this for a Lambda function and have even tried to use aws_cdk.aws_applicationautoscaling.PredefinedMetric.LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION, but I get the following error:

Resource handler returned message: "Scalable dimension sagemaker:variant:Des
iredProvisionedConcurrency only supports the following predefined metric types: SageMakerVariantProvisi
onedConcurrencyUtilization (Service: ApplicationAutoScaling, Status Code: 400, Request ID: eec66ae6-1f8
b-42b6-87b6-7ae4b08aeaf9)"

Use Case

I would like to use autoscaling along with provisioned concurrency for serverless SageMaker endpoints.

Proposed Solution

I think that aws_cdk.aws_applicationautoscaling.PredefinedMetric.SAGEMAKER_VARIANT_PROVISIONED_CONCURRENCY_UTILIZATION enum value here could be added in.

Full code example:

        # Create SageMaker endpoint
        self.endpoint = sagemaker.CfnEndpoint(
            self,
            endpoint_name,
            endpoint_name=endpoint_name,
            endpoint_config_name=self.endpoint_configuration.endpoint_config_name,
        )
        self.endpoint_arn = self.endpoint.ref
        self.endpoint_name = self.endpoint.endpoint_name

        # Enable autoscaling -- TEST
        target = appscaling.ScalableTarget(
            self,
            f"{construct_id}-scalable_target",
            service_namespace=appscaling.ServiceNamespace.SAGEMAKER,
            max_capacity=2,
            min_capacity=1,
            resource_id=f"endpoint/{endpoint_name}/variant/{model_name}",
            scalable_dimension="sagemaker:variant:DesiredProvisionedConcurrency",
        )
        target.scale_to_track_metric(
            "SageMakerVariantProvisionedConcurrencyUtilization",
            target_value=0.8,
            predefined_metric=PredefinedMetric.SAGEMAKER_VARIANT_PROVISIONED_CONCURRENCY_UTILIZATION,
        )
        target.node.add_dependency(self.endpoint)

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.127.0

Environment details (OS name and version, etc.)

Darwin M-AI813838 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64

@mulhod mulhod added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2024
@github-actions github-actions bot added the @aws-cdk/aws-applicationautoscaling Related to AWS Application Auto Scaling label Feb 10, 2024
@pahud
Copy link
Contributor

pahud commented Feb 13, 2024

Thank you. Looks like #29066 is WIP. We would be happy to move this forward by reviewing the PR.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 13, 2024
@mergify mergify bot closed this as completed in #29066 Mar 1, 2024
@mergify mergify bot closed this as completed in 63390e1 Mar 1, 2024
Copy link

github-actions bot commented Mar 1, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

1 similar comment
Copy link

github-actions bot commented Mar 1, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-applicationautoscaling Related to AWS Application Auto Scaling effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants