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

[release/8.0] Initial work for Qdrant resource and component (#3131) #3416

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Apr 4, 2024

Backport of #3131 to release/8.0

/cc @timheuer

Customer Impact

Being able to simply use a Qdrant vector database container and easily get a QdrantClient connected to it using Aspire makes it easier to be able to write smart applications.

Adding Qdrant Hosting and runtime component libraries makes it easy to work with this vector database.

Testing

Added new tests for hosting and the component.
Manually ran the playground app.

Risk

Very low. This only adds 2 new packages and doesn't touch anything in already shipping packages. If these packages aren't referenced by the user, it won't affect the user at all.


This PR adds a Resource and initial Component (plus playground and tests)

Resource exposes two API access endpoints (REST + gRPC). The QdrantClient for .NET uses gRPC by default but Semantic Kernel does not use that client library so the other exposed endpoint is helpful.

REST endpoint by default exposes a Web UI dashboard -- this is excluded in Publish (per documentation in source, confirmed with Qdrant contributors).

Endpoints are secured non-optionally with an API Key (using ParameterResource -- will generate random if not provided).

Component used QdrantClient .NET version (recommended from Qdrant). This component uses gRPC endpoint by default. Settings will read from standard env vars for ConnectionString + API key or from config for the component itself if provided.

  • Initial draft of QdrantServerResource
  • exposed gRPC endpoint as primary (c# client uses that)
  • exposes HTTP endpoint optionally (as dashboard is there)
  • defaults to secure the access via API key (mainly due to dashboard)
  • Fix-up after main rebase on removing InputAnnotation

  • Remove dashboard in Publish mode

  • change how dashboard is removed in Publish (per docs)
  • add 'qdrant' to spelling.dic
  • fix tests
  • Fixup code style violations

  • Change ApiKey reference

  • Add WithReference overload (setting cn string + key)
  • Added tests for named parameter on manifest
  • Changed playground app
  • Initial Qdrant component work
  • adds component (using Qdrant.QdrantClient)
  • Change playground to use DI component
  • Changed rest endpoint name
  • changed to 'rest' as named endpoint
  • added to reference as a ConnectionString_{name}_rest (for support for SK)
  • fixed tests
  • Addressing PR feedback
  • Changed parameters to component config
  • change playground app to keyed services
  • changed playground to use shared servicedefaults
  • Fixing volume mounts to correct target location

  • Add missing README to component

  • Adding logo usage comment to readme after permission from Andrey V from Qdrant

  • Changed playground sample

  • matching sample Qdrant/.NET workbook sample
  • PR Feedback: Name maps to client name used

  • PR feedback on connection sring

  • Moved to Endpoint/Key connection string
  • Renamed to Key
  • Modified schema to match/updated tests
  • Changed primary endpoint to use scheme instead of hardcode
  • removed env var for API key only
  • fixed renamed component proj location in sln
  • Updating readme/comments to match config

  • Endpoint property typo fix

  • PR Feedback

  • No need for endpoint null check
  • Fixed tests
  • Cleanup of ServiceDefaults Change to ReferenceExpression.Create

  • More PR Feedback

  • Rename component correctly
  • Add component client tests
  • Add component logging (and document)
  • Add property for 2nd endpoint on resource directly
  • PR feedback

  • Fix up the playground to run with latest changes.

  • Rename QdrantSettings to QdrantClientSettings to match the pattern in other components.

Add class level summary docs.


Microsoft Reviewers: Open in CodeFlow

This PR adds a Resource and initial Component (plus playground and tests)

Resource exposes two API access endpoints (REST + gRPC). The QdrantClient for .NET uses gRPC by default but Semantic Kernel does not use that client library so the other exposed endpoint is helpful.

REST endpoint by default exposes a Web UI dashboard -- this is excluded in Publish (per documentation in source, confirmed with Qdrant contributors).

Endpoints are secured non-optionally with an API Key (using ParameterResource -- will generate random if not provided).

Component used QdrantClient .NET version (recommended from Qdrant). This component uses gRPC endpoint by default. Settings will read from standard env vars for ConnectionString + API key or from config for the component itself if provided.

* Initial draft of QdrantServerResource
- exposed gRPC endpoint as primary (c# client uses that)
- exposes HTTP endpoint optionally (as dashboard is there)
- defaults to secure the access via API key (mainly due to dashboard)

* Fix-up after main rebase on removing InputAnnotation

* Remove dashboard in Publish mode
- change how dashboard is removed in Publish (per docs)
- add 'qdrant' to spelling.dic
- fix tests

* Fixup code style violations

* Change ApiKey reference
- Add WithReference overload (setting cn string + key)
- Added tests for named parameter on manifest
- Changed playground app

* Initial Qdrant component work
- adds component (using Qdrant.QdrantClient)
- Change playground to use DI component

* Changed rest endpoint name
- changed to 'rest' as named endpoint
- added to reference as a ConnectionString_{name}_rest (for support for SK)
- fixed tests

* Addressing PR feedback
- Changed parameters to component config
- change playground app to keyed services
- changed playground to use shared servicedefaults

* Fixing volume mounts to correct target location

* Add missing README to component

* Adding logo usage comment to readme after permission from Andrey V from Qdrant

* Changed playground sample
- matching sample Qdrant/.NET workbook sample

* PR Feedback: Name maps to client name used

* PR feedback on connection sring
- Moved to Endpoint/Key connection string
- Renamed to Key
- Modified schema to match/updated tests
- Changed primary endpoint to use scheme instead of hardcode
- removed env var for API key only
- fixed renamed component proj location in sln

* Updating readme/comments to match config

* Endpoint property typo fix

* PR Feedback
- No need for endpoint null check
- Fixed tests

* Cleanup of ServiceDefaults
Change to ReferenceExpression.Create

* More PR Feedback
- Rename component correctly
- Add component client tests
- Add component logging (and document)
- Add property for 2nd endpoint on resource directly

* PR feedback

* Fix up the playground to run with latest changes.

* Rename QdrantSettings to QdrantClientSettings to match the pattern in other components.

Add class level summary docs.

---------

Co-authored-by: Eric Erhardt <[email protected]>
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-integrations Issues pertaining to Aspire Integrations packages label Apr 4, 2024
@dotnet-policy-service dotnet-policy-service bot added the Servicing-consider Issue for next servicing release review label Apr 4, 2024
@danmoseley danmoseley added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 5, 2024
@danmoseley
Copy link
Member

Is there feedback on the original PR still to address?

@davidfowl
Copy link
Member

Yes, I left some comments.

@timheuer
Copy link
Member

timheuer commented Apr 5, 2024

Can you cherry-pick into this the other feedback fixups in #3422

@eerhardt eerhardt added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Apr 5, 2024
@eerhardt
Copy link
Member Author

eerhardt commented Apr 5, 2024

Marking as "no merge" for now, to wait for the changes in #3422.

* Addressing port/endpoint issues on Qdrant

* PR feedback (param name)

* Fix up tests

* Respond to PR feedback.

Rename ports and endpoint names to be consistent.

* PR feedback
- moved to using grpc/http endpoint name consistent with config and prior art
- fixed wrong link in readme
- fixed/validated resource hosting test

---------

Co-authored-by: Eric Erhardt <[email protected]>
@eerhardt eerhardt removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Apr 5, 2024
@eerhardt
Copy link
Member Author

eerhardt commented Apr 5, 2024

The changes in #3422 are now in this PR as well. This PR is ready for review.

Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

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

Approved in chat.

@eerhardt eerhardt added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Apr 8, 2024
@eerhardt
Copy link
Member Author

eerhardt commented Apr 8, 2024

Need to also take #3487 into this PR.

@eerhardt eerhardt removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Apr 8, 2024
@eerhardt eerhardt enabled auto-merge (squash) April 8, 2024 20:22
@eerhardt eerhardt merged commit e8b703f into dotnet:release/8.0 Apr 8, 2024
8 checks passed
@eerhardt eerhardt deleted the PortQdrant branch April 8, 2024 22:07
@danmoseley danmoseley mentioned this pull request Apr 12, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-integrations Issues pertaining to Aspire Integrations packages Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants