Repository navigation
feat(spider-storage): Add gRPC service implementation: #364
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
Merged
LinZhihao-723
merged 34 commits into
y-scope:main
from
sitaowang1998:storage-grpc-services
Jul 5, 2026
Merged
Changes from 24 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
27c0701
Migrate storage gRPC error codes to tonic::Status
sitaowang1998 00c3196
Implement the missing storage gRPC services
sitaowang1998 b41f226
Refactor ready-task builder to take a task-id closure instead of a trait
sitaowang1998 a1ee868
Merge branch 'main' into storage-grpc-migration
sitaowang1998 b4fece6
Merge storage-grpc-migration (with main #342) into storage-grpc-services
sitaowang1998 b98b085
Rename map_inbound_status to inbound_status_to_error to match main's …
sitaowang1998 b241c34
Rename map_inbound_status and map_liveness_status to match main's sta…
sitaowang1998 ff31980
Merge storage-grpc-migration (status_to_error rename) into storage-gr…
sitaowang1998 429fdbb
Merge branch 'storage-grpc-migration' of github.com:sitaowang1998/spi…
sitaowang1998 25fc42d
Merge origin/main into storage-grpc-migration
sitaowang1998 72b1021
Merge storage-grpc-migration (with main #358) into storage-grpc-services
sitaowang1998 c84d324
Update proto.
LinZhihao-723 9c2f88f
Merge origin/main (tonic 0.14 bump) into storage-grpc-migration
sitaowang1998 2cf1432
Merge storage-grpc-migration (tonic 0.14 + common.Void responses) int…
sitaowang1998 896eef6
Remove session id 0 check
sitaowang1998 c137a3b
Map inbound queue closed to internal error
sitaowang1998 0bba7ae
Merge branch 'storage-grpc-migration' into storage-grpc-services
sitaowang1998 2aa8d8e
Map inbound queue closed to internal error on the server
sitaowang1998 925219a
Merge origin/main into storage-grpc-services
sitaowang1998 3ec8e32
Fix build_ready_tasks docstring to reference actual lane marker types
sitaowang1998 a0c8513
Merge branch 'main' into storage-grpc-services
sitaowang1998 dbf7c7d
Merge branch 'main' into storage-grpc-services
sitaowang1998 2fee410
Merge branch 'main' into storage-grpc-services
sitaowang1998 bf84e09
Merge branch 'main' into storage-grpc-services
sitaowang1998 8a379bb
Fix logging
sitaowang1998 74e467f
Fix docstring
sitaowang1998 7a6f42d
Remove test
sitaowang1998 edcb47f
Check off .
LinZhihao-723 d943a94
Add a flag to control whether to fail the service in .
LinZhihao-723 8fc265d
Done with this PR.
LinZhihao-723 923c820
Done.
LinZhihao-723 10555b0
Make comments consistent.
LinZhihao-723 019e168
Revert comments.
LinZhihao-723 c170cc2
Revert mod visibility.
LinZhihao-723 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
components/spider-proto-rust/src/scheduler_registration.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| //! Conversions between protobuf scheduler messages and their Spider core representations. | ||
|
|
||
| use spider_core::types::scheduler::RegisteredScheduler; | ||
|
|
||
| use crate::storage; | ||
|
|
||
| impl From<RegisteredScheduler> for storage::Scheduler { | ||
| fn from(scheduler: RegisteredScheduler) -> Self { | ||
| Self { | ||
| scheduler_id: scheduler.id.get(), | ||
| ip_address: scheduler.ip_address.to_string(), | ||
| port: u32::from(scheduler.port), | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use std::net::IpAddr; | ||
|
|
||
| use spider_core::types::{id::SchedulerId, scheduler::RegisteredScheduler}; | ||
|
|
||
| use crate::storage; | ||
|
|
||
| #[test] | ||
| fn registered_scheduler_to_protocol_carries_id_ip_and_port() { | ||
| const SCHEDULER_ID: SchedulerId = SchedulerId::from(42); | ||
| const PORT: u16 = 5678; | ||
|
|
||
| let scheduler = storage::Scheduler::from(RegisteredScheduler { | ||
| id: SCHEDULER_ID, | ||
| ip_address: IpAddr::V4("127.0.0.1".parse().expect("valid IP")), | ||
| port: PORT, | ||
| }); | ||
|
|
||
| assert_eq!(scheduler.scheduler_id, SCHEDULER_ID.get()); | ||
| assert_eq!(scheduler.ip_address, "127.0.0.1"); | ||
| assert_eq!(scheduler.port, u32::from(PORT)); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: y-scope/spider
Length of output: 14237
🏁 Script executed:
Repository: y-scope/spider
Length of output: 3589
🏁 Script executed:
Repository: y-scope/spider
Length of output: 4969
🏁 Script executed:
Repository: y-scope/spider
Length of output: 8046
Reject port
0in scheduler registration.The unpacker only checks that the value fits in
u16, so0still reaches storage and gets advertised back unchanged. If0is not intended by the protocol, returnINVALID_ARGUMENThere.🤖 Prompt for AI Agents