Skip to content

feat(spider-grpc): Add gRPC protocol for storage; Add gRPC liveness client in execution manager.#340

Open
sitaowang1998 wants to merge 6 commits into
y-scope:mainfrom
sitaowang1998:grpc-job
Open

feat(spider-grpc): Add gRPC protocol for storage; Add gRPC liveness client in execution manager.#340
sitaowang1998 wants to merge 6 commits into
y-scope:mainfrom
sitaowang1998:grpc-job

Conversation

@sitaowang1998

@sitaowang1998 sitaowang1998 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR:

  • Adds remaining gRPC protocol for storage interface.
  • Adds task id and job state conversion between gRPC and spider-core.
  • Adds gRPC liveness client that implements execution manager's client interface.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • GitHub workflows pass.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added job management capabilities including job submission, state tracking, output retrieval, and cancellation
    • Added resource group management services for creation, verification, and removal
    • Added execution manager health monitoring with registration, heartbeat tracking, and liveliness checks
    • Added session management functionality for retrieving session information

@sitaowang1998 sitaowang1998 requested a review from a team as a code owner June 10, 2026 17:08
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9adae00d-57ad-45b3-ae33-ab72f46502a4

📥 Commits

Reviewing files that changed from the base of the PR and between 93d3394 and abd22d4.

⛔ Files ignored due to path filters (1)
  • components/spider-proto-rust/src/generated/storage.rs is excluded by !**/generated/**
📒 Files selected for processing (7)
  • components/spider-execution-manager/src/client.rs
  • components/spider-execution-manager/src/client/grpc/liveness.rs
  • components/spider-execution-manager/src/client/grpc/mod.rs
  • components/spider-proto-rust/src/id.rs
  • components/spider-proto-rust/src/job.rs
  • components/spider-proto-rust/src/lib.rs
  • components/spider-proto/storage/storage.proto

Walkthrough

This PR expands the Spider storage API with gRPC services for job management, resource groups, and execution-manager liveness. It introduces type conversions between core and protobuf representations, implements a concrete GrpcLivenessClient wrapping the protobuf service, and re-exports the new types through the module hierarchy.

Changes

Execution Manager Liveness and Job Management APIs

Layer / File(s) Summary
Proto API definitions for job, resource group, and liveness services
components/spider-proto/storage/storage.proto
JobManagementService, ResourceGroupManagementService, ExecutionManagerLivenessService, and SessionManagementService are defined with their RPCs and request/response messages. JobState enum captures lifecycle states (Unspecified, Ready, Running, CommitReady, CleanupReady, Succeeded, Failed, Cancelled).
Type conversions between core and protobuf JobState and TaskId
components/spider-proto-rust/src/job.rs, components/spider-proto-rust/src/id.rs, components/spider-proto-rust/src/lib.rs
From and TryFromstorage::JobState implement bidirectional jobstate mapping; TryFromstorage::TaskId converts protobuf TaskId variants to core types. Tests validate successful conversions and rejection of Unspecified/missing-kind inputs.
GrpcLivenessClient implementation with response conversions
components/spider-execution-manager/src/client/grpc/liveness.rs
GrpcLivenessClient wraps tonic's ExecutionManagerLivenessServiceClient; connect creates a client from an endpoint; LivenessClient trait methods (register, heartbeat) call protobuf RPCs and convert responses via register_response_to_result, heartbeat_response_to_result, and storage_error_to_liveness_error helpers. Tests cover conversions and error mapping.
Module declarations and public re-exports
components/spider-execution-manager/src/client/grpc/mod.rs, components/spider-execution-manager/src/client.rs
Adds liveness submodule and re-exports GrpcLivenessClient; updates client.rs to publicly re-export both GrpcLivenessClient and GrpcStorageClient from grpc module.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • y-scope/spider#327: Defines the LivenessClient trait and associated types (RegistrationResponse, SessionId) that the concrete GrpcLivenessClient implementation in this PR fulfils.
  • y-scope/spider#329: Uses the GrpcLivenessClient implementation added in this PR during Runtime::create and liveness refresh via a generic LivenessClient hook.
  • y-scope/spider#333: Establishes the gRPC module and GrpcStorageClient re-export pattern that this PR extends with GrpcLivenessClient.

Suggested reviewers

  • LinZhihao-723
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding gRPC protocol definitions for storage and implementing a gRPC liveness client in the execution manager.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant