Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.2.31"
version = "2.2.32"
authors = ["Gaius <gaius.qi@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
324 changes: 169 additions & 155 deletions pkg/apis/common/v2/common.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions pkg/apis/common/v2/common.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/apis/common/v2/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,10 @@ message Download {
optional HuggingFace hugging_face = 31;
// ModelScope protocol information.
optional ModelScope model_scope = 32;
// Hit local cache indicates whether the download hits the local cache completely.
// If hit_local_cache is true, the peer registers with the scheduler only to report
// the metadata of the task, no need to be scheduled for downloading pieces.
bool hit_local_cache = 33;

reserved 21;
reserved "load_to_cache";
Expand Down
3,842 changes: 1,960 additions & 1,882 deletions pkg/apis/scheduler/v2/scheduler.pb.go

Large diffs are not rendered by default.

144 changes: 144 additions & 0 deletions pkg/apis/scheduler/v2/scheduler.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pkg/apis/scheduler/v2/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ message NeedBackToSourceResponse {
}];
}

// HitLocalCacheResponse represents hit local cache response of AnnouncePeerResponse,
// used when the download hits the local cache completely and the peer only reports
// the metadata to the scheduler, no need to be scheduled for downloading pieces.
message HitLocalCacheResponse {}

// AnnouncePeerResponse represents response of AnnouncePeer.
message AnnouncePeerResponse {
oneof response {
Expand All @@ -180,6 +185,7 @@ message AnnouncePeerResponse {
EmptyTaskResponse empty_task_response = 1;
NormalTaskResponse normal_task_response = 2;
NeedBackToSourceResponse need_back_to_source_response = 3;
HitLocalCacheResponse hit_local_cache_response = 4;
}
}

Expand Down
4 changes: 4 additions & 0 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,10 @@ message Download {
optional HuggingFace hugging_face = 31;
// ModelScope protocol information.
optional ModelScope model_scope = 32;
// Hit local cache indicates whether the download hits the local cache completely.
// If hit_local_cache is true, the peer registers with the scheduler only to report
// the metadata of the task, no need to be scheduled for downloading pieces.
bool hit_local_cache = 33;

reserved 21;
reserved "load_to_cache";
Expand Down
6 changes: 6 additions & 0 deletions proto/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,18 @@ message NeedBackToSourceResponse {
optional string description = 1;
}

// HitLocalCacheResponse represents hit local cache response of AnnouncePeerResponse,
// used when the download hits the local cache completely and the peer only reports
// the metadata to the scheduler, no need to be scheduled for downloading pieces.
message HitLocalCacheResponse {}

// AnnouncePeerResponse represents response of AnnouncePeer.
message AnnouncePeerResponse {
oneof response {
EmptyTaskResponse empty_task_response = 1;
NormalTaskResponse normal_task_response = 2;
NeedBackToSourceResponse need_back_to_source_response = 3;
HitLocalCacheResponse hit_local_cache_response = 4;
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/common.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,11 @@ pub struct Download {
/// ModelScope protocol information.
#[prost(message, optional, tag = "32")]
pub model_scope: ::core::option::Option<ModelScope>,
/// Hit local cache indicates whether the download hits the local cache completely.
/// If hit_local_cache is true, the peer registers with the scheduler only to report
/// the metadata of the task, no need to be scheduled for downloading pieces.
#[prost(bool, tag = "33")]
pub hit_local_cache: bool,
}
/// Object Storage related information.
#[derive(serde::Serialize, serde::Deserialize)]
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.
10 changes: 9 additions & 1 deletion src/scheduler.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,17 @@ pub struct NeedBackToSourceResponse {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
/// HitLocalCacheResponse represents hit local cache response of AnnouncePeerResponse,
/// used when the download hits the local cache completely and the peer only reports
/// the metadata to the scheduler, no need to be scheduled for downloading pieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HitLocalCacheResponse {}
/// AnnouncePeerResponse represents response of AnnouncePeer.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnouncePeerResponse {
#[prost(oneof = "announce_peer_response::Response", tags = "1, 2, 3")]
#[prost(oneof = "announce_peer_response::Response", tags = "1, 2, 3, 4")]
pub response: ::core::option::Option<announce_peer_response::Response>,
}
/// Nested message and enum types in `AnnouncePeerResponse`.
Expand All @@ -209,6 +215,8 @@ pub mod announce_peer_response {
NormalTaskResponse(super::NormalTaskResponse),
#[prost(message, tag = "3")]
NeedBackToSourceResponse(super::NeedBackToSourceResponse),
#[prost(message, tag = "4")]
HitLocalCacheResponse(super::HitLocalCacheResponse),
}
}
/// StatPeerRequest represents request of StatPeer.
Expand Down
Loading