Skip to content

Commit 6475b84

Browse files
github-actionsPatrick
authored andcommitted
feat: combine all
feat: combining all parent 364274d author github-actions <github-actions@github.com> 1702080482 +0000 committer Patrick <ocopatr@amazon.com> 1705428058 -0800 chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7147565079 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7161144540 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> chore(doc): update documentation and generate new list of models to deploy chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7174960686 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> feat: qa concurrency props fix(constructs): fix log group name fix(lint): run linter fix(lint): differentiate name feat(doc): update readme with additional resources chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7228300421 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7255404764 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7325128447 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> chore: upgrading package versions Docs no longer support langchain 0.0.329 Signed-off-by: Patrick O'Connor <35761519+oconpa@users.noreply.github.com> fix(config): update .projenrc.ts Add IDE specific ignore folders Signed-off-by: Michael Walker <michaelhuytran@gmail.com> feat(configs): add gitignore for IDE files ci(projen): uncapping cdk version to allow usage with latest cdk less pip error ci(projen): lowest build version feat(layer): additional packages prop, rename of layers for ease, typing from layer construct fix: remove console log statements Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> feat(constructs): add how to section for testing constructs feat(docs): add screenshots fix(readme): update README.md Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> Signed-off-by: Michael Walker <michaelhuytran@gmail.com> fix(readme): update README.md Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> Signed-off-by: Michael Walker <michaelhuytran@gmail.com> fix(readme): update README.md Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> Signed-off-by: Michael Walker <michaelhuytran@gmail.com> feat(docs): move to developer guide feat(docs): move to developer guide fix: ts-jest configuration under globals Projen 0.78.9 fixes the warning: > (WARN) Define `ts-jest` config under `globals` is deprecated Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> fix: correct opt-out logic (awslabs#183) fix: correct opt-out logic * dynamically fetch version from the package.json * include the name of the class * string format * camel case solution_id variable and move into context --------- Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> feat(construct): new construct for deployment of custom models to sagemaker (awslabs#180) * feat(construct): New construct CustomSagemakerEndpoint Fixes (New construct): Add support to deploy custom models to a sagemaker endpoint awslabs#150 * chore(construct): Update documentation * feat(construct): Add new projen task to run the code generation step (create list of available containers / jumpstart models). Can be used through projen generate-models-containers * chore(construct): Update list of available models * fix(construct): Fixes (gen-ai): JumpStartSageMakerEndpoint not working awslabs#179 : address the issue of some models from JumpStart which can't be deployed. This is due to the construct requiring model data to be provided as a compressed object, however some newer JumpStart models provide uncompressed model artifacts. Tested the fix with the reported model - whisper base 2.0.0. Deployed model and ran inference. This requires an upgrade of cdk as the update to the L1 CloudFormation resource was added recently (addition of the property https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnModel.ModelDataSourceProperty.html) chore(deps): upgrade dependencies (awslabs#188) Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7482301025 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> Co-authored-by: github-actions <github-actions@github.com> fix: use definition instead of schema (awslabs#187) Closes awslabs#186 Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> feat: add husky with a convential commit check (awslabs#189) Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> fix(doc): Update README.md (awslabs#190) Remove duplicated section from the readme Signed-off-by: Alain Krok <alkrok@amazon.com> fix: do not require husky downstream (awslabs#192) Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com> chore(doc): Update README_custom_sagemaker_endpoint.md (awslabs#191) Fix image not displayed Signed-off-by: Alain Krok <alkrok@amazon.com> chore(deps): upgrade dependencies (awslabs#194) Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/awslabs/generative-ai-cdk-constructs/actions/runs/7508788235 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions <github-actions@github.com> Co-authored-by: github-actions <github-actions@github.com>
1 parent 364274d commit 6475b84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2210
-778
lines changed

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitattributes

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitignore

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit "$1"

.npmignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/deps.json

Lines changed: 24 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/files.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/tasks.json

Lines changed: 15 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
1111
* and limitations under the License.
1212
*/
13-
import { awscdk } from 'projen';
13+
import { ProjenStruct, Struct } from '@mrgrain/jsii-struct-builder';
14+
import { JsonPatch, awscdk } from 'projen';
1415
import { NpmAccess } from 'projen/lib/javascript';
1516
import {
1617
buildMeritBadgerWorkflow,
@@ -27,26 +28,32 @@ import {
2728
const GITHUB_USER = 'awslabs';
2829
const PUBLICATION_NAMESPACE = 'cdklabs';
2930
const PROJECT_NAME = 'generative-ai-cdk-constructs';
30-
const CDK_VERSION: string = '2.111.0';
31+
const CDK_VERSION: string = '2.114.0';
3132

3233
const project = new awscdk.AwsCdkConstructLibrary({
3334
author: 'Amazon Web Services - Prototyping and Cloud Engineering',
3435
authorAddress: 'https://aws.amazon.com',
3536
authorOrganization: true,
3637
description: 'AWS Generative AI CDK Constructs is a library for well-architected generative AI patterns.',
3738
cdkVersion: CDK_VERSION,
38-
projenVersion: '~0.77.4',
39+
projenVersion: '~0.78.8',
3940
constructsVersion: '10.3.0',
40-
cdkVersionPinning: true,
4141
defaultReleaseBranch: 'main',
42-
jsiiVersion: '~5.0.0',
42+
jsiiVersion: '~5.3.0',
4343
name: '@' + PUBLICATION_NAMESPACE + '/' + PROJECT_NAME,
4444
projenrcTs: true,
4545
repositoryUrl: 'https://github.com/' + GITHUB_USER + '/' + PROJECT_NAME,
4646

4747
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */
4848
keywords: ['constructs', 'aws-cdk', 'generative-ai', 'emerging-tech'],
49-
devDeps: ['eslint-plugin-header'],
49+
devDeps: [
50+
'@commitlint/config-conventional',
51+
'commitlint',
52+
'eslint-plugin-header',
53+
'husky',
54+
'pinst',
55+
'@mrgrain/jsii-struct-builder',
56+
],
5057
deps: ['cdk-nag'],
5158

5259
// Keep synchronized with https://github.com/nodejs/release#release-schedule
@@ -85,7 +92,15 @@ const project = new awscdk.AwsCdkConstructLibrary({
8592
license: 'Apache-2.0',
8693
copyrightPeriod: '2023-',
8794
copyrightOwner: 'Amazon.com, Inc. or its affiliates. All Rights Reserved.',
88-
gitignore: ['*.DS_STORE', '!.node-version', '*.pyc', '__pycache__/', '!.ort.yml'],
95+
gitignore: [
96+
'*.DS_STORE',
97+
'!.node-version',
98+
'*.pyc',
99+
'__pycache__/',
100+
'!.ort.yml',
101+
'.idea',
102+
'.vscode',
103+
],
89104
stability: 'experimental',
90105
sampleCode: false,
91106
stale: true,
@@ -143,6 +158,36 @@ project.eslint?.addPlugins('header');
143158
project.eslint?.addRules({
144159
'header/header': [2, 'header.js'],
145160
});
161+
project.eslint?.addIgnorePattern('LangchainProps.ts');
162+
project.eslint?.addIgnorePattern('AdapterProps.ts');
146163

164+
// Shared interfaces extending pre-existing CDK interfaces
165+
new ProjenStruct(project, { name: 'LangchainProps' })
166+
.mixin(Struct.fromFqn('aws-cdk-lib.aws_lambda.LayerVersionProps'))
167+
.withoutDeprecated()
168+
.omit('code', 'compatibleRuntimes', 'compatibleArchitectures', 'description');
147169

148-
project.synth();
170+
new ProjenStruct(project, { name: 'AdapterProps' })
171+
.mixin(Struct.fromFqn('aws-cdk-lib.aws_lambda.LayerVersionProps'))
172+
.withoutDeprecated()
173+
.omit('code', 'description');
174+
175+
const packageJson = project.tryFindObjectFile('package.json');
176+
packageJson?.patch(JsonPatch.add('/scripts/prepare', 'husky install')); // yarn 1
177+
packageJson?.patch(JsonPatch.add('/scripts/postinstall', 'husky install')); // yarn 2
178+
packageJson?.patch(JsonPatch.add('/scripts/prepack', 'pinst --disable'));
179+
packageJson?.patch(JsonPatch.add('/scripts/postpack', 'pinst --enable'));
180+
181+
// Add generation of new available models for constructs
182+
project.addTask('generate-models-containers', {
183+
description: 'Generate new list of models available from Jumpstart and DLC containers',
184+
steps: [
185+
{
186+
say: 'Generate new list of models available from Jumpstart and DLC containers',
187+
cwd: project.srcdir+'/patterns/gen-ai/aws-model-deployment-sagemaker/code-generation',
188+
exec: 'npm run generate',
189+
},
190+
],
191+
});
192+
193+
project.synth();

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# CDK Generative AI Constructs V0.1.21 (2024-01-11)
2+
3+
Based on CDK library version 2.114.0
4+
15
# CDK Generative AI Constructs V0.1.0 (2023-11-30)
26

37
Based on CDK library version 2.111.0

DEVELOPER_GUIDE.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Default output format [None]: json
1616
```
1717

1818
- [Node](https://nodejs.org/en) >= v20.9.0
19-
- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.102.0) >= 2.111.0
19+
- [AWS CDK](https://github.com/aws/aws-cdk/releases/tag/v2.102.0) >= 2.114.0
2020
- [Python](https://www.python.org/downloads/) >=3.9
21-
- [Projen](https://github.com/projen/projen) >= 0.77.4
21+
- [Projen](https://github.com/projen/projen) >= 0.78.8
2222
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/cli/install/) >= 1.22.19
2323

2424
You can use the command below to install the dependencies listed above
@@ -64,6 +64,63 @@ All test files can be found in the /test directory under each construct (or core
6464
| `npx projen test` | This will run all tests (unit+integration) |
6565

6666
---
67+
## Testing Your Construct Locally
68+
69+
- Using the samples repository to test your locally changed constructs. This is also useful for development.
70+
71+
### Pre-req:
72+
- Download the samples repository (The official samples repository https://github.com/aws-samples/generative-ai-cdk-constructs-samples includes a collection of functional use case implementations to demonstrate the usage of AWS Generative AI CDK Constructs. These can be used in the same way as architectural patterns, and can be conceptualized as an additional "higher-level" abstraction of those patterns. Those patterns (constructs) are composed together into [stacks](https://docs.aws.amazon.com/cdk/latest/guide/stacks.html), forming a "CDK app".
73+
)
74+
75+
76+
### Step 1: Building the Generative AI CDK Construct
77+
78+
Navigate to the [Generative AI CDK Construct Repository] (https://github.com/aws-samples/generative-ai-cdk-constructs-samples):
79+
Open your command line interface and change directory to the generative AI CDK construct repository.
80+
81+
- Execute the command ```yarn build```.
82+
- This command runs npx projen build and generates a .jsii file in your repository.
83+
84+
### Step 2: Packaging the Constructs
85+
1. Run Yarn Package:JS:
86+
- Execute ```yarn package:js```.
87+
- This command creates a new .tgz package of all constructs in the dist/js folder.
88+
89+
2. Locate the TGZ File:
90+
- Find the generated .tgz file, typically named something like dist/js/generative-ai-cdk-constructs-0.0.0.jsii.tgz.
91+
92+
93+
### Step 3: Integrating with Sample Application
94+
95+
1. Drag and Drop the TGZ File:
96+
- Drag and drop the .tgz file into your samples repository, ideally at the root like "samples/document_explorer".
97+
98+
2. Modify package.json in Sample Repo:
99+
- Open package.json in your samples repository.
100+
- Under dependencies, locate the entry for "@cdklabs/generative-ai-cdk-constructs".
101+
- Replace the existing entry with file:<path-to-tgz-file>. For example:
102+
```
103+
...
104+
"dependencies": {
105+
"@cdklabs/generative-ai-cdk-constructs": "file:generative-ai-cdk-constructs@0.0.0.jsii.tgz",
106+
...
107+
```
108+
109+
### Step 4: Deploying to AWS
110+
111+
1. Navigate to Sample Repo Directory:
112+
- Change directory to your samples repository.
113+
2. AWS CDK Deployment:
114+
- Ensure you are authenticated to AWS with the necessary permissions.
115+
- Run ```cdk deploy``` to deploy the new backend with your generative AI constructs into the AWS Cloud.
116+
3. Verify Deployment:
117+
- Log into your AWS console and verify that the resources have been deployed successfully.
118+
- Check for any errors in the AWS CloudFormation console and address them as necessary.
119+
120+
### Testing and Verification
121+
122+
- After deployment, you may want to test the functionalities of the generative AI constructs in the AWS environment.
123+
- Ensure all integrations and functionalities are working as expected.
67124
68125
## Project structure
69126

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [Getting Started](#getting-started)
2323
- [Catalog](#catalog)
2424
- [Sample Use Cases](#sample-use-cases)
25+
- [Additional Resources](#additional-resources)
2526
- [Operational Metrics Collection](#operational-metrics-collection)
2627
- [Roadmap](#roadmap)
2728
- [Legal Disclaimer](#legal-disclaimer)
@@ -74,15 +75,20 @@ The following constructs are available in the library:
7475
| [Question answering](./src/patterns/gen-ai/aws-qa-appsync-opensearch/) | Question answering with a large language model (Anthropic Claude V2) using a RAG (retrieval augmented generation) source and/or long context. | Amazon OpenSearch, AWS Lambda, Amazon Bedrock, AWS AppSync |
7576
| [Summarization](./src/patterns/gen-ai/aws-summarization-appsync-stepfn/) | Document summarization with a large language model (Anthropic Claude V2). | AWS Lambda, Amazon Bedrock, AWS AppSync and Amazon Elasticache for Redis. |
7677
| [Lambda layer](./src/patterns/gen-ai/aws-langchain-common-layer/) | Python Lambda layer providing dependencies and utilities to develop generative AI applications on AWS. | AWS Lambda, Amazon Bedrock, Amazon SageMaker |
77-
| [SageMaker model deployment](./src/patterns/gen-ai/aws-model-deployment-sagemaker/) | Deploy a foundation model from Amazon SageMaker JumpStart or Hugging Face to an Amazon SageMaker endpoint. | Amazon SageMaker |
78+
| [SageMaker model deployment (Jumpstart)](./src/patterns/gen-ai/aws-model-deployment-sagemaker/README_jumpstart.md) | Deploy a foundation model from Amazon SageMaker JumpStart to an Amazon SageMaker endpoint. | Amazon SageMaker |
79+
| [SageMaker model deployment (Hugging Face)](./src/patterns/gen-ai/aws-model-deployment-sagemaker/README_hugging_face.md) | Deploy a foundation model from Hugging Face to an Amazon SageMaker endpoint. | Amazon SageMaker |
80+
| [SageMaker model deployment (Custom)](./src/patterns/gen-ai/aws-model-deployment-sagemaker/README_custom_sagemaker_endpoint.md) | Deploy a foundation model from an S3 location to an Amazon SageMaker endpoint. | Amazon SageMaker |
7881

7982
# Sample Use Cases
8083

81-
This library includes a collection of functional use case implementations to demonstrate the usage of AWS Generative AI CDK Constructs. These can be used in the same way as architectural patterns, and can be conceptualized as an additional "higher-level" abstraction of those patterns. Those patterns (constructs) are composed together into [stacks](https://docs.aws.amazon.com/cdk/latest/guide/stacks.html), forming a "CDK app".
84+
The official samples repository https://github.com/aws-samples/generative-ai-cdk-constructs-samples includes a collection of functional use case implementations to demonstrate the usage of AWS Generative AI CDK Constructs. These can be used in the same way as architectural patterns, and can be conceptualized as an additional "higher-level" abstraction of those patterns. Those patterns (constructs) are composed together into [stacks](https://docs.aws.amazon.com/cdk/latest/guide/stacks.html), forming a "CDK app".
8285

83-
The following use cases are provided as functional examples:
86+
# Additional Resources
8487

85-
Coming soon
88+
| Resource |Description|
89+
|:-------------|:-------------|
90+
| [AWS re:Invent 2023 - Keynote with Dr. Werner Vogels](https://youtu.be/UTRBVPvzt9w?t=6252) | Dr. Werner Vogels, Amazon.com's VP and CTO, announces the AWS Generative AI CDK Constructs during his AWS re:Invent 2023 keynote. |
91+
| [aws-cdk-stack-builder-tool](https://github.com/aws-samples/aws-cdk-stack-builder-tool) | AWS CDK Builder is a browser-based tool designed to streamline bootstrapping of Infrastructure as Code (IaC) projects using the AWS Cloud Development Kit (CDK). |
8692

8793
# Operational Metrics Collection
8894

docs/generative_ai_cdk_constructs.drawio

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
boto3>=1.28.69
2-
botocore>=1.31.69
1+
boto3>=1.34.6
2+
botocore>=1.34.6
33
requests==2.31.0
44
requests-aws4auth==1.2.3
5-
langchain==0.0.329
6-
opensearch-py==2.3.1
7-
openai==0.28.1
5+
langchain==0.0.351
6+
opensearch-py==2.4.2
7+
openai==1.6.0

0 commit comments

Comments
 (0)