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

implement prototype of agent grpc server #2492

Merged
merged 3 commits into from
May 23, 2024

Conversation

kmrmt
Copy link
Contributor

@kmrmt kmrmt commented May 7, 2024

Description

implement agent prototype of gRPC server using tonic.
I use todo macros in the implementation of the API functions.

Related Issue

Versions

  • Go Version: 1.22.2
  • Rust Version: 1.77.2
  • Docker Version: 20.10.8
  • Kubernetes Version: v1.29.3
  • NGT Version: 2.2.1

Checklist

Special notes for your reviewer

Summary by CodeRabbit

  • New Features

    • Introduced new functionalities for indexing, inserting, removing, searching, updating, and upserting data.
    • Enhanced capabilities for gRPC endpoints to manage index creation, retrieval, and metadata operations.
    • Implemented various methods for object and vector operations including single, streaming, and multiple operations.
  • Enhancements

    • Updated dependencies to improve functionality and compatibility.
    • Refactored the main function to utilize asynchronous operations, enhancing performance and scalability.
  • Documentation

    • Restructured module hierarchy to clarify the organization and improve maintainability.

Copy link
Contributor

coderabbitai bot commented May 7, 2024

Walkthrough

Walkthrough

The recent updates have significantly enhanced the Rust agent's capabilities by integrating new dependencies and expanding gRPC functionalities across various operations like indexing, inserting, removing, searching, updating, and upserting. The agent's server is now asynchronous with tokio, leveraging advanced stream handling. Additionally, the project's structure and dependencies have been updated, improving modularity and compatibility with newer versions of tonic.

Changes

Files Change Summary
rust/bin/agent/Cargo.toml, rust/libs/proto/Cargo.toml Updated dependencies including prost, proto, tokio, tokio-stream, tonic, and version bumps for tonic and tonic-types.
rust/bin/agent/src/handler.rs, rust/bin/agent/src/handler/*.rs Introduced comprehensive gRPC functionalities for operations like indexing, inserting, removing, searching, updating, and upserting. Added implementations for respective server traits in agent struct.
rust/bin/agent/src/main.rs Refactored the main function to utilize asynchronous operations with tokio.
rust/libs/proto/src/lib.rs Restructured module hierarchy, introducing core and v1 modules.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented May 7, 2024

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@kmrmt kmrmt force-pushed the feature/agent/rust/implement-grpc-server branch from 0c207af to 75afe44 Compare May 7, 2024 04:00
Copy link

cloudflare-workers-and-pages bot commented May 7, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 09fa682
Status: ✅  Deploy successful!
Preview URL: https://df71be3c.vald.pages.dev
Branch Preview URL: https://feature-agent-rust-implement.vald.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 41c002c and 75afe44.
Files ignored due to path filters (1)
  • rust/Cargo.lock is excluded by !**/*.lock
Files selected for processing (12)
  • rust/bin/agent/Cargo.toml (1 hunks)
  • rust/bin/agent/src/handler.rs (1 hunks)
  • rust/bin/agent/src/handler/common.rs (1 hunks)
  • rust/bin/agent/src/handler/index.rs (1 hunks)
  • rust/bin/agent/src/handler/insert.rs (1 hunks)
  • rust/bin/agent/src/handler/remove.rs (1 hunks)
  • rust/bin/agent/src/handler/search.rs (1 hunks)
  • rust/bin/agent/src/handler/update.rs (1 hunks)
  • rust/bin/agent/src/handler/upsert.rs (1 hunks)
  • rust/bin/agent/src/main.rs (1 hunks)
  • rust/libs/proto/Cargo.toml (1 hunks)
  • rust/libs/proto/src/lib.rs (1 hunks)
Files skipped from review as they are similar to previous changes (12)
  • rust/bin/agent/Cargo.toml
  • rust/bin/agent/src/handler.rs
  • rust/bin/agent/src/handler/common.rs
  • rust/bin/agent/src/handler/index.rs
  • rust/bin/agent/src/handler/insert.rs
  • rust/bin/agent/src/handler/remove.rs
  • rust/bin/agent/src/handler/search.rs
  • rust/bin/agent/src/handler/update.rs
  • rust/bin/agent/src/handler/upsert.rs
  • rust/bin/agent/src/main.rs
  • rust/libs/proto/Cargo.toml
  • rust/libs/proto/src/lib.rs

coderabbitai[bot]
coderabbitai bot previously approved these changes May 7, 2024
@kmrmt kmrmt requested review from a team, kpango and hlts2 and removed request for a team May 7, 2024 04:31
@github-actions github-actions bot added size/XL and removed size/L labels May 7, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 75afe44 and 55e681e.
Files selected for processing (8)
  • rust/bin/agent/src/handler.rs (1 hunks)
  • rust/bin/agent/src/handler/common.rs (1 hunks)
  • rust/bin/agent/src/handler/index.rs (1 hunks)
  • rust/bin/agent/src/handler/insert.rs (1 hunks)
  • rust/bin/agent/src/handler/remove.rs (1 hunks)
  • rust/bin/agent/src/handler/search.rs (1 hunks)
  • rust/bin/agent/src/handler/update.rs (1 hunks)
  • rust/bin/agent/src/handler/upsert.rs (1 hunks)
Files skipped from review as they are similar to previous changes (7)
  • rust/bin/agent/src/handler.rs
  • rust/bin/agent/src/handler/common.rs
  • rust/bin/agent/src/handler/index.rs
  • rust/bin/agent/src/handler/insert.rs
  • rust/bin/agent/src/handler/remove.rs
  • rust/bin/agent/src/handler/update.rs
  • rust/bin/agent/src/handler/upsert.rs
Additional comments not posted (12)
rust/bin/agent/src/handler/search.rs (12)

20-25: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the search method.


28-33: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the search_by_id method.


38-44: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the stream_search method.


49-55: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the stream_search_by_id method.


57-63: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the multi_search method.


65-71: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the multi_search_by_id method.


73-79: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the linear_search method.


81-87: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the linear_search_by_id method.


92-98: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the stream_linear_search method.


103-110: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the stream_linear_search_by_id method.


112-118: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the multi_linear_search method.


120-126: Placeholder implementation detected.

Ensure that there is a tracking issue or detailed TODO comment for implementing the multi_linear_search_by_id method.

coderabbitai[bot]
coderabbitai bot previously approved these changes May 7, 2024
@kmrmt kmrmt force-pushed the feature/agent/rust/implement-grpc-server branch from 55e681e to 61f68f3 Compare May 8, 2024 07:24
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 6d4b505 and 61f68f3.
Files ignored due to path filters (1)
  • rust/Cargo.lock is excluded by !**/*.lock
Files selected for processing (12)
  • rust/bin/agent/Cargo.toml (1 hunks)
  • rust/bin/agent/src/handler.rs (1 hunks)
  • rust/bin/agent/src/handler/common.rs (1 hunks)
  • rust/bin/agent/src/handler/index.rs (1 hunks)
  • rust/bin/agent/src/handler/insert.rs (1 hunks)
  • rust/bin/agent/src/handler/remove.rs (1 hunks)
  • rust/bin/agent/src/handler/search.rs (1 hunks)
  • rust/bin/agent/src/handler/update.rs (1 hunks)
  • rust/bin/agent/src/handler/upsert.rs (1 hunks)
  • rust/bin/agent/src/main.rs (1 hunks)
  • rust/libs/proto/Cargo.toml (1 hunks)
  • rust/libs/proto/src/lib.rs (1 hunks)
Files skipped from review as they are similar to previous changes (12)
  • rust/bin/agent/Cargo.toml
  • rust/bin/agent/src/handler.rs
  • rust/bin/agent/src/handler/common.rs
  • rust/bin/agent/src/handler/index.rs
  • rust/bin/agent/src/handler/insert.rs
  • rust/bin/agent/src/handler/remove.rs
  • rust/bin/agent/src/handler/search.rs
  • rust/bin/agent/src/handler/update.rs
  • rust/bin/agent/src/handler/upsert.rs
  • rust/bin/agent/src/main.rs
  • rust/libs/proto/Cargo.toml
  • rust/libs/proto/src/lib.rs

Copy link
Collaborator

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

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

Sorry for late review 🙏
LGTM!

@hlts2 hlts2 merged commit 57c9376 into main May 23, 2024
27 checks passed
@hlts2 hlts2 deleted the feature/agent/rust/implement-grpc-server branch May 23, 2024 05:11
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.

4 participants