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

refactor: Qdrant module QOL improvements #8449

Closed
wants to merge 7 commits into from

Conversation

Anush008
Copy link
Contributor

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 as a code owner March 13, 2024 06:01
Copy link
Member

@eddumelendez eddumelendez left a comment

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
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.

@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
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
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
Contributor 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
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
Contributor 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.

Copy link
Member

@eddumelendez eddumelendez Apr 12, 2024

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
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
Contributor 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
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