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: support model deployment #496

Merged
merged 2 commits into from
Dec 26, 2024
Merged

feat: support model deployment #496

merged 2 commits into from
Dec 26, 2024

Conversation

NingLu
Copy link
Collaborator

@NingLu NingLu commented Dec 26, 2024

Fixes #

🤖 AI-Generated PR Description (Powered by Amazon Bedrock)

Description

This pull request includes changes to support the deployment of a new model management Lambda function and the addition of a script to facilitate building the project artifacts for deployment. The key changes are:

  • Added a new model_management Lambda function to handle model lifecycle operations such as training, evaluation, and deployment.
  • Updated the api-stack and chat-stack to include the new model_management Lambda function and associated resources.
  • Modified the iam-helper and lambda-layers files to include the necessary permissions and layers for the new Lambda function.
  • Updated the online Lambda function's requirements to include any new dependencies.
  • Added a pipeline_monitor Lambda function to monitor the model training pipeline.
  • Included a new script build-s3-dist.sh to build and package the project artifacts for deployment to S3.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

File Stats Summary

File number involved in this PR: 9, unfold to see the details:

The file changes summary is as follows:

Files
Changes
Change Summary
source/lambda/online/requirements.txt 0 added, 1 removed The code change removes a commented URL and updates the versions of langchain-aws, langgraph, and langchain-community packages.
source/lambda/model_management/requirements.txt 1 added, 0 removed This change adds a URL pointing to an Amazon S3 bucket location for downloading a Python wheel package named "dmaa" version 0.4.0.
source/infrastructure/lib/shared/lambda-layers.ts 27 added, 2 removed This code change renames the createOnlineSourceLayer method to createSharedLayer, adds a new method createModelDeploymentLayer for creating a Python layer for model deployment, and updates the description and asset exclusions for the createJobSourceLayer method.
source/script/build-s3-dist.sh 30 added, 0 removed This code snippet is a Bash script that performs the following tasks: cleans up existing distribution folders, creates new folders for packaging Lambda functions, copies common utility files to the prompt_management Lambda function directory, and zips the prompt_management Lambda function code into a deployment package.
source/infrastructure/lib/chat/chat-stack.ts 3 added, 3 removed The code changes involve modifying the Lambda layers used in the ChatStack. It creates a shared layer for the API Lambda, a job source layer, and a new model deployment layer, which are then assigned to the lambdaOnlineMain function.
source/lambda/model_management/model_management.py 70 added, 71 removed The code changes include removing unused imports, adding email and group claims from Cognito authorizer, handling cases when the authorizer is not enabled, and minor refactoring for code readability.
source/lambda/pipeline_monitor/pipeline_monitor.py 38 added, 1 removed This code change adds functionality to grant the AWS Lambda invoke permission to the existing CodePipeline role, allowing the CodePipeline to invoke Lambda functions during the pipeline execution.
source/infrastructure/lib/shared/iam-helper.ts 22 added, 1 removed The code changes add a new PolicyStatement for CloudFormation actions and resources, and extend the existing CodePipeline PolicyStatement with additional actions related to pipeline execution and monitoring.
source/infrastructure/lib/api/api-stack.ts 39 added, 71 removed The code changes involve creating a shared Lambda layer for API functions, adding a new Lambda function for model management, and integrating the new function with API Gateway to handle model deployment, status, and destruction operations.

Copy link
Contributor

@IcyKallen IcyKallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IcyKallen IcyKallen merged commit 009e936 into dev Dec 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants