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

Introduce RemoteIndexClient #1

Conversation

owenhalpert
Copy link
Collaborator

Description

First PR for opensearch-project#2518 (Client Skeleton, Build Request, Error Handling, Unit Tests)

This PR introduces the initial implementation of the Remote Index client, which is awaiting implementation on the following:

  • Programmatic build request construction is partially completed, but missing a few parameters. Please feel free to review the existing parameters without TODO.
  • Polling mechanism
  • Metric collection
  • Complete unit testing

Related Issues

opensearch-project#2391 Meta Issue
opensearch-project#2393 HLD by @jed326
opensearch-project#2518 My LLD

Check List

  • New functionality includes testing.
    - [ ] New functionality has been documented.
    - [ ] API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
    - [ ] Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@owenhalpert owenhalpert force-pushed the ohalpert-remote-vector-dev branch 3 times, most recently from 47db2b4 to d7e9ce3 Compare February 25, 2025 19:37
Add RemoteIndexClient initial implementation, its accompanying dependencies, and Build Request, Retry Strategy, and test files

Signed-off-by: owenhalpert <[email protected]>
@owenhalpert owenhalpert force-pushed the ohalpert-remote-vector-dev branch from d7e9ce3 to 84ba0ca Compare February 25, 2025 19:39
* @return The HTTP Client
*/
private CloseableHttpClient createHttpClient() {
// TODO The client will need to be rebuilt iff we decide to allow for retry configuration in the future
Copy link
Owner

Choose a reason for hiding this comment

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

Let's clearly delineate what is going in the first cut vs what is going in future work. You can use opensearch-project#2464 for future work.

* @return job_id from the server response used to track the job
*/
public String submitVectorBuild(RemoteBuildRequest request) throws IOException {
URI endpoint = URI.create(KNNSettings.state().getSettingValue(KNNSettings.KNN_REMOTE_BUILD_SERVICE_ENDPOINT));
Copy link
Owner

Choose a reason for hiding this comment

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

We need to have validation on the settings, and we should also add this to shouldBuildIndexRemotely

* InterruptedExceptions will cause a fallback to local CPU build.
*/
@Log4j2
public class RemoteIndexClient {
Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if we need an interface here to support extending to other client types, for example if we want to support not polling in the future or gRPC or anything else. It may make testing easier too.

Access modifiers, small refactoring variable names and constants
@owenhalpert owenhalpert changed the base branch from remote-vector-dev to main February 25, 2025 20:34
@owenhalpert owenhalpert changed the base branch from main to remote-vector-dev February 25, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants