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(Construct): replace custom resource with bedrock L1 constructs #414

Merged
merged 66 commits into from May 15, 2024

Conversation

dineshSajwan
Copy link
Contributor

@dineshSajwan dineshSajwan commented Apr 30, 2024

Fixes #361

  1. Removed custom resource from bedrock construct.
  2. removed custom resource policies from the construct.
  3. Upgraded CDK version to 2.141.0
  4. Removed knowledge based storage type Redis Enterprise since it is not supported by L1 Constructs
  5. Added bedrock L1 construct for datasource , knowledge base, agent and agent alias.
  6. Updated test cases for bedrock conctruct
  7. Updated agent addAction group and addKnowledgebases method in agent.ts

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

Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 94.01198% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 93.07%. Comparing base (1ceb3f9) to head (3e4a874).

Files Patch % Lines
src/cdk-lib/bedrock/agent.ts 93.49% 8 Missing ⚠️
src/cdk-lib/bedrock/knowledge-base.ts 90.90% 7 Missing ⚠️
src/cdk-lib/bedrock/agent-alias.ts 88.23% 4 Missing ⚠️
src/cdk-lib/bedrock/s3-data-source.ts 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #414      +/-   ##
==========================================
- Coverage   93.29%   93.07%   -0.22%     
==========================================
  Files          50       47       -3     
  Lines       11420    11164     -256     
  Branches      255      358     +103     
==========================================
- Hits        10654    10391     -263     
- Misses        766      773       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dineshSajwan dineshSajwan marked this pull request as ready for review May 8, 2024 14:35
@dineshSajwan dineshSajwan requested a review from a team as a code owner May 8, 2024 14:35
@krokoko
Copy link
Collaborator

krokoko commented May 13, 2024

Tested in TS, deployment of agents with KBs using OSS and Pinecone works as expected

Remaining tasks:

  • keep possibility to pass kbs through the construct (call addKBs)
  • Add KBs and add action groups should append to the list, not replace
  • Aurora as a vector store fails to deploy:
Received response status [FAILED] from custom resource. Message returned: Error: Unable to import module 'custom_resources': No module named 'psycopg2._psycopg
'

Logs: /aws/lambda/***

at invokeUserFunction (/var/task/framework.js:2:6)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async onEvent (/var/task/framework.js:1:369)
at async Runtime.handler (/var/task/cfn-response.js:1:1676)


Runtime.ImportModuleError: Unable to import module 'custom_resources': No module named 'psycopg2._psycopg'�Traceback (most recent call last):

This issue is not related to the changes from this branch, and seems to happen on MacOS only. Will open a separate ticket for it

  • Test and validate Python deployments

@krokoko krokoko self-requested a review May 14, 2024 21:50
Copy link
Collaborator

@krokoko krokoko left a comment

Choose a reason for hiding this comment

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

  • delete the file under 'public-registries'
  • couple of commented tests which should be fixed
    otherwise should be good !

@krokoko krokoko self-requested a review May 15, 2024 15:41
krokoko
krokoko previously approved these changes May 15, 2024
@krokoko krokoko enabled auto-merge (squash) May 15, 2024 15:48
@krokoko krokoko merged commit 0c6cb31 into main May 15, 2024
18 of 19 checks passed
@krokoko krokoko deleted the feature/bedrock_L1_constructs branch May 15, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(bedrock): adopt official cloudformation resources
5 participants