File tree 12 files changed +146
-0
lines changed
main/java/org/testcontainers/qdrant
java/org/testcontainers/qdrant
12 files changed +146
-0
lines changed Original file line number Diff line number Diff line change 47
47
- PostgreSQL
48
48
- Presto
49
49
- Pulsar
50
+ - Qdrant
50
51
- QuestDB
51
52
- RabbitMQ
52
53
- Redpanda
Original file line number Diff line number Diff line change 47
47
- PostgreSQL
48
48
- Presto
49
49
- Pulsar
50
+ - Qdrant
50
51
- QuestDB
51
52
- RabbitMQ
52
53
- Redpanda
Original file line number Diff line number Diff line change 45
45
- Oracle XE
46
46
- OrientDB
47
47
- PostgreSQL
48
+ - Qdrant
48
49
- QuestDB
49
50
- Presto
50
51
- Pulsar
Original file line number Diff line number Diff line change @@ -240,6 +240,11 @@ updates:
240
240
schedule :
241
241
interval : " weekly"
242
242
open-pull-requests-limit : 10
243
+ - package-ecosystem : " gradle"
244
+ directory : " /modules/qdrant"
245
+ schedule :
246
+ interval : " weekly"
247
+ open-pull-requests-limit : 10
243
248
- package-ecosystem : " gradle"
244
249
directory : " /modules/questdb"
245
250
schedule :
Original file line number Diff line number Diff line change 152
152
- changed-files :
153
153
- any-glob-to-any-file :
154
154
- modules/pulsar/**/*
155
+ " modules/qdrant " :
156
+ - changed-files :
157
+ - any-glob-to-any-file :
158
+ - modules/qdrant/**/*
155
159
" modules/questdb " :
156
160
- changed-files :
157
161
- any-glob-to-any-file :
Original file line number Diff line number Diff line change @@ -205,6 +205,9 @@ labels:
205
205
- name : modules/pulsar
206
206
color : ' #006b75'
207
207
208
+ - name : modules/qdrant
209
+ color : ' #006b75'
210
+
208
211
- name : modules/questdb
209
212
color : ' #006b75'
210
213
Original file line number Diff line number Diff line change
1
+ # Qdrant
2
+
3
+ Testcontainers module for [ Qdrant] ( https://registry.hub.docker.com/r/qdrant/qdrant )
4
+
5
+ ## Qdrant's usage examples
6
+
7
+ You can start a Qdrant container instance from any Java application by using:
8
+
9
+ <!-- codeinclude-->
10
+ [ Default QDrant container] ( ../../modules/qdrant/src/test/java/org/testcontainers/qdrant/QdrantContainerTest.java ) inside_block: qdrantContainer
11
+ <!-- /codeinclude-->
12
+
13
+ ## Adding this module to your project dependencies
14
+
15
+ Add the following dependency to your ` pom.xml ` /` build.gradle ` file:
16
+
17
+ === "Gradle"
18
+ ```groovy
19
+ testImplementation "org.testcontainers:qdrant:{{latest_version}}"
20
+ ```
21
+
22
+ === "Maven"
23
+ ```xml
24
+ <dependency >
25
+ <groupId >org.testcontainers</groupId >
26
+ <artifactId >qdrant</artifactId >
27
+ <version >{{latest_version}}</version >
28
+ <scope >test</scope >
29
+ </dependency >
30
+ ```
Original file line number Diff line number Diff line change 89
89
- modules/mockserver.md
90
90
- modules/nginx.md
91
91
- modules/pulsar.md
92
+ - modules/qdrant.md
92
93
- modules/rabbitmq.md
93
94
- modules/redpanda.md
94
95
- modules/solace.md
Original file line number Diff line number Diff line change
1
+ description = " Testcontainers :: Qdrant"
2
+
3
+ dependencies {
4
+ api project(' :testcontainers' )
5
+
6
+ testImplementation ' org.assertj:assertj-core:3.25.1'
7
+ testImplementation ' io.qdrant:client:1.7.1'
8
+ testImplementation platform(' io.grpc:grpc-bom:1.61.1' )
9
+ testImplementation ' io.grpc:grpc-stub'
10
+ testImplementation ' io.grpc:grpc-protobuf'
11
+ testImplementation ' io.grpc:grpc-netty-shaded'
12
+ }
Original file line number Diff line number Diff line change
1
+ package org .testcontainers .qdrant ;
2
+
3
+ import org .testcontainers .containers .GenericContainer ;
4
+ import org .testcontainers .containers .wait .strategy .Wait ;
5
+ import org .testcontainers .utility .DockerImageName ;
6
+
7
+ /**
8
+ * Testcontainers implementation for Qdrant.
9
+ * <p>
10
+ * Supported image: {@code qdrant/qdrant}
11
+ * <p>
12
+ * Exposed ports:
13
+ * <ul>
14
+ * <li>HTTP: 6333</li>
15
+ * <li>Grpc: 6334</li>
16
+ * </ul>
17
+ */
18
+ public class QdrantContainer extends GenericContainer <QdrantContainer > {
19
+
20
+ private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName .parse ("qdrant/qdrant" );
21
+
22
+ public QdrantContainer (String image ) {
23
+ this (DockerImageName .parse (image ));
24
+ }
25
+
26
+ public QdrantContainer (DockerImageName dockerImageName ) {
27
+ super (dockerImageName );
28
+ dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME );
29
+ withExposedPorts (6333 , 6334 );
30
+ waitingFor (Wait .forHttp ("/readyz" ).forPort (6333 ));
31
+ }
32
+
33
+ public String getGrpcHostAddress () {
34
+ return getHost () + ":" + getMappedPort (6334 );
35
+ }
36
+ }
Original file line number Diff line number Diff line change
1
+ package org .testcontainers .qdrant ;
2
+
3
+ import io .grpc .Grpc ;
4
+ import io .grpc .InsecureChannelCredentials ;
5
+ import io .qdrant .client .QdrantGrpcClient ;
6
+ import io .qdrant .client .grpc .QdrantOuterClass ;
7
+ import org .junit .Test ;
8
+
9
+ import java .util .concurrent .ExecutionException ;
10
+
11
+ import static org .assertj .core .api .Assertions .assertThat ;
12
+
13
+ public class QdrantContainerTest {
14
+
15
+ @ Test
16
+ public void test () throws ExecutionException , InterruptedException {
17
+ try (
18
+ // qdrantContainer {
19
+ QdrantContainer qdrant = new QdrantContainer ("qdrant/qdrant:v1.7.4" )
20
+ // }
21
+ ) {
22
+ qdrant .start ();
23
+
24
+ QdrantGrpcClient client = QdrantGrpcClient
25
+ .newBuilder (
26
+ Grpc .newChannelBuilder (qdrant .getGrpcHostAddress (), InsecureChannelCredentials .create ()).build ()
27
+ )
28
+ .build ();
29
+ QdrantOuterClass .HealthCheckReply healthCheckReply = client
30
+ .qdrant ()
31
+ .healthCheck (QdrantOuterClass .HealthCheckRequest .getDefaultInstance ())
32
+ .get ();
33
+ assertThat (healthCheckReply .getVersion ()).isEqualTo ("1.7.4" );
34
+ }
35
+ }
36
+ }
Original file line number Diff line number Diff line change
1
+ <configuration >
2
+
3
+ <appender name =" STDOUT" class =" ch.qos.logback.core.ConsoleAppender" >
4
+ <!-- encoders are assigned the type
5
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
6
+ <encoder >
7
+ <pattern >%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern >
8
+ </encoder >
9
+ </appender >
10
+
11
+ <root level =" INFO" >
12
+ <appender-ref ref =" STDOUT" />
13
+ </root >
14
+
15
+ <logger name =" org.testcontainers" level =" INFO" />
16
+ </configuration >
You can’t perform that action at this time.
0 commit comments