-
Notifications
You must be signed in to change notification settings - Fork 34
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
(CustomSageMakerEndpoint): (node.add_dependency not working) #432
Comments
Hi @airmonitor , thank you for reporting this. Did you have a look at the associated sample we have for this construct ? https://github.com/aws-samples/generative-ai-cdk-constructs-samples/blob/main/samples/sagemaker_custom_endpoint/lib/sagemaker_custom_endpoint-stack.ts |
Hello @krokoko Thx for reaching out. I will try with your suggestion. Do you have also a working example for adding application autoscaling? I need to have scalability added there so the number of endpoint instances will scale base on metric. I've tried with application autoscaling but it was failing due to not working add_dependency method. In short the endpoint creation was still in progress when application autoscaling tried to add required functionality. AWS support added DependsOn section to the synthesised template but I was not able to implement the same using CDK due to missing add dependency method. Regards |
I've tested the proposed solution to use the IAM role that is created with CustomSageMakerEndpoint but apparently, I'm doing something wrong here For the below scenario I'm getting errors from the cloudformation:
Error from CloudFormation
|
Hi @airmonitor , did you provide your role with permissions to access the S3 bucket storing your artifacts ? We have this demonstrated in the sample here: https://github.com/aws-samples/generative-ai-cdk-constructs-samples/blob/main/samples/sagemaker_custom_endpoint/lib/sagemaker_custom_endpoint-stack.ts#L43C5-L57C7 |
Hey @krokoko. I'm not sure if I get your intention here. The example for extending IAM permissions is using non optimal way for granting necessary permissions
In CDK we have a better way, shorter way to achieve the required results using the following examples
grant_pull, grant_read_write method for ecr repository and s3 bucket should do the trick. Regards |
Hi @airmonitor , sorry I just missed the last line of your previous example, I was thinking that permissions were missing on the role to access the model artifacts in S3. |
Hello, Yes, all resources are deployed in us-east-1 |
Describe the bug
The generated CloudFormation stack for the below 2 resources fails to deploy
The stack is rolled back because the iam_role is not ready for custom_sagemaker_endpoint to be used.
Adding explicit dependency via the below code is also not helping
as the generated cloudformation output is missing DependsOn section in the resource manifest for "AWS::SageMaker::EndpointConfig"
Expected Behavior
The stack deployment will not fail due to missing/not ready IAM Role.
Current Behavior
Reproduction Steps
Using the following code
generate output and deploy via cdk deploy
Possible Solution
the method add_dependency will update the DependsOn section in the generated template correctly
Additional Information/Context
No response
CDK CLI Version
2.140.0 (build 46168aa)
Framework Version
No response
Node.js Version
v18.20.2
OS
macOS Sonoma 14.4.1
Language
Python
Language Version
No response
Region experiencing the issue
us-east-1
Code modification
N/A
Other information
No response
Service quota
The text was updated successfully, but these errors were encountered: