feat(spider-grpc): Add gRPC protocol for storage; Add gRPC clients in execution manager and scheduler.#340
feat(spider-grpc): Add gRPC protocol for storage; Add gRPC clients in execution manager and scheduler.#340sitaowang1998 wants to merge 12 commits into
Conversation
|
Warning Review limit reached
More reviews will be available in 51 minutes. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR expands storage protobufs with job/resource-group/liveness APIs, adds protobuf↔core conversions for JobState and TaskId, implements a GrpcLivenessClient and updates execution-manager storage adapters to TaskInstance types, and introduces GrpcSchedulerStorageClient plus scheduler crate wiring and dependency updates. ChangesExecution Manager Liveness and Job Management APIs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/spider-proto/storage/storage.proto (1)
1-352: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy liftAdd comprehensive documentation to the proto API.
The proto file defines multiple public gRPC services and complex message structures but contains zero documentation comments. For a cross-component API contract, comprehensive documentation is essential to ensure maintainability, enable safe evolution, and support developer onboarding.
Please add proto comments documenting:
- Each service's purpose and usage context
- Each RPC's behaviour, preconditions, and error scenarios
- Message field semantics, constraints, and valid ranges
- Error code meanings and client handling expectations
- The JobState enum transitions and their lifecycle implications
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/spider-proto/storage/storage.proto` around lines 1 - 352, The proto file lacks any documentation; add clear proto comments for all public symbols: each service (JobManagementService, TaskInstanceManagementService, SchedulerStorageService, ResourceGroupManagementService, ExecutionManagerLivenessService, SessionManagementService) describing purpose and usage; each RPC (e.g., SubmitJob, StartJob, PollReadyTasks, RegisterTaskInstance, ReportTaskSuccess, AddResourceGroup, RegisterExecutionManager, GetSession) explaining input preconditions, side effects, success/failure semantics and typical error scenarios; each message and important fields (SubmitJobRequest.serialized_task_graph, ReadyTask.task_id, RegisterTaskInstanceRequest.execution_manager_id, etc.) documenting field semantics, valid ranges and constraints; all error messages (JobManagementError.ErrCode, TaskInstanceError.ErrCode, SchedulerStorageError.ErrCode, ResourceGroupError.ErrCode, ExecutionManagerLivenessError.ErrCode) describing when each code is returned and recommended client handling; and the JobState enum documenting legal state transitions (e.g., READY -> RUNNING -> COMMIT_READY/CLEANUP_READY -> SUCCEEDED/FAILED/CANCELLED) and lifecycle implications. Keep comments concise, use proto // or /** */ comments above definitions so they are included in generated docs and ensure examples or notes for session_id and storage_session consistency where relevant.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@components/spider-proto/storage/storage.proto`:
- Around line 1-352: The proto file lacks any documentation; add clear proto
comments for all public symbols: each service (JobManagementService,
TaskInstanceManagementService, SchedulerStorageService,
ResourceGroupManagementService, ExecutionManagerLivenessService,
SessionManagementService) describing purpose and usage; each RPC (e.g.,
SubmitJob, StartJob, PollReadyTasks, RegisterTaskInstance, ReportTaskSuccess,
AddResourceGroup, RegisterExecutionManager, GetSession) explaining input
preconditions, side effects, success/failure semantics and typical error
scenarios; each message and important fields
(SubmitJobRequest.serialized_task_graph, ReadyTask.task_id,
RegisterTaskInstanceRequest.execution_manager_id, etc.) documenting field
semantics, valid ranges and constraints; all error messages
(JobManagementError.ErrCode, TaskInstanceError.ErrCode,
SchedulerStorageError.ErrCode, ResourceGroupError.ErrCode,
ExecutionManagerLivenessError.ErrCode) describing when each code is returned and
recommended client handling; and the JobState enum documenting legal state
transitions (e.g., READY -> RUNNING -> COMMIT_READY/CLEANUP_READY ->
SUCCEEDED/FAILED/CANCELLED) and lifecycle implications. Keep comments concise,
use proto // or /** */ comments above definitions so they are included in
generated docs and ensure examples or notes for session_id and storage_session
consistency where relevant.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a9894bac-13ee-4fdd-8177-6fede9a84856
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockcomponents/spider-proto-rust/src/generated/storage.rsis excluded by!**/generated/**
📒 Files selected for processing (8)
components/spider-execution-manager/src/client/grpc/liveness.rscomponents/spider-execution-manager/src/client/grpc/storage.rscomponents/spider-proto/storage/storage.protocomponents/spider-scheduler/Cargo.tomlcomponents/spider-scheduler/src/error.rscomponents/spider-scheduler/src/grpc/mod.rscomponents/spider-scheduler/src/grpc/storage_client.rscomponents/spider-scheduler/src/lib.rs
✅ Files skipped from review due to trivial changes (2)
- components/spider-scheduler/Cargo.toml
- components/spider-scheduler/src/grpc/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- components/spider-execution-manager/src/client/grpc/liveness.rs
Description
This PR:
spider-core.Checklist
breaking change.
Validation performed
Summary by CodeRabbit