You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Qdrant](https://qdrant.tech/) is an open source vector database designed for scalable and efficient similarity search
4
-
and nearest neighbor retrieval. It provides both RESTful and gRPC APIs, making it easy to integrate with various
5
-
applications, including search, recommendation, AI, and machine learning systems.
3
+
[Qdrant](https://qdrant.tech/) is an open source vector database designed for scalable and efficient similarity search and nearest neighbor retrieval. It provides both RESTful and gRPC APIs, making it easy to integrate with various applications, including search, recommendation, AI, and machine learning systems.
6
4
7
5
Add the following dependency to your project file:
8
6
9
7
```shell title="NuGet"
10
8
dotnet add package Testcontainers.Qdrant
11
9
```
12
10
13
-
You can start a Qdrant container instance from any .NET application. This example uses xUnit.net's `IAsyncLifetime` interface to manage the lifecycle of the container. The container is started in the `InitializeAsync` method before the test method runs, ensuring that the environment is ready for testing. After the test completes, the container is removed in the `DisposeAsync` method.
11
+
You can start an Qdrant container instance from any .NET application. This example uses xUnit.net's `IAsyncLifetime` interface to manage the lifecycle of the container. The container is started in the `InitializeAsync` method before the test method runs, ensuring that the environment is ready for testing. After the test completes, the container is removed in the `DisposeAsync` method.
The test example uses the following NuGet dependencies:
@@ -28,23 +26,45 @@ To execute the tests, use the command `dotnet test` from a terminal.
28
26
29
27
--8<-- "docs/modules/_call_out_test_projects.txt"
30
28
31
-
## A Note To Developers
29
+
## Configure API key
32
30
33
-
The Testcontainers module creates a container that listens to requests over **HTTP**. The official Qdrant client uses the gRPC APIs to communicate
34
-
with Qdrant. **.NET Core** and **.NET** support the above example with no additional configuration. However, **.NET Framework** has limited supported for gRPC over HTTP/2, but it can be enabled by
- Configuring the Testcontainers module to use TLS and using **HTTPS** to communicate with the cluster
37
-
- Configuring Server certificate validation
38
-
- Reference `System.Net.Http.WinHttpHandler` 6.0.1 or later, and configuring `WinHttpHandler` as the inner handler for `GrpcChannelOptions` on the Qdrant client
36
+
Make sure the underlying HTTP or gRPC client adds the API key to the HTTP header or gRPC metadata:
39
37
40
-
Refer to the [official Qdrant .NET SDK](https://github.com/qdrant/qdrant-dotnet) for further details.
The following example creates a self-signed certificate and configures the Testcontainers module to use TLS with the certificate and private key, along with an API key for authentication. The Qdrant client is configured to validate the TLS certificate using its thumbprint, and use the API key
45
-
to authenticate.
45
+
The following example generates a self-signed certificate and configures the Testcontainers module to use TLS with the certificate and private key:
The Testcontainers module creates a container that listens to requests over **HTTP**. The official Qdrant client uses the gRPC APIs to communicate with Qdrant. **.NET Core** and **.NET** support the above example with no additional configuration. However, **.NET Framework** has limited supported for gRPC over HTTP/2, but it can be enabled by
65
+
66
+
1. Configuring the Testcontainers module to use TLS.
67
+
1. Configuring server certificate validation.
68
+
1. Reference [`System.Net.Http.WinHttpHandler`](https://www.nuget.org/packages/System.Net.Http.WinHttpHandler) version `6.0.1` or later, and configure `WinHttpHandler` as the handler for `GrpcChannelOptions` in the Qdrant client.
69
+
70
+
Refer to the [official Qdrant .NET SDK](https://github.com/qdrant/qdrant-dotnet) for more information.
// By default, the base builder waits until the container is running. However, for Qdrant, a more advanced waiting strategy is necessary that requires access to the configured certificate.
70
+
// If the user does not provide a custom waiting strategy, append the default Qdrant waiting strategy.
0 commit comments