Skip to content

refactor: Qdrant module QOL improvements - #8449

Closed
Anush008 wants to merge 7 commits into
testcontainers:mainfrom
Anush008:main
Closed

refactor: Qdrant module QOL improvements#8449
Anush008 wants to merge 7 commits into
testcontainers:mainfrom
Anush008:main

Conversation

@Anush008

Copy link
Copy Markdown

This PR makes QOL improvements to the Qdrant module.

Adds builder methods to configure an API key and config file with associated tests.

@Anush008
Anush008 requested a review from a team March 13, 2024 06:01

@eddumelendez eddumelendez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution, @Anush008! I've left some comments.

Comment on lines +51 to +57
public int getRestPort() {
return getMappedPort(QDRANT_REST_PORT);
}

public int getGrpcPort() {
return getMappedPort(QDRANT_GRPC_PORT);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we haven't done this in the past but I think for GRPC this makes sense? I'll discuss with the team to open QDRANT_REST_PORT and QDRANT_GRPC_PORT instead of doing it in all the modules.

Comment thread modules/qdrant/src/test/java/org/testcontainers/qdrant/QdrantContainerTest.java Outdated
@Anush008
Anush008 requested a review from eddumelendez March 18, 2024 11:32
Comment on lines +10 to +14
*
* <p>Supported image: {@code qdrant/qdrant}
*
* <p>Exposed ports:
*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we revert those changes, please?

Comment on lines +51 to +53
public int getHttpPort() {
return getMappedPort(QDRANT_REST_PORT);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I understand one of the ways for the GRPC client is using specifically the port but do we know of any client building the API just like GRPC?

Suggested change
public int getHttpPort() {
return getMappedPort(QDRANT_REST_PORT);
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I didn't get what you meant. Could you clarify, please?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a qdrant client that use the REST port just like GRPC does? In GRPC makes sense because the client allows it but with the REST port IDK

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It for general availability for anyone who wants to use Qdrant via the REST interface in any way.

@eddumelendez eddumelendez Apr 12, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In that case, getHttpHostAddress() or getHttpEndpoint() make sense but since Qdrant doesn't provide a rest client, I'd prefer just to keep the getGrpcHostAddress()

String getHttpHostAddress() {
return getHost() + ":" + getMappedPort(REST_PORT);
}

String getHttpEndpoint() {
return "http://" + getHost() + ":" + getMappedPort(REST_PORT);
}

.healthCheck(QdrantOuterClass.HealthCheckRequest.getDefaultInstance())
.get();
QdrantClient client = new QdrantClient(
QdrantGrpcClient.newBuilder(qdrant.getHost(), qdrant.getGrpcPort(), false).build()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wonder why changing this test? It is also a valid way to build a client and using the getGrpcHostAddress()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is only a style improvement. It's comparatively simpler.

@eddumelendez

Copy link
Copy Markdown
Member

Thanks for your contribution, @Anush008. I can not update the PR because is your main branch. I'm closing this in favor of #8556

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.

2 participants