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

feat(sagemaker models): use Generative AI CDK constructs for SageMaker model deployment #343

Merged
merged 6 commits into from
Feb 1, 2024

Conversation

krokoko
Copy link
Contributor

@krokoko krokoko commented Feb 1, 2024

Description of changes:

  • Upgrade CDK to minimum version required by the new dependency
  • Add Generative AI CDK constructs as a dependency
  • Update lib/models/index.ts to consume the constructs

How was this tested ?

Used npm create to enable all models available from the list and run a request for each one of them through the UI, see images below:
Screenshot 2024-01-31 at 7 51 10 PM
Screenshot 2024-01-31 at 7 50 19 PM
Screenshot 2024-01-31 at 7 49 22 PM
Screenshot 2024-01-31 at 8 50 37 PM
Screenshot 2024-01-31 at 8 50 08 PM

Notes:

I wasn't able at first to test the IDEFICS models as I was facing an error when running cdk deploy with those models enabled:

Resource handler returned message: "CloudWatch Logs role ARN must be set in account settings to enable logging (Service: ApiGateway, Status Code: 400, Request ID: bbfb4458-
d5c2-4184-9a8a-0ea549b52d47)" (RequestToken: 56d1d88b-b812-701d-c11b-98765a7f5c14, HandlerErrorCode: InvalidRequest)

I Had to create an IAM role with apigateway.amazonaws.com as its trusted entity, attach the managed policy AmazonAPIGatewayPushToCloudWatchLogs to the IAM role, and set the IAM role ARN on the cloudWatchRoleArn property of my account. Haven't seen that step mentioned in the documentation.

Questions:

@bigadsoleiman @spugachev

  1. I didn't remove here the code related to the original constructs, since the custom inference script feature is not available yet in the Generative AI CDK constructs. Is that fine with you ?
  2. Should we also remove the code in scripts/get-model-packages ? Seems this is not necessary anymore
  3. Do you want me to update the documentation as well (sagemaker-model/README.md) to reflect the changes above ?
  4. Anything else I may have missed ?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bigadsoleiman bigadsoleiman requested review from bigadsoleiman and spugachev and removed request for bigadsoleiman February 1, 2024 14:23
@bigadsoleiman
Copy link
Collaborator

Thanks @krokoko

  1. Yes
  2. Yes
  3. Yes please but then move it to https://github.com/aws-samples/aws-genai-llm-chatbot/tree/main/docs you can add a dedicated page for model constructs if you'd like.
  4. No

@krokoko krokoko marked this pull request as ready for review February 1, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants