Compare commits

..

No commits in common. "main" and "v2.0.123" have entirely different histories.

79 changed files with 45444 additions and 29371 deletions

View File

@ -18,9 +18,10 @@ jobs:
fetch-depth: '0'
- name: Golangci lint
uses: golangci/golangci-lint-action@v8
uses: golangci/golangci-lint-action@v6
with:
version: v2.1.6
version: v1.54
args: --verbose
rust-lint:
name: Rust Lint

View File

@ -1,53 +1,37 @@
version: "2"
run:
deadline: 3m
modules-download-mode: readonly
linters:
default: none
enable:
- errcheck
- goconst
- gocyclo
- govet
- misspell
- staticcheck
settings:
gocyclo:
min-complexity: 60
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- staticcheck
text: 'SA1019:'
paths:
- third_party$
- builtin$
- examples$
linters-settings:
gocyclo:
min-complexity: 60
gci:
sections:
- standard
- default
issues:
new: true
formatters:
exclude-rules:
- linters:
- staticcheck
text: "SA1019:"
linters:
disable-all: true
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- golint
- misspell
- govet
- goconst
- deadcode
- gocyclo
- staticcheck
- errcheck
output:
formats:
text:
path: stdout
print-linter-name: true
print-issued-lines: true
format: colored-line-number
print-issued-lines: true
print-linter-name: true

751
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.1.61"
version = "2.0.123"
authors = ["Gaius <gaius.qi@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
@ -11,12 +11,12 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tonic = "0.12.3"
prost = "0.13.5"
prost-types = "0.14.1"
tokio = { version = "1.47.1", features = ["rt-multi-thread", "macros"] }
tonic = "0.9.2"
prost = "0.11.9"
prost-types = "0.12.6"
tokio = { version = "1.38.0", features = ["rt-multi-thread", "macros"] }
serde = { version = "1.0", features = ["derive"] }
prost-wkt-types = "0.6"
prost-wkt-types = "0.4"
[build-dependencies]
tonic-build = "0.12.1"
tonic-build = "0.9.2"

View File

@ -17,7 +17,7 @@ all: help
# Run code lint
lint: markdownlint
@echo "Begin to golangci-lint."
@./hack/golanglint.sh
@golangci-lint run
.PHONY: lint
# Run markdown lint

View File

@ -1,6 +1,6 @@
# api
[![Discussions](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square)](https://github.com/dragonflyoss/dragonfly/discussions)
[![Discussions](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square)](https://github.com/dragonflyoss/Dragonfly2/discussions)
[![LICENSE](https://img.shields.io/github/license/dragonflyoss/api.svg?style=flat-square)](https://github.com/dragonflyoss/api/blob/main/LICENSE)
Canonical location of the Dragonfly API definition.
@ -9,24 +9,24 @@ The project includes the api definitions of dragonfly services and the mocks of
## Note to developers
If developers need to change dragonfly api definition,
please contact [dragonfly maintainers](https://github.com/dragonflyoss/dragonfly/blob/main/MAINTAINERS.md).
please contact [dragonfly maintainers](https://github.com/dragonflyoss/Dragonfly2/blob/main/MAINTAINERS.md).
## Community
Join the conversation and help the community.
- **Slack Channel**: [#dragonfly](https://cloud-native.slack.com/messages/dragonfly/) on [CNCF Slack](https://slack.cncf.io/)
- **Github Discussions**: [Dragonfly Discussion Forum](https://github.com/dragonflyoss/dragonfly/discussions)
- **Discussion Group**: <dragonfly-discuss@googlegroups.com>
- **Developer Group**: <dragonfly-developers@googlegroups.com>
- **Maintainer Group**: <dragonfly-maintainers@googlegroups.com>
- **Github Discussions**: [Dragonfly Discussion Forum](https://github.com/dragonflyoss/Dragonfly2/discussions)
- **Twitter**: [@dragonfly_oss](https://twitter.com/dragonfly_oss)
- **DingTalk**: [22880028764](https://qr.dingtalk.com/action/joingroup?code=v1,k1,pkV9IbsSyDusFQdByPSK3HfCG61ZCLeb8b/lpQ3uUqI=&_dt_no_comment=1&origin=11)
## Contributing
You should check out our
[CONTRIBUTING](https://github.com/dragonflyoss/dragonfly/blob/main/CONTRIBUTING.md) and develop the project together.
[CONTRIBUTING](https://github.com/dragonflyoss/Dragonfly2/blob/main/CONTRIBUTING.md) and develop the project together.
## Code of Conduct
Please refer to our [Code of Conduct](https://github.com/dragonflyoss/dragonfly/blob/main/CODE_OF_CONDUCT.md).
Please refer to our [Code of Conduct](https://github.com/dragonflyoss/Dragonfly2/blob/main/CODE_OF_CONDUCT.md).

View File

@ -3,14 +3,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.file_descriptor_set_path("src/descriptor.bin")
.protoc_arg("--experimental_allow_proto3_optional")
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.type_attribute(
"scheduler.v2.AnnouncePeerRequest.request",
"#[allow(clippy::large_enum_variant)]",
)
.type_attribute(
"scheduler.v2.AnnounceCachePeerRequest.request",
"#[allow(clippy::large_enum_variant)]",
)
.extern_path(".google.protobuf.Timestamp", "::prost_wkt_types::Timestamp")
.extern_path(".google.protobuf.Duration", "::prost_wkt_types::Duration")
.out_dir("src")
@ -18,6 +10,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
&[
"proto/common.proto",
"proto/errordetails.proto",
"proto/security.proto",
"proto/dfdaemon.proto",
"proto/manager.proto",
"proto/scheduler.proto",

18
go.mod
View File

@ -1,17 +1,17 @@
module d7y.io/api/v2
go 1.23.8
go 1.21
require (
github.com/envoyproxy/protoc-gen-validate v1.2.1
go.uber.org/mock v0.5.2
google.golang.org/grpc v1.74.2
google.golang.org/protobuf v1.36.7
github.com/envoyproxy/protoc-gen-validate v1.0.4
go.uber.org/mock v0.4.0
google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.2
)
require (
golang.org/x/net v0.40.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.25.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
)

56
go.sum
View File

@ -1,38 +1,18 @@
github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8=
github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs=
go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY=
go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis=
go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4=
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4=
google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM=
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=
github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=

View File

@ -1,11 +0,0 @@
#!/bin/bash
LINT_DIR=/data
GOLANGCI_IMAGE=golangci/golangci-lint:v1.54
docker run --rm \
-w "${LINT_DIR}" \
-v "$(pwd):${LINT_DIR}:ro" \
${GOLANGCI_IMAGE} \
golangci-lint \
run -v

View File

@ -5,7 +5,8 @@ PROTO_PATH=pkg/apis
LANGUAGE=go
proto_modules="common/v1 common/v2 cdnsystem/v1 dfdaemon/v1 dfdaemon/v2
errordetails/v1 errordetails/v2 manager/v1 manager/v2 scheduler/v1 scheduler/v2"
errordetails/v1 errordetails/v2 manager/v1 manager/v2 scheduler/v1 scheduler/v2
security/v1 trainer/v1 inference"
echo "generate protos..."

View File

@ -5,7 +5,6 @@
//
// mockgen -destination cdnsystem_mock.go -source ../cdnsystem_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -24,7 +23,6 @@ import (
type MockSeederClient struct {
ctrl *gomock.Controller
recorder *MockSeederClientMockRecorder
isgomock struct{}
}
// MockSeederClientMockRecorder is the mock recorder for MockSeederClient.
@ -108,7 +106,6 @@ func (mr *MockSeederClientMockRecorder) SyncPieceTasks(ctx any, opts ...any) *go
type MockSeeder_ObtainSeedsClient struct {
ctrl *gomock.Controller
recorder *MockSeeder_ObtainSeedsClientMockRecorder
isgomock struct{}
}
// MockSeeder_ObtainSeedsClientMockRecorder is the mock recorder for MockSeeder_ObtainSeedsClient.
@ -232,7 +229,6 @@ func (mr *MockSeeder_ObtainSeedsClientMockRecorder) Trailer() *gomock.Call {
type MockSeeder_SyncPieceTasksClient struct {
ctrl *gomock.Controller
recorder *MockSeeder_SyncPieceTasksClientMockRecorder
isgomock struct{}
}
// MockSeeder_SyncPieceTasksClientMockRecorder is the mock recorder for MockSeeder_SyncPieceTasksClient.
@ -370,7 +366,6 @@ func (mr *MockSeeder_SyncPieceTasksClientMockRecorder) Trailer() *gomock.Call {
type MockSeederServer struct {
ctrl *gomock.Controller
recorder *MockSeederServerMockRecorder
isgomock struct{}
}
// MockSeederServerMockRecorder is the mock recorder for MockSeederServer.
@ -437,7 +432,6 @@ func (mr *MockSeederServerMockRecorder) SyncPieceTasks(arg0 any) *gomock.Call {
type MockUnsafeSeederServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeSeederServerMockRecorder
isgomock struct{}
}
// MockUnsafeSeederServerMockRecorder is the mock recorder for MockUnsafeSeederServer.
@ -473,7 +467,6 @@ func (mr *MockUnsafeSeederServerMockRecorder) mustEmbedUnimplementedSeederServer
type MockSeeder_ObtainSeedsServer struct {
ctrl *gomock.Controller
recorder *MockSeeder_ObtainSeedsServerMockRecorder
isgomock struct{}
}
// MockSeeder_ObtainSeedsServerMockRecorder is the mock recorder for MockSeeder_ObtainSeedsServer.
@ -593,7 +586,6 @@ func (mr *MockSeeder_ObtainSeedsServerMockRecorder) SetTrailer(arg0 any) *gomock
type MockSeeder_SyncPieceTasksServer struct {
ctrl *gomock.Controller
recorder *MockSeeder_SyncPieceTasksServerMockRecorder
isgomock struct{}
}
// MockSeeder_SyncPieceTasksServerMockRecorder is the mock recorder for MockSeeder_SyncPieceTasksServer.

View File

@ -963,8 +963,6 @@ type Host struct {
Location string `protobuf:"bytes,7,opt,name=location,proto3" json:"location,omitempty"`
// IDC where the peer host is located.
Idc string `protobuf:"bytes,8,opt,name=idc,proto3" json:"idc,omitempty"`
// Port of proxy server.
ProxyPort int32 `protobuf:"varint,9,opt,name=proxy_port,json=proxyPort,proto3" json:"proxy_port,omitempty"`
}
func (x *Host) Reset() {
@ -1048,13 +1046,6 @@ func (x *Host) GetIdc() string {
return ""
}
func (x *Host) GetProxyPort() int32 {
if x != nil {
return x.ProxyPort
}
return 0
}
var File_pkg_apis_common_v1_common_proto protoreflect.FileDescriptor
var file_pkg_apis_common_v1_common_proto_rawDesc = []byte{
@ -1161,7 +1152,7 @@ var file_pkg_apis_common_v1_common_proto_rawDesc = []byte{
0x6e, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0f, 0x65, 0x78, 0x74,
0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0xa5, 0x02, 0x0a,
0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0xf8, 0x01, 0x0a,
0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72,
@ -1177,74 +1168,71 @@ var file_pkg_apis_common_v1_common_proto_rawDesc = []byte{
0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52,
0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x03, 0x69, 0x64, 0x63,
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0,
0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x2b, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x78, 0x79,
0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09,
0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x78, 0x79,
0x50, 0x6f, 0x72, 0x74, 0x2a, 0xd9, 0x05, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x11, 0x0a,
0x0d, 0x58, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
0x12, 0x0c, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0xc8, 0x01, 0x12, 0x16,
0x0a, 0x11, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61,
0x62, 0x6c, 0x65, 0x10, 0xf4, 0x03, 0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x4c, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xe8, 0x07, 0x12, 0x18, 0x0a, 0x13, 0x42,
0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x62, 0x6f, 0x72, 0x74,
0x65, 0x64, 0x10, 0xe9, 0x07, 0x12, 0x0f, 0x0a, 0x0a, 0x42, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61,
0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xfc, 0x0a, 0x12, 0x11, 0x0a,
0x0c, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xdc, 0x0b,
0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4f,
0x75, 0x74, 0x10, 0xe0, 0x0b, 0x12, 0x10, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45,
0x72, 0x72, 0x6f, 0x72, 0x10, 0xa0, 0x1f, 0x12, 0x1b, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x61, 0x69,
0x6c, 0x10, 0xa1, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x10, 0xa2, 0x1f,
0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
0x74, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0xa3, 0x1f, 0x12, 0x19, 0x0a, 0x14,
0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x57, 0x61, 0x69, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52,
0x65, 0x61, 0x64, 0x79, 0x10, 0xa4, 0x1f, 0x12, 0x1c, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x46, 0x61,
0x69, 0x6c, 0x10, 0xa5, 0x1f, 0x12, 0x1b, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x10,
0xa6, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa7, 0x1f, 0x12, 0x1a,
0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa8, 0x1f, 0x12, 0x18, 0x0a, 0x13, 0x43, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e,
0x64, 0x10, 0xb4, 0x22, 0x12, 0x0f, 0x0a, 0x0a, 0x53, 0x63, 0x68, 0x65, 0x64, 0x45, 0x72, 0x72,
0x6f, 0x72, 0x10, 0x88, 0x27, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65, 0x64, 0x4e, 0x65,
0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x10, 0x89, 0x27, 0x12,
0x12, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x47, 0x6f, 0x6e, 0x65,
0x10, 0x8a, 0x27, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72,
0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x8c, 0x27, 0x12, 0x23, 0x0a, 0x1e, 0x53,
0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x10, 0x8d, 0x27,
0x12, 0x19, 0x0a, 0x14, 0x53, 0x63, 0x68, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x8e, 0x27, 0x12, 0x14, 0x0a, 0x0f, 0x53,
0x63, 0x68, 0x65, 0x64, 0x52, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x10, 0x8f,
0x27, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64,
0x64, 0x65, 0x6e, 0x10, 0x90, 0x27, 0x12, 0x18, 0x0a, 0x13, 0x43, 0x44, 0x4e, 0x54, 0x61, 0x73,
0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x46, 0x61, 0x69, 0x6c, 0x10, 0xf1, 0x2e,
0x12, 0x14, 0x0a, 0x0f, 0x43, 0x44, 0x4e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f,
0x75, 0x6e, 0x64, 0x10, 0x84, 0x32, 0x12, 0x18, 0x0a, 0x13, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x10, 0xd9, 0x36,
0x2a, 0x17, 0x0a, 0x0a, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x09,
0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x00, 0x2a, 0x43, 0x0a, 0x09, 0x53, 0x69, 0x7a,
0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c,
0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4d, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a,
0x04, 0x54, 0x49, 0x4e, 0x59, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59,
0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x10, 0x04, 0x2a, 0x30,
0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f,
0x72, 0x6d, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x43, 0x61, 0x63, 0x68,
0x65, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x10, 0x02,
0x2a, 0x5e, 0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06,
0x4c, 0x45, 0x56, 0x45, 0x4c, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45,
0x4c, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x32, 0x10, 0x02,
0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x33, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06,
0x4c, 0x45, 0x56, 0x45, 0x4c, 0x34, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45,
0x4c, 0x35, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x36, 0x10, 0x06,
0x42, 0x29, 0x5a, 0x27, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x2a, 0xd9, 0x05, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65,
0x12, 0x11, 0x0a, 0x0d, 0x58, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0xc8,
0x01, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x6e, 0x61, 0x76, 0x61,
0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x10, 0xf4, 0x03, 0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xe8, 0x07, 0x12, 0x18,
0x0a, 0x13, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x62,
0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xe9, 0x07, 0x12, 0x0f, 0x0a, 0x0a, 0x42, 0x61, 0x64, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x65, 0x65,
0x72, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xfc, 0x0a,
0x12, 0x11, 0x0a, 0x0c, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72,
0x10, 0xdc, 0x0b, 0x12, 0x13, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69,
0x6d, 0x65, 0x4f, 0x75, 0x74, 0x10, 0xe0, 0x0b, 0x12, 0x10, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa0, 0x1f, 0x12, 0x1b, 0x0a, 0x16, 0x43, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x46, 0x61, 0x69, 0x6c, 0x10, 0xa1, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x10, 0xa2, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x78, 0x74, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x10, 0xa3, 0x1f, 0x12,
0x19, 0x0a, 0x14, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x57, 0x61, 0x69, 0x74, 0x50, 0x69, 0x65,
0x63, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, 0x10, 0xa4, 0x1f, 0x12, 0x1c, 0x0a, 0x17, 0x43, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
0x64, 0x46, 0x61, 0x69, 0x6c, 0x10, 0xa5, 0x1f, 0x12, 0x1b, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x46, 0x61,
0x69, 0x6c, 0x10, 0xa6, 0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43,
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa7,
0x1f, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0xa8, 0x1f, 0x12, 0x18, 0x0a,
0x13, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x6f, 0x74, 0x46,
0x6f, 0x75, 0x6e, 0x64, 0x10, 0xb4, 0x22, 0x12, 0x0f, 0x0a, 0x0a, 0x53, 0x63, 0x68, 0x65, 0x64,
0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x88, 0x27, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65,
0x64, 0x4e, 0x65, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x10,
0x89, 0x27, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x47,
0x6f, 0x6e, 0x65, 0x10, 0x8a, 0x27, 0x12, 0x16, 0x0a, 0x11, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50,
0x65, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x8c, 0x27, 0x12, 0x23,
0x0a, 0x1e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x50, 0x69, 0x65, 0x63, 0x65,
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x61, 0x69, 0x6c,
0x10, 0x8d, 0x27, 0x12, 0x19, 0x0a, 0x14, 0x53, 0x63, 0x68, 0x65, 0x64, 0x54, 0x61, 0x73, 0x6b,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x8e, 0x27, 0x12, 0x14,
0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x52, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x72, 0x10, 0x8f, 0x27, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x46, 0x6f, 0x72,
0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x10, 0x90, 0x27, 0x12, 0x18, 0x0a, 0x13, 0x43, 0x44, 0x4e,
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x46, 0x61, 0x69, 0x6c,
0x10, 0xf1, 0x2e, 0x12, 0x14, 0x0a, 0x0f, 0x43, 0x44, 0x4e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f,
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0x84, 0x32, 0x12, 0x18, 0x0a, 0x13, 0x49, 0x6e, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x10, 0xd9, 0x36, 0x2a, 0x17, 0x0a, 0x0a, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c,
0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x00, 0x2a, 0x43, 0x0a, 0x09,
0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52,
0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4d, 0x41, 0x4c, 0x4c, 0x10, 0x01,
0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4e, 0x59, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d,
0x50, 0x54, 0x59, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x10,
0x04, 0x2a, 0x30, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a,
0x06, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x43,
0x61, 0x63, 0x68, 0x65, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x66, 0x53, 0x74, 0x6f, 0x72,
0x65, 0x10, 0x02, 0x2a, 0x5e, 0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12,
0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c,
0x45, 0x56, 0x45, 0x4c, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c,
0x32, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x33, 0x10, 0x03, 0x12,
0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x34, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4c,
0x45, 0x56, 0x45, 0x4c, 0x35, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c,
0x36, 0x10, 0x06, 0x42, 0x29, 0x5a, 0x27, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1013,17 +1013,6 @@ func (m *Host) validate(all bool) error {
}
if val := m.GetProxyPort(); val < 1024 || val >= 65535 {
err := HostValidationError{
field: "ProxyPort",
reason: "value must be inside range [1024, 65535)",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return HostMultiError(errors)
}

View File

@ -57,7 +57,7 @@ enum Code {
// Scheduler response error 5000-5999.
SchedError = 5000;
// Client should try to download from source.
SchedNeedBackSource = 5001;
SchedNeedBackSource = 5001;
// Client should disconnect from scheduler.
SchedPeerGone = 5002;
// Peer not found in scheduler.
@ -245,6 +245,4 @@ message Host {
string location = 7 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// IDC where the peer host is located.
string idc = 8 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Port of proxy server.
int32 proxy_port = 9 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -44,31 +44,18 @@ enum SizeScope {
// TaskType represents type of task.
enum TaskType {
// STANDARD is standard type of task, it can download from source, remote peer and
// local peer(local cache). When the standard task is never downloaded in the
// P2P cluster, dfdaemon will download the task from the source. When the standard
// task is downloaded in the P2P cluster, dfdaemon will download the task from
// the remote peer or local peer(local cache), where peers use disk storage to store tasks.
STANDARD = 0;
// DFDAEMON is dfdeamon type of task,
// dfdeamon task is a normal p2p task.
DFDAEMON = 0;
// PERSISTENT is persistent type of task, it can import file and export file in P2P cluster.
// When the persistent task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to
// prevent data loss.
PERSISTENT = 1;
// DFCACHE is dfcache type of task,
// dfcache task is a cache task, and the task url is fake url.
// It can only be used for caching and cannot be downloaded back to source.
DFCACHE = 1;
// PERSISTENT_CACHE is persistent cache type of task, it can import file and export file in P2P cluster.
// When the persistent cache task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to prevent data loss.
// When the expiration time is reached, task will be deleted in the P2P cluster.
PERSISTENT_CACHE = 2;
// CACHE is cache type of task, it can download from source, remote peer and
// local peer(local cache). When the cache task is never downloaded in the
// P2P cluster, dfdaemon will download the cache task from the source. When the cache
// task is downloaded in the P2P cluster, dfdaemon will download the cache task from
// the remote peer or local peer(local cache), where peers use memory storage to store cache tasks.
CACHE = 3;
// DFSTORE is dfstore type of task,
// dfstore task is a persistent task in backend.
DFSTORE = 2;
}
// TrafficType represents type of traffic.
@ -149,43 +136,16 @@ message Peer {
message CachePeer {
// Peer id.
string id = 1 [(validate.rules).string.min_len = 1];
// Range is url range of request.
optional Range range = 2;
// Peer priority.
Priority priority = 3 [(validate.rules).enum.defined_only = true];
// Pieces of peer.
repeated Piece pieces = 4 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Peer downloads costs time.
google.protobuf.Duration cost = 5 [(validate.rules).duration.required = true];
// Peer state.
string state = 6 [(validate.rules).string.min_len = 1];
// CacheTask info.
CacheTask task = 7 [(validate.rules).message.required = true];
// Host info.
Host host = 8 [(validate.rules).message.required = true];
// NeedBackToSource needs downloaded from source.
bool need_back_to_source = 9;
// Peer create time.
google.protobuf.Timestamp created_at = 10 [(validate.rules).timestamp.required = true];
// Peer update time.
google.protobuf.Timestamp updated_at = 11 [(validate.rules).timestamp.required = true];
}
// PersistentCachePeer metadata.
message PersistentCachePeer {
// Peer id.
string id = 1 [(validate.rules).string.min_len = 1];
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
// Persistent represents whether the cache peer is persistent.
// If the cache peer is persistent, the cache peer will
// not be deleted when dfdamon runs garbage collection.
bool persistent = 2;
// Peer downloads costs time.
google.protobuf.Duration cost = 3 [(validate.rules).duration.required = true];
// Peer state.
string state = 4 [(validate.rules).string.min_len = 1];
// Task info.
PersistentCacheTask task = 5 [(validate.rules).message.required = true];
CacheTask task = 5 [(validate.rules).message.required = true];
// Host info.
Host host = 6 [(validate.rules).message.required = true];
// Peer create time.
@ -202,13 +162,8 @@ message Task {
TaskType type = 2 [(validate.rules).enum.defined_only = true];
// Download url.
string url = 3 [(validate.rules).string.uri = true];
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64})$", ignore_empty: true}];
// URL tag identifies different task for same url.
optional string tag = 5;
// Application of task.
@ -221,106 +176,54 @@ message Task {
repeated string filtered_query_params = 7;
// Task request headers.
map<string, string> request_header = 8;
// Task piece length.
uint64 piece_length = 9 [(validate.rules).uint64.gte = 1];
// Task content length.
uint64 content_length = 9;
uint64 content_length = 10;
// Task piece count.
uint32 piece_count = 10;
uint32 piece_count = 11;
// Task size scope.
SizeScope size_scope = 11;
SizeScope size_scope = 12;
// Pieces of task.
repeated Piece pieces = 12 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
repeated Piece pieces = 13 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Task state.
string state = 13 [(validate.rules).string.min_len = 1];
string state = 14 [(validate.rules).string.min_len = 1];
// Task peer count.
uint32 peer_count = 14;
uint32 peer_count = 15;
// Task contains available peer.
bool has_available_peer = 15;
bool has_available_peer = 16;
// Task create time.
google.protobuf.Timestamp created_at = 16 [(validate.rules).timestamp.required = true];
google.protobuf.Timestamp created_at = 17 [(validate.rules).timestamp.required = true];
// Task update time.
google.protobuf.Timestamp updated_at = 17 [(validate.rules).timestamp.required = true];
google.protobuf.Timestamp updated_at = 18 [(validate.rules).timestamp.required = true];
}
// CacheTask metadata.
message CacheTask {
// Task id.
string id = 1 [(validate.rules).string.min_len = 1];
// Task type.
TaskType type = 2 [(validate.rules).enum.defined_only = true];
// Download url.
string url = 3 [(validate.rules).string.uri = true];
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// URL tag identifies different task for same url.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 7;
// Task request headers.
map<string, string> request_header = 8;
// Task content length.
uint64 content_length = 9;
// Task piece count.
uint32 piece_count = 10;
// Task size scope.
SizeScope size_scope = 11;
// Pieces of task.
repeated Piece pieces = 12 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
// Task state.
string state = 13 [(validate.rules).string.min_len = 1];
// Task peer count.
uint32 peer_count = 14;
// Task contains available peer.
bool has_available_peer = 15;
// Task create time.
google.protobuf.Timestamp created_at = 16 [(validate.rules).timestamp.required = true];
// Task update time.
google.protobuf.Timestamp updated_at = 17 [(validate.rules).timestamp.required = true];
}
// PersistentCacheTask metadata.
message PersistentCacheTask {
// Task id.
string id = 1 [(validate.rules).string.min_len = 1];
// Replica count of the persistent cache task. The persistent cache task will
// not be deleted when dfdamon runs garbage collection. It only be deleted
// when the task is deleted by the user.
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 2 [(validate.rules).uint64.gte = 1];
// Current replica count of the persistent cache task. The persistent cache task
// will not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 current_persistent_replica_count = 3;
// Current replica count of the cache task. If cache task is not persistent,
// the persistent cache task will be deleted when dfdaemon runs garbage collection.
uint64 current_replica_count = 4;
// Tag is used to distinguish different persistent cache tasks.
// Replica count of the cache task.
uint64 replica_count = 3 [(validate.rules).uint64.gte = 1];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64})$"}];
// Tag is used to distinguish different cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Task piece length.
uint64 piece_length = 7 [(validate.rules).uint64 = {gte: 4194304, lte: 67108864}];
uint64 piece_length = 7 [(validate.rules).uint64.gte = 1];
// Task content length.
uint64 content_length = 8;
// Task piece count.
uint32 piece_count = 9;
// Task state.
string state = 10 [(validate.rules).string.min_len = 1];
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 11 [(validate.rules).duration.required = true];
// Task create time.
google.protobuf.Timestamp created_at = 12 [(validate.rules).timestamp.required = true];
google.protobuf.Timestamp created_at = 11 [(validate.rules).timestamp.required = true];
// Task update time.
google.protobuf.Timestamp updated_at = 13 [(validate.rules).timestamp.required = true];
google.protobuf.Timestamp updated_at = 12 [(validate.rules).timestamp.required = true];
}
// Host metadata.
@ -359,10 +262,6 @@ message Host {
optional Build build = 16;
// ID of the cluster to which the host belongs.
uint64 scheduler_cluster_id = 17;
// Disable shared data for other peers.
bool disable_shared = 18;
// Port of proxy server.
int32 proxy_port = 19;
}
// CPU Stat.
@ -430,23 +329,6 @@ message Network {
optional string location = 3;
// IDC where the peer host is located
optional string idc = 4;
// Maximum bandwidth of the network interface, in bps (bits per second).
uint64 max_rx_bandwidth = 9;
// Receive bandwidth of the network interface, in bps (bits per second).
optional uint64 rx_bandwidth = 10;
// Maximum bandwidth of the network interface for transmission, in bps (bits per second).
uint64 max_tx_bandwidth = 11;
// Transmit bandwidth of the network interface, in bps (bits per second).
optional uint64 tx_bandwidth = 12;
reserved 5;
reserved "download_rate";
reserved 6;
reserved "download_rate_limit";
reserved 7;
reserved "upload_rate";
reserved 8;
reserved "upload_rate_limit";
}
// Disk Stat.
@ -467,10 +349,6 @@ message Disk {
uint64 inodes_free = 7;
// Used percent of indoes on the data path of dragonfly directory.
double inodes_used_percent = 8 [(validate.rules).double = {gte: 0, lte: 100}];
// Disk read bandwidth, in bytes per second.
uint64 read_bandwidth = 9;
// Disk write bandwidth, in bytes per second.
uint64 write_bandwidth = 10;
}
// Build information.
@ -492,7 +370,7 @@ message Download {
// Download url.
string url = 1 [(validate.rules).string.uri = true];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64})$", ignore_empty: true}];
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
@ -513,74 +391,20 @@ message Download {
repeated string filtered_query_params = 8;
// Task request headers.
map<string, string> request_header = 9;
// Piece Length is the piece length(bytes) for downloading file. The value needs to
// be greater than 4MiB (4,194,304 bytes) and less than 64MiB (67,108,864 bytes),
// for example: 4194304(4mib), 8388608(8mib). If the piece length is not specified,
// the piece length will be calculated according to the file size.
optional uint64 piece_length = 10 [(validate.rules).uint64 = {gte: 4194304, lte: 67108864, ignore_empty: true}];
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
// Task piece length.
uint64 piece_length = 10 [(validate.rules).uint64.gte = 1];
// File path to be exported.
optional string output_path = 11 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
// Dfdaemon will disable download back-to-source by itself, if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
// Scheduler will triggers peer to download back-to-source, if need_back_to_source is true.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
// prefetch pre-downloads all pieces of the task when download task with range request.
bool prefetch = 16;
// Object storage protocol information.
optional ObjectStorage object_storage = 17;
// HDFS protocol information.
optional HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// force_hard_link is the flag to indicate whether the download file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 22;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 23;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 24 [(validate.rules).string = {ip: true, ignore_empty: true}];
reserved 21;
reserved "load_to_cache";
}
// Object Storage related information.
message ObjectStorage {
// Region is the region of the object storage service.
optional string region = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Endpoint is the endpoint of the object storage service.
optional string endpoint = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Access key that used to access the object storage service.
optional string access_key_id = 3 [(validate.rules).string.min_len = 1];
// Access secret that used to access the object storage service.
optional string access_key_secret = 4 [(validate.rules).string.min_len = 1];
// Session token that used to access s3 storage service.
optional string session_token = 5 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Local path to credential file for Google Cloud Storage service OAuth2 authentication.
optional string credential_path = 6 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Predefined ACL that used for the Google Cloud Storage service.
optional string predefined_acl = 7 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Temporary STS security token for accessing OSS.
optional string security_token = 8 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// HDFS related information.
message HDFS {
// Delegation token for Web HDFS operator.
optional string delegation_token = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// Range represents download range.
@ -602,7 +426,7 @@ message Piece {
// Piece length.
uint64 length = 4;
// Digest of the piece data, for example blake3:xxx or sha256:yyy.
string digest = 5 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
string digest = 5 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64})$", ignore_empty: true}];
// Piece content.
optional bytes content = 6 [(validate.rules).bytes = {min_len: 1, ignore_empty: true}];
// Traffic type.

View File

@ -5,7 +5,6 @@
//
// mockgen -destination dfdaemon_mock.go -source ../dfdaemon_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -25,7 +24,6 @@ import (
type MockDaemonClient struct {
ctrl *gomock.Controller
recorder *MockDaemonClientMockRecorder
isgomock struct{}
}
// MockDaemonClientMockRecorder is the mock recorder for MockDaemonClient.
@ -249,7 +247,6 @@ func (mr *MockDaemonClientMockRecorder) SyncPieceTasks(ctx any, opts ...any) *go
type MockDaemon_DownloadClient struct {
ctrl *gomock.Controller
recorder *MockDaemon_DownloadClientMockRecorder
isgomock struct{}
}
// MockDaemon_DownloadClientMockRecorder is the mock recorder for MockDaemon_DownloadClient.
@ -373,7 +370,6 @@ func (mr *MockDaemon_DownloadClientMockRecorder) Trailer() *gomock.Call {
type MockDaemon_SyncPieceTasksClient struct {
ctrl *gomock.Controller
recorder *MockDaemon_SyncPieceTasksClientMockRecorder
isgomock struct{}
}
// MockDaemon_SyncPieceTasksClientMockRecorder is the mock recorder for MockDaemon_SyncPieceTasksClient.
@ -511,7 +507,6 @@ func (mr *MockDaemon_SyncPieceTasksClientMockRecorder) Trailer() *gomock.Call {
type MockDaemon_PeerExchangeClient struct {
ctrl *gomock.Controller
recorder *MockDaemon_PeerExchangeClientMockRecorder
isgomock struct{}
}
// MockDaemon_PeerExchangeClientMockRecorder is the mock recorder for MockDaemon_PeerExchangeClient.
@ -649,7 +644,6 @@ func (mr *MockDaemon_PeerExchangeClientMockRecorder) Trailer() *gomock.Call {
type MockDaemonServer struct {
ctrl *gomock.Controller
recorder *MockDaemonServerMockRecorder
isgomock struct{}
}
// MockDaemonServerMockRecorder is the mock recorder for MockDaemonServer.
@ -820,7 +814,6 @@ func (mr *MockDaemonServerMockRecorder) SyncPieceTasks(arg0 any) *gomock.Call {
type MockUnsafeDaemonServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeDaemonServerMockRecorder
isgomock struct{}
}
// MockUnsafeDaemonServerMockRecorder is the mock recorder for MockUnsafeDaemonServer.
@ -856,7 +849,6 @@ func (mr *MockUnsafeDaemonServerMockRecorder) mustEmbedUnimplementedDaemonServer
type MockDaemon_DownloadServer struct {
ctrl *gomock.Controller
recorder *MockDaemon_DownloadServerMockRecorder
isgomock struct{}
}
// MockDaemon_DownloadServerMockRecorder is the mock recorder for MockDaemon_DownloadServer.
@ -976,7 +968,6 @@ func (mr *MockDaemon_DownloadServerMockRecorder) SetTrailer(arg0 any) *gomock.Ca
type MockDaemon_SyncPieceTasksServer struct {
ctrl *gomock.Controller
recorder *MockDaemon_SyncPieceTasksServerMockRecorder
isgomock struct{}
}
// MockDaemon_SyncPieceTasksServerMockRecorder is the mock recorder for MockDaemon_SyncPieceTasksServer.
@ -1111,7 +1102,6 @@ func (mr *MockDaemon_SyncPieceTasksServerMockRecorder) SetTrailer(arg0 any) *gom
type MockDaemon_PeerExchangeServer struct {
ctrl *gomock.Controller
recorder *MockDaemon_PeerExchangeServerMockRecorder
isgomock struct{}
}
// MockDaemon_PeerExchangeServerMockRecorder is the mock recorder for MockDaemon_PeerExchangeServer.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -46,9 +46,6 @@ message DownloadTaskStartedResponse {
// Need to download pieces.
repeated common.v2.Piece pieces = 4;
// is_finished indicates whether the download task is finished.
bool is_finished = 5;
}
// DownloadPieceFinishedResponse represents piece download finished response of DownloadTaskResponse.
@ -108,153 +105,46 @@ message DownloadPieceRequest{
message DownloadPieceResponse {
// Piece information.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
}
// UploadTaskRequest represents request of UploadTask.
message UploadTaskRequest {
// Task metadata.
common.v2.Task task = 1 [(validate.rules).message.required = true];
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
// local_only specifies whether to query task information from local client only.
// If true, the query will be restricted to the local client.
// By default (false), the query may be forwarded to the scheduler
// for a cluster-wide search.
bool local_only = 3;
}
// ListTaskEntriesRequest represents request of ListTaskEntries.
message ListTaskEntriesRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// URL to be listed the entries.
string url = 2;
// HTTP header to be sent with the request.
map<string, string> request_header = 3;
// List timeout.
optional google.protobuf.Duration timeout = 4;
// certificate_chain is the client certs with DER format for the backend client to list the entries.
repeated bytes certificate_chain = 5;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 6;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 7;
// Remote IP represents the IP address of the client initiating the list request.
optional string remote_ip = 8 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// ListTaskEntriesResponse represents response of ListTaskEntries.
message ListTaskEntriesResponse {
// Content length is the content length of the response
uint64 content_length = 1;
// HTTP header to be sent with the request.
map<string, string> response_header = 2;
// Backend HTTP status code.
optional int32 status_code = 3 [(validate.rules).int32 = {gte: 100, lt: 599, ignore_empty: true}];
/// Entries is the information of the entries in the directory.
repeated Entry entries = 4;
}
// Entry represents an entry in a directory.
message Entry {
// URL of the entry.
string url = 1;
// Size of the entry.
uint64 content_length = 2;
// Is directory or not.
bool is_dir = 3;
}
// DeleteTaskRequest represents request of DeleteTask.
message DeleteTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DownloadCacheTaskRequest represents request of DownloadCacheTask.
message DownloadCacheTaskRequest {
// Download url.
string url = 1 [(validate.rules).string.uri = true];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
optional common.v2.Range range = 3;
// Task type.
common.v2.TaskType type = 4 [(validate.rules).enum.defined_only = true];
// URL tag identifies different task for same url.
optional string tag = 5;
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Tag is used to distinguish different cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 6;
// Peer priority.
common.v2.Priority priority = 7 [(validate.rules).enum.defined_only = true];
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 8;
// Task request headers.
map<string, string> request_header = 9;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB).
optional uint64 piece_length = 10 [(validate.rules).uint64 = {gte: 4194304, ignore_empty: true}];
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 11 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
optional string application = 4;
// Task piece length.
uint64 piece_length = 5 [(validate.rules).uint64.gte = 1];
// File path to be exported.
string output_path = 6 [(validate.rules).string.min_len = 1];
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
bool prefetch = 16;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 17;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 21;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 22 [(validate.rules).string = {ip: true, ignore_empty: true}];
optional google.protobuf.Duration timeout = 7;
}
// DownloadCacheTaskStartedResponse represents cache task download started response of DownloadCacheTaskResponse.
message DownloadCacheTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
// Range is url range of request. If protocol is http, range
// is parsed from http header. If other protocol, range comes
// from download range field.
optional common.v2.Range range = 2;
// Task response headers.
map<string, string> response_header = 3;
// Need to download pieces.
repeated common.v2.Piece pieces = 4;
// is_finished indicates whether the download task is finished.
bool is_finished = 5;
}
// DownloadCacheTaskStartedResponse represents task download started response of DownloadCacheTaskResponse.
message DownloadCacheTaskStartedResponse {}
// DownloadCacheTaskResponse represents response of DownloadCacheTask.
message DownloadCacheTaskResponse {
@ -273,242 +163,34 @@ message DownloadCacheTaskResponse {
}
}
// SyncCachePiecesRequest represents request of SyncCachePieces.
message SyncCachePiecesRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Interested piece numbers.
repeated uint32 interested_cache_piece_numbers = 3 [(validate.rules).repeated = {min_items: 1}];
}
// SyncCachePiecesResponse represents response of SyncCachePieces.
message SyncCachePiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
}
// DownloadCachePieceRequest represents request of DownloadCachePiece.
message DownloadCachePieceRequest{
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Piece number.
uint32 piece_number = 3;
}
// DownloadCachePieceResponse represents response of DownloadCachePieces.
message DownloadCachePieceResponse {
// Piece information.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// UploadCacheTaskRequest represents request of UploadCacheTask.
message UploadCacheTaskRequest {
// Upload file path of cache task.
string path = 1 [(validate.rules).string = {min_len: 1}];
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 2 [(validate.rules).uint64.gte = 1];
// Tag is used to distinguish different cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 4;
// Task piece length.
uint64 piece_length = 5 [(validate.rules).uint64.gte = 1];
// TTL of the cache task.
google.protobuf.Duration ttl = 6 [(validate.rules).duration = {gte:{seconds: 60}, lte:{seconds: 604800}}];
// Upload timeout.
optional google.protobuf.Duration timeout = 7;
}
// StatCacheTaskRequest represents request of StatCacheTask.
message StatCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
// local_only specifies whether to query task information from local client only.
// If true, the query will be restricted to the local client.
// By default (false), the query may be forwarded to the scheduler
// for a cluster-wide search.
bool local_only = 3;
}
// DeleteCacheTaskRequest represents request of DeleteCacheTask.
message DeleteCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DownloadPersistentCacheTaskRequest represents request of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 2;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 4;
// File path to be exported. If output_path is set, the exported file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the export. If hard link creation fails,
// it will copy the file to the output path after the export is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 5 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download timeout.
optional google.protobuf.Duration timeout = 6;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 7;
// force_hard_link is the flag to indicate whether the exported file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 8;
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 9;
// Remote IP represents the IP address of the client initiating the download request.
optional string remote_ip = 10 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DownloadPersistentCacheTaskStartedResponse represents task download started response of DownloadPersistentCacheTaskResponse.
message DownloadPersistentCacheTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
}
// DownloadPersistentCacheTaskResponse represents response of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskResponse {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
oneof response {
option (validate.required) = true;
DownloadPersistentCacheTaskStartedResponse download_persistent_cache_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
}
}
// UploadPersistentCacheTaskRequest represents request of UploadPersistentCacheTask.
message UploadPersistentCacheTaskRequest {
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on the file content, tag and application by crc32 algorithm`.
optional string content_for_calculating_task_id = 1;
// Upload file path of persistent cache task.
string path = 2 [(validate.rules).string = {min_len: 1}];
// Replica count of the persistent persistent cache task.
uint64 persistent_replica_count = 3 [(validate.rules).uint64 = {gte: 1, lte: 5}];
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 4;
// Application of the persistent cache task.
optional string application = 5;
// Piece length of the persistent cache task, the value needs to be greater than or equal to 4194304(4MiB).
optional uint64 piece_length = 6 [(validate.rules).uint64 = {gte: 4194304, ignore_empty: true}];
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 7 [(validate.rules).duration = {gte:{seconds: 60}, lte:{seconds: 604800}}];
// Download timeout.
optional google.protobuf.Duration timeout = 8;
// Remote IP represents the IP address of the client initiating the upload request.
optional string remote_ip = 9 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// UpdatePersistentCacheTaskRequest represents request of UpdatePersistentCacheTask.
message UpdatePersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Remote IP represents the IP address of the client initiating the update request.
optional string remote_ip = 3 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2 [(validate.rules).string = {ip: true, ignore_empty: true}];
}
// SyncPersistentCachePiecesRequest represents request of SyncPersistentCachePieces.
message SyncPersistentCachePiecesRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Interested piece numbers.
repeated uint32 interested_piece_numbers = 3 [(validate.rules).repeated = {min_items: 1}];
}
// SyncPersistentCachePiecesResponse represents response of SyncPersistentCachePieces.
message SyncPersistentCachePiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
}
// DownloadPersistentCachePieceRequest represents request of DownloadPersistentCachePiece.
message DownloadPersistentCachePieceRequest{
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Piece number.
uint32 piece_number = 3;
}
// DownloadPersistentCachePieceResponse represents response of DownloadPersistentCachePieces.
message DownloadPersistentCachePieceResponse {
// Piece information.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
}
// SyncHostRequest represents request of SyncHost.
message SyncHostRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 2 [(validate.rules).string.min_len = 1];
}
// IBVerbsQueuePairEndpoint represents queue pair endpoint of IBVerbs.
message IBVerbsQueuePairEndpoint {
// Number of the queue pair.
uint32 num = 1;
// Local identifier of the context.
uint32 lid = 2;
// Global identifier of the context.
bytes gid = 3 [(validate.rules).bytes.len = 16];
}
// ExchangeIBVerbsQueuePairEndpointRequest represents request of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointRequest {
// Information of the source's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1 [(validate.rules).message.required = true];
}
// ExchangeIBVerbsQueuePairEndpointResponse represents response of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointResponse {
// Information of the destination's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1 [(validate.rules).message.required = true];
}
// DfdaemonUpload represents dfdaemon upload service.
@ -516,12 +198,6 @@ service DfdaemonUpload {
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// SyncPieces syncs piece metadatas from remote peer.
rpc SyncPieces(SyncPiecesRequest) returns(stream SyncPiecesResponse);
@ -536,36 +212,6 @@ service DfdaemonUpload {
// DeleteCacheTask deletes cache task from p2p network.
rpc DeleteCacheTask(DeleteCacheTaskRequest) returns(google.protobuf.Empty);
// SyncCachePieces syncs cache piece metadatas from remote peer.
rpc SyncCachePieces(SyncCachePiecesRequest) returns(stream SyncCachePiecesResponse);
// DownloadCachePiece downloads cache piece from the remote peer.
rpc DownloadCachePiece(DownloadCachePieceRequest)returns(DownloadCachePieceResponse);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
rpc UpdatePersistentCacheTask(UpdatePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask deletes persistent cache task from p2p network.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
rpc SyncPersistentCachePieces(SyncPersistentCachePiecesRequest) returns(stream SyncPersistentCachePiecesResponse);
// DownloadPersistentCachePiece downloads persistent cache piece from the remote peer.
rpc DownloadPersistentCachePiece(DownloadPersistentCachePieceRequest)returns(DownloadPersistentCachePieceResponse);
// SyncHost sync host info from parents.
rpc SyncHost(SyncHostRequest) returns (stream common.v2.Host);
// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
rpc ExchangeIBVerbsQueuePairEndpoint(ExchangeIBVerbsQueuePairEndpointRequest) returns(ExchangeIBVerbsQueuePairEndpointResponse);
}
// DfdaemonDownload represents dfdaemon download service.
@ -573,12 +219,12 @@ service DfdaemonDownload {
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// UploadTask uploads task to p2p network.
rpc UploadTask(UploadTaskRequest) returns(google.protobuf.Empty);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
// ListTaskEntries lists task entries for downloading directory.
rpc ListTaskEntries(ListTaskEntriesRequest) returns(ListTaskEntriesResponse);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
@ -588,18 +234,12 @@ service DfdaemonDownload {
// DownloadCacheTask downloads cache task from p2p network.
rpc DownloadCacheTask(DownloadCacheTaskRequest) returns(stream DownloadCacheTaskResponse);
// UploadCacheTask uploads cache task to p2p network.
rpc UploadCacheTask(UploadCacheTaskRequest) returns(common.v2.CacheTask);
// StatCacheTask stats cache task information.
rpc StatCacheTask(StatCacheTaskRequest) returns(common.v2.CacheTask);
// DeleteCacheTask deletes cache task from p2p network.
rpc DeleteCacheTask(DeleteCacheTaskRequest) returns(google.protobuf.Empty);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UploadPersistentCacheTask uploads persistent cache task to p2p network.
rpc UploadPersistentCacheTask(UploadPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ type Backend struct {
// Backend HTTP response header.
Header map[string]string `protobuf:"bytes,2,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Backend HTTP status code.
StatusCode *int32 `protobuf:"varint,3,opt,name=status_code,json=statusCode,proto3,oneof" json:"status_code,omitempty"`
StatusCode int32 `protobuf:"varint,3,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
}
func (x *Backend) Reset() {
@ -97,61 +97,12 @@ func (x *Backend) GetHeader() map[string]string {
}
func (x *Backend) GetStatusCode() int32 {
if x != nil && x.StatusCode != nil {
return *x.StatusCode
if x != nil {
return x.StatusCode
}
return 0
}
// Unknown is error detail for Unknown.
type Unknown struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Unknown error message.
Message *string `protobuf:"bytes,1,opt,name=message,proto3,oneof" json:"message,omitempty"`
}
func (x *Unknown) Reset() {
*x = Unknown{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Unknown) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Unknown) ProtoMessage() {}
func (x *Unknown) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Unknown.ProtoReflect.Descriptor instead.
func (*Unknown) Descriptor() ([]byte, []int) {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{1}
}
func (x *Unknown) GetMessage() string {
if x != nil && x.Message != nil {
return *x.Message
}
return ""
}
var File_pkg_apis_errordetails_v2_errordetails_proto protoreflect.FileDescriptor
var file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc = []byte{
@ -160,28 +111,24 @@ var file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc = []byte{
0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x32, 0x1a, 0x17,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b,
0x65, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a,
0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x32, 0x2e,
0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x73,
0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0b, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xd7, 0x04, 0x28, 0x64, 0x40, 0x01, 0x48, 0x00,
0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x1a,
0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x34, 0x0a, 0x07, 0x55, 0x6e,
0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x42, 0x35, 0x5a, 0x33, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, 0x05, 0x10, 0xd7, 0x04, 0x28, 0x64, 0x52, 0x0a, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64,
0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x42, 0x35, 0x5a, 0x33, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
@ -196,14 +143,13 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP() []byte {
return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescData
}
var file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_pkg_apis_errordetails_v2_errordetails_proto_goTypes = []interface{}{
(*Backend)(nil), // 0: errordetails.v2.Backend
(*Unknown)(nil), // 1: errordetails.v2.Unknown
nil, // 2: errordetails.v2.Backend.HeaderEntry
nil, // 1: errordetails.v2.Backend.HeaderEntry
}
var file_pkg_apis_errordetails_v2_errordetails_proto_depIdxs = []int32{
2, // 0: errordetails.v2.Backend.header:type_name -> errordetails.v2.Backend.HeaderEntry
1, // 0: errordetails.v2.Backend.header:type_name -> errordetails.v2.Backend.HeaderEntry
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@ -229,28 +175,14 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_init() {
return nil
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Unknown); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[0].OneofWrappers = []interface{}{}
file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[1].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -60,23 +60,15 @@ func (m *Backend) validate(all bool) error {
// no validation rules for Header
if m.StatusCode != nil {
if m.GetStatusCode() != 0 {
if val := m.GetStatusCode(); val < 100 || val >= 599 {
err := BackendValidationError{
field: "StatusCode",
reason: "value must be inside range [100, 599)",
}
if !all {
return err
}
errors = append(errors, err)
}
if val := m.GetStatusCode(); val < 100 || val >= 599 {
err := BackendValidationError{
field: "StatusCode",
reason: "value must be inside range [100, 599)",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
@ -155,105 +147,3 @@ var _ interface {
Cause() error
ErrorName() string
} = BackendValidationError{}
// Validate checks the field values on Unknown with the rules defined in the
// proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *Unknown) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on Unknown with the rules defined in the
// proto definition for this message. If any rules are violated, the result is
// a list of violation errors wrapped in UnknownMultiError, or nil if none found.
func (m *Unknown) ValidateAll() error {
return m.validate(true)
}
func (m *Unknown) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if m.Message != nil {
// no validation rules for Message
}
if len(errors) > 0 {
return UnknownMultiError(errors)
}
return nil
}
// UnknownMultiError is an error wrapping multiple validation errors returned
// by Unknown.ValidateAll() if the designated constraints aren't met.
type UnknownMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m UnknownMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m UnknownMultiError) AllErrors() []error { return m }
// UnknownValidationError is the validation error returned by Unknown.Validate
// if the designated constraints aren't met.
type UnknownValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e UnknownValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e UnknownValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e UnknownValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e UnknownValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e UnknownValidationError) ErrorName() string { return "UnknownValidationError" }
// Error satisfies the builtin error interface
func (e UnknownValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sUnknown.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = UnknownValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = UnknownValidationError{}

View File

@ -29,11 +29,6 @@ message Backend {
// Backend HTTP response header.
map<string, string> header = 2;
// Backend HTTP status code.
optional int32 status_code = 3 [(validate.rules).int32 = {gte: 100, lt: 599, ignore_empty: true}];
int32 status_code = 3 [(validate.rules).int32 = {gte: 100, lt: 599}];
}
// Unknown is error detail for Unknown.
message Unknown {
// Unknown error message.
optional string message = 1;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
/*
* Copyright 2023 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package mocks
//go:generate mockgen -destination grpc_service_mock.go -source ../grpc_service_grpc.pb.go -package mocks

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -758,7 +758,7 @@ func (x *SchedulerCluster) GetScopes() []byte {
return nil
}
// Scheduler represents scheduler for network.
// SeedPeerCluster represents scheduler for network.
type Scheduler struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -1903,6 +1903,249 @@ func (x *ListApplicationsResponse) GetApplications() []*Application {
return nil
}
// CreateGNNRequest represents to create GNN model request of TrainRequest.
type CreateGNNRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Protocol buffer file of model.
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// Recall of the model.
Recall float64 `protobuf:"fixed64,2,opt,name=recall,proto3" json:"recall,omitempty"`
// Precision of the model.
Precision float64 `protobuf:"fixed64,3,opt,name=precision,proto3" json:"precision,omitempty"`
// F1-Score of the model.
F1Score float64 `protobuf:"fixed64,4,opt,name=f1_score,json=f1Score,proto3" json:"f1_score,omitempty"`
}
func (x *CreateGNNRequest) Reset() {
*x = CreateGNNRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateGNNRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateGNNRequest) ProtoMessage() {}
func (x *CreateGNNRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateGNNRequest.ProtoReflect.Descriptor instead.
func (*CreateGNNRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_manager_v1_manager_proto_rawDescGZIP(), []int{22}
}
func (x *CreateGNNRequest) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
func (x *CreateGNNRequest) GetRecall() float64 {
if x != nil {
return x.Recall
}
return 0
}
func (x *CreateGNNRequest) GetPrecision() float64 {
if x != nil {
return x.Precision
}
return 0
}
func (x *CreateGNNRequest) GetF1Score() float64 {
if x != nil {
return x.F1Score
}
return 0
}
// CreateMLPRequest represents to create MLP model request of TrainRequest.
type CreateMLPRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Protocol buffer file of model.
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// MSE of the model.
Mse float64 `protobuf:"fixed64,2,opt,name=mse,proto3" json:"mse,omitempty"`
// MAE of the model.
Mae float64 `protobuf:"fixed64,3,opt,name=mae,proto3" json:"mae,omitempty"`
}
func (x *CreateMLPRequest) Reset() {
*x = CreateMLPRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateMLPRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateMLPRequest) ProtoMessage() {}
func (x *CreateMLPRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateMLPRequest.ProtoReflect.Descriptor instead.
func (*CreateMLPRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_manager_v1_manager_proto_rawDescGZIP(), []int{23}
}
func (x *CreateMLPRequest) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
func (x *CreateMLPRequest) GetMse() float64 {
if x != nil {
return x.Mse
}
return 0
}
func (x *CreateMLPRequest) GetMae() float64 {
if x != nil {
return x.Mae
}
return 0
}
// CreateModelRequest represents request of CreateModel.
type CreateModelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Scheduler hostname.
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
// Scheduler ip.
Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
// Types that are assignable to Request:
//
// *CreateModelRequest_CreateGnnRequest
// *CreateModelRequest_CreateMlpRequest
Request isCreateModelRequest_Request `protobuf_oneof:"request"`
}
func (x *CreateModelRequest) Reset() {
*x = CreateModelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateModelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateModelRequest) ProtoMessage() {}
func (x *CreateModelRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[24]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateModelRequest.ProtoReflect.Descriptor instead.
func (*CreateModelRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_manager_v1_manager_proto_rawDescGZIP(), []int{24}
}
func (x *CreateModelRequest) GetHostname() string {
if x != nil {
return x.Hostname
}
return ""
}
func (x *CreateModelRequest) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
func (m *CreateModelRequest) GetRequest() isCreateModelRequest_Request {
if m != nil {
return m.Request
}
return nil
}
func (x *CreateModelRequest) GetCreateGnnRequest() *CreateGNNRequest {
if x, ok := x.GetRequest().(*CreateModelRequest_CreateGnnRequest); ok {
return x.CreateGnnRequest
}
return nil
}
func (x *CreateModelRequest) GetCreateMlpRequest() *CreateMLPRequest {
if x, ok := x.GetRequest().(*CreateModelRequest_CreateMlpRequest); ok {
return x.CreateMlpRequest
}
return nil
}
type isCreateModelRequest_Request interface {
isCreateModelRequest_Request()
}
type CreateModelRequest_CreateGnnRequest struct {
CreateGnnRequest *CreateGNNRequest `protobuf:"bytes,3,opt,name=create_gnn_request,json=createGnnRequest,proto3,oneof"`
}
type CreateModelRequest_CreateMlpRequest struct {
CreateMlpRequest *CreateMLPRequest `protobuf:"bytes,4,opt,name=create_mlp_request,json=createMlpRequest,proto3,oneof"`
}
func (*CreateModelRequest_CreateGnnRequest) isCreateModelRequest_Request() {}
func (*CreateModelRequest_CreateMlpRequest) isCreateModelRequest_Request() {}
// KeepAliveRequest represents request of KeepAlive.
type KeepAliveRequest struct {
state protoimpl.MessageState
@ -1922,7 +2165,7 @@ type KeepAliveRequest struct {
func (x *KeepAliveRequest) Reset() {
*x = KeepAliveRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[22]
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1935,7 +2178,7 @@ func (x *KeepAliveRequest) String() string {
func (*KeepAliveRequest) ProtoMessage() {}
func (x *KeepAliveRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[22]
mi := &file_pkg_apis_manager_v1_manager_proto_msgTypes[25]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1948,7 +2191,7 @@ func (x *KeepAliveRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use KeepAliveRequest.ProtoReflect.Descriptor instead.
func (*KeepAliveRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_manager_v1_manager_proto_rawDescGZIP(), []int{22}
return file_pkg_apis_manager_v1_manager_proto_rawDescGZIP(), []int{25}
}
func (x *KeepAliveRequest) GetSourceType() SourceType {
@ -2270,74 +2513,114 @@ var file_pkg_apis_manager_v1_manager_proto_rawDesc = []byte{
0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x41, 0x70,
0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x10, 0x4b, 0x65, 0x65, 0x70,
0x41, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01,
0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x08,
0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x26, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x09,
0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x70, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x70, 0x01, 0xd0, 0x01,
0x01, 0x52, 0x02, 0x69, 0x70, 0x2a, 0x49, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54,
0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52,
0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x45, 0x45,
0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45,
0x45, 0x44, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02,
0x32, 0xed, 0x05, 0x0a, 0x07, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0b,
0x47, 0x65, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65,
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67,
0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x0d, 0x4c,
0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50,
0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65,
0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1e, 0x2e,
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65,
0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e,
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72,
0x12, 0x40, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72,
0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12,
0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
0x65, 0x72, 0x12, 0x46, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69,
0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a,
0x10, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67,
0x65, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4f,
0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4f, 0x62,
0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x4c,
0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x47, 0x4e, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04,
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a,
0x02, 0x10, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x65, 0x63,
0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12,
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x52, 0x06, 0x72, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x12, 0x35, 0x0a, 0x09, 0x70, 0x72,
0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x42, 0x17, 0xfa,
0x42, 0x14, 0x12, 0x12, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x29, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x32, 0x0a, 0x08, 0x66, 0x31, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x01, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0x3f, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x07, 0x66, 0x31,
0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x73, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d,
0x4c, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74,
0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x10, 0x01,
0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x73, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x52, 0x03, 0x6d, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x61, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x6d, 0x61, 0x65, 0x22, 0xf8, 0x01, 0x0a, 0x12, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x68, 0x6f,
0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12,
0x49, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x67, 0x6e, 0x6e, 0x5f, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x4e, 0x4e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x47, 0x6e, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x12, 0x63, 0x72,
0x65, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x6c, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x4c, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x48, 0x00, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6c, 0x70, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xbb, 0x01, 0x0a, 0x10, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c,
0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x13, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f,
0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42,
0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x26, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x09, 0x63, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x70, 0x01, 0xd0, 0x01, 0x01, 0x52,
0x02, 0x69, 0x70, 0x2a, 0x49, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70,
0x65, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x53,
0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x45, 0x45, 0x52, 0x5f,
0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45, 0x45, 0x44,
0x5f, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x32, 0xb1,
0x06, 0x0a, 0x07, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0b, 0x47, 0x65,
0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
0x2e, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x0d, 0x4c, 0x69, 0x73,
0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65,
0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x65, 0x64,
0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x40,
0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x1c,
0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72,
0x12, 0x46, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x53,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74,
0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x10, 0x47,
0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12,
0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a,
0x65, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4f, 0x62, 0x6a, 0x65,
0x63, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x4c, 0x69, 0x73,
0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x1b, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67,
0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40,
0x0a, 0x09, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x01,
0x42, 0x2b, 0x5a, 0x29, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67,
0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1b, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x65,
0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x12, 0x40, 0x0a, 0x09, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x19, 0x2e,
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x28, 0x01, 0x42, 0x2b, 0x5a, 0x29, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -2353,7 +2636,7 @@ func file_pkg_apis_manager_v1_manager_proto_rawDescGZIP() []byte {
}
var file_pkg_apis_manager_v1_manager_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_pkg_apis_manager_v1_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
var file_pkg_apis_manager_v1_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 27)
var file_pkg_apis_manager_v1_manager_proto_goTypes = []interface{}{
(SourceType)(0), // 0: manager.SourceType
(*SeedPeerCluster)(nil), // 1: manager.SeedPeerCluster
@ -2378,10 +2661,13 @@ var file_pkg_apis_manager_v1_manager_proto_goTypes = []interface{}{
(*Application)(nil), // 20: manager.Application
(*ListApplicationsRequest)(nil), // 21: manager.ListApplicationsRequest
(*ListApplicationsResponse)(nil), // 22: manager.ListApplicationsResponse
(*KeepAliveRequest)(nil), // 23: manager.KeepAliveRequest
nil, // 24: manager.ListSchedulersRequest.HostInfoEntry
(v1.Priority)(0), // 25: common.Priority
(*emptypb.Empty)(nil), // 26: google.protobuf.Empty
(*CreateGNNRequest)(nil), // 23: manager.CreateGNNRequest
(*CreateMLPRequest)(nil), // 24: manager.CreateMLPRequest
(*CreateModelRequest)(nil), // 25: manager.CreateModelRequest
(*KeepAliveRequest)(nil), // 26: manager.KeepAliveRequest
nil, // 27: manager.ListSchedulersRequest.HostInfoEntry
(v1.Priority)(0), // 28: common.Priority
(*emptypb.Empty)(nil), // 29: google.protobuf.Empty
}
var file_pkg_apis_manager_v1_manager_proto_depIdxs = []int32{
1, // 0: manager.SeedPeer.seed_peer_cluster:type_name -> manager.SeedPeerCluster
@ -2395,43 +2681,47 @@ var file_pkg_apis_manager_v1_manager_proto_depIdxs = []int32{
0, // 8: manager.GetSchedulerRequest.source_type:type_name -> manager.SourceType
0, // 9: manager.UpdateSchedulerRequest.source_type:type_name -> manager.SourceType
0, // 10: manager.ListSchedulersRequest.source_type:type_name -> manager.SourceType
24, // 11: manager.ListSchedulersRequest.host_info:type_name -> manager.ListSchedulersRequest.HostInfoEntry
27, // 11: manager.ListSchedulersRequest.host_info:type_name -> manager.ListSchedulersRequest.HostInfoEntry
8, // 12: manager.ListSchedulersResponse.schedulers:type_name -> manager.Scheduler
0, // 13: manager.GetObjectStorageRequest.source_type:type_name -> manager.SourceType
0, // 14: manager.ListBucketsRequest.source_type:type_name -> manager.SourceType
15, // 15: manager.ListBucketsResponse.buckets:type_name -> manager.Bucket
25, // 16: manager.URLPriority.value:type_name -> common.Priority
25, // 17: manager.ApplicationPriority.value:type_name -> common.Priority
28, // 16: manager.URLPriority.value:type_name -> common.Priority
28, // 17: manager.ApplicationPriority.value:type_name -> common.Priority
18, // 18: manager.ApplicationPriority.urls:type_name -> manager.URLPriority
19, // 19: manager.Application.priority:type_name -> manager.ApplicationPriority
0, // 20: manager.ListApplicationsRequest.source_type:type_name -> manager.SourceType
20, // 21: manager.ListApplicationsResponse.applications:type_name -> manager.Application
0, // 22: manager.KeepAliveRequest.source_type:type_name -> manager.SourceType
3, // 23: manager.Manager.GetSeedPeer:input_type -> manager.GetSeedPeerRequest
4, // 24: manager.Manager.ListSeedPeers:input_type -> manager.ListSeedPeersRequest
6, // 25: manager.Manager.UpdateSeedPeer:input_type -> manager.UpdateSeedPeerRequest
9, // 26: manager.Manager.GetScheduler:input_type -> manager.GetSchedulerRequest
10, // 27: manager.Manager.UpdateScheduler:input_type -> manager.UpdateSchedulerRequest
11, // 28: manager.Manager.ListSchedulers:input_type -> manager.ListSchedulersRequest
14, // 29: manager.Manager.GetObjectStorage:input_type -> manager.GetObjectStorageRequest
16, // 30: manager.Manager.ListBuckets:input_type -> manager.ListBucketsRequest
21, // 31: manager.Manager.ListApplications:input_type -> manager.ListApplicationsRequest
23, // 32: manager.Manager.KeepAlive:input_type -> manager.KeepAliveRequest
2, // 33: manager.Manager.GetSeedPeer:output_type -> manager.SeedPeer
5, // 34: manager.Manager.ListSeedPeers:output_type -> manager.ListSeedPeersResponse
2, // 35: manager.Manager.UpdateSeedPeer:output_type -> manager.SeedPeer
8, // 36: manager.Manager.GetScheduler:output_type -> manager.Scheduler
8, // 37: manager.Manager.UpdateScheduler:output_type -> manager.Scheduler
12, // 38: manager.Manager.ListSchedulers:output_type -> manager.ListSchedulersResponse
13, // 39: manager.Manager.GetObjectStorage:output_type -> manager.ObjectStorage
17, // 40: manager.Manager.ListBuckets:output_type -> manager.ListBucketsResponse
22, // 41: manager.Manager.ListApplications:output_type -> manager.ListApplicationsResponse
26, // 42: manager.Manager.KeepAlive:output_type -> google.protobuf.Empty
33, // [33:43] is the sub-list for method output_type
23, // [23:33] is the sub-list for method input_type
23, // [23:23] is the sub-list for extension type_name
23, // [23:23] is the sub-list for extension extendee
0, // [0:23] is the sub-list for field type_name
23, // 22: manager.CreateModelRequest.create_gnn_request:type_name -> manager.CreateGNNRequest
24, // 23: manager.CreateModelRequest.create_mlp_request:type_name -> manager.CreateMLPRequest
0, // 24: manager.KeepAliveRequest.source_type:type_name -> manager.SourceType
3, // 25: manager.Manager.GetSeedPeer:input_type -> manager.GetSeedPeerRequest
4, // 26: manager.Manager.ListSeedPeers:input_type -> manager.ListSeedPeersRequest
6, // 27: manager.Manager.UpdateSeedPeer:input_type -> manager.UpdateSeedPeerRequest
9, // 28: manager.Manager.GetScheduler:input_type -> manager.GetSchedulerRequest
10, // 29: manager.Manager.UpdateScheduler:input_type -> manager.UpdateSchedulerRequest
11, // 30: manager.Manager.ListSchedulers:input_type -> manager.ListSchedulersRequest
14, // 31: manager.Manager.GetObjectStorage:input_type -> manager.GetObjectStorageRequest
16, // 32: manager.Manager.ListBuckets:input_type -> manager.ListBucketsRequest
21, // 33: manager.Manager.ListApplications:input_type -> manager.ListApplicationsRequest
25, // 34: manager.Manager.CreateModel:input_type -> manager.CreateModelRequest
26, // 35: manager.Manager.KeepAlive:input_type -> manager.KeepAliveRequest
2, // 36: manager.Manager.GetSeedPeer:output_type -> manager.SeedPeer
5, // 37: manager.Manager.ListSeedPeers:output_type -> manager.ListSeedPeersResponse
2, // 38: manager.Manager.UpdateSeedPeer:output_type -> manager.SeedPeer
8, // 39: manager.Manager.GetScheduler:output_type -> manager.Scheduler
8, // 40: manager.Manager.UpdateScheduler:output_type -> manager.Scheduler
12, // 41: manager.Manager.ListSchedulers:output_type -> manager.ListSchedulersResponse
13, // 42: manager.Manager.GetObjectStorage:output_type -> manager.ObjectStorage
17, // 43: manager.Manager.ListBuckets:output_type -> manager.ListBucketsResponse
22, // 44: manager.Manager.ListApplications:output_type -> manager.ListApplicationsResponse
29, // 45: manager.Manager.CreateModel:output_type -> google.protobuf.Empty
29, // 46: manager.Manager.KeepAlive:output_type -> google.protobuf.Empty
36, // [36:47] is the sub-list for method output_type
25, // [25:36] is the sub-list for method input_type
25, // [25:25] is the sub-list for extension type_name
25, // [25:25] is the sub-list for extension extendee
0, // [0:25] is the sub-list for field type_name
}
func init() { file_pkg_apis_manager_v1_manager_proto_init() }
@ -2705,6 +2995,42 @@ func file_pkg_apis_manager_v1_manager_proto_init() {
}
}
file_pkg_apis_manager_v1_manager_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateGNNRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_manager_v1_manager_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateMLPRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_manager_v1_manager_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateModelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_manager_v1_manager_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KeepAliveRequest); i {
case 0:
return &v.state
@ -2717,13 +3043,17 @@ func file_pkg_apis_manager_v1_manager_proto_init() {
}
}
}
file_pkg_apis_manager_v1_manager_proto_msgTypes[24].OneofWrappers = []interface{}{
(*CreateModelRequest_CreateGnnRequest)(nil),
(*CreateModelRequest_CreateMlpRequest)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_manager_v1_manager_proto_rawDesc,
NumEnums: 1,
NumMessages: 24,
NumMessages: 27,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -3666,6 +3666,507 @@ var _ interface {
ErrorName() string
} = ListApplicationsResponseValidationError{}
// Validate checks the field values on CreateGNNRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *CreateGNNRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CreateGNNRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CreateGNNRequestMultiError, or nil if none found.
func (m *CreateGNNRequest) ValidateAll() error {
return m.validate(true)
}
func (m *CreateGNNRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetData()) < 1 {
err := CreateGNNRequestValidationError{
field: "Data",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if val := m.GetRecall(); val < 0 || val > 1 {
err := CreateGNNRequestValidationError{
field: "Recall",
reason: "value must be inside range [0, 1]",
}
if !all {
return err
}
errors = append(errors, err)
}
if val := m.GetPrecision(); val < 0 || val > 1 {
err := CreateGNNRequestValidationError{
field: "Precision",
reason: "value must be inside range [0, 1]",
}
if !all {
return err
}
errors = append(errors, err)
}
if val := m.GetF1Score(); val < 0 || val > 1 {
err := CreateGNNRequestValidationError{
field: "F1Score",
reason: "value must be inside range [0, 1]",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CreateGNNRequestMultiError(errors)
}
return nil
}
// CreateGNNRequestMultiError is an error wrapping multiple validation errors
// returned by CreateGNNRequest.ValidateAll() if the designated constraints
// aren't met.
type CreateGNNRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CreateGNNRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CreateGNNRequestMultiError) AllErrors() []error { return m }
// CreateGNNRequestValidationError is the validation error returned by
// CreateGNNRequest.Validate if the designated constraints aren't met.
type CreateGNNRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CreateGNNRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CreateGNNRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CreateGNNRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CreateGNNRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CreateGNNRequestValidationError) ErrorName() string { return "CreateGNNRequestValidationError" }
// Error satisfies the builtin error interface
func (e CreateGNNRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCreateGNNRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CreateGNNRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CreateGNNRequestValidationError{}
// Validate checks the field values on CreateMLPRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *CreateMLPRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CreateMLPRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CreateMLPRequestMultiError, or nil if none found.
func (m *CreateMLPRequest) ValidateAll() error {
return m.validate(true)
}
func (m *CreateMLPRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetData()) < 1 {
err := CreateMLPRequestValidationError{
field: "Data",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetMse() < 0 {
err := CreateMLPRequestValidationError{
field: "Mse",
reason: "value must be greater than or equal to 0",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetMae() < 0 {
err := CreateMLPRequestValidationError{
field: "Mae",
reason: "value must be greater than or equal to 0",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CreateMLPRequestMultiError(errors)
}
return nil
}
// CreateMLPRequestMultiError is an error wrapping multiple validation errors
// returned by CreateMLPRequest.ValidateAll() if the designated constraints
// aren't met.
type CreateMLPRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CreateMLPRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CreateMLPRequestMultiError) AllErrors() []error { return m }
// CreateMLPRequestValidationError is the validation error returned by
// CreateMLPRequest.Validate if the designated constraints aren't met.
type CreateMLPRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CreateMLPRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CreateMLPRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CreateMLPRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CreateMLPRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CreateMLPRequestValidationError) ErrorName() string { return "CreateMLPRequestValidationError" }
// Error satisfies the builtin error interface
func (e CreateMLPRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCreateMLPRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CreateMLPRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CreateMLPRequestValidationError{}
// Validate checks the field values on CreateModelRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *CreateModelRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CreateModelRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CreateModelRequestMultiError, or nil if none found.
func (m *CreateModelRequest) ValidateAll() error {
return m.validate(true)
}
func (m *CreateModelRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetHostname()) < 1 {
err := CreateModelRequestValidationError{
field: "Hostname",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if ip := net.ParseIP(m.GetIp()); ip == nil {
err := CreateModelRequestValidationError{
field: "Ip",
reason: "value must be a valid IP address",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent := false
switch v := m.Request.(type) {
case *CreateModelRequest_CreateGnnRequest:
if v == nil {
err := CreateModelRequestValidationError{
field: "Request",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent = true
if all {
switch v := interface{}(m.GetCreateGnnRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CreateModelRequestValidationError{
field: "CreateGnnRequest",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CreateModelRequestValidationError{
field: "CreateGnnRequest",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetCreateGnnRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CreateModelRequestValidationError{
field: "CreateGnnRequest",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *CreateModelRequest_CreateMlpRequest:
if v == nil {
err := CreateModelRequestValidationError{
field: "Request",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent = true
if all {
switch v := interface{}(m.GetCreateMlpRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, CreateModelRequestValidationError{
field: "CreateMlpRequest",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, CreateModelRequestValidationError{
field: "CreateMlpRequest",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetCreateMlpRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return CreateModelRequestValidationError{
field: "CreateMlpRequest",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
_ = v // ensures v is used
}
if !oneofRequestPresent {
err := CreateModelRequestValidationError{
field: "Request",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CreateModelRequestMultiError(errors)
}
return nil
}
// CreateModelRequestMultiError is an error wrapping multiple validation errors
// returned by CreateModelRequest.ValidateAll() if the designated constraints
// aren't met.
type CreateModelRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CreateModelRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CreateModelRequestMultiError) AllErrors() []error { return m }
// CreateModelRequestValidationError is the validation error returned by
// CreateModelRequest.Validate if the designated constraints aren't met.
type CreateModelRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CreateModelRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CreateModelRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CreateModelRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CreateModelRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CreateModelRequestValidationError) ErrorName() string {
return "CreateModelRequestValidationError"
}
// Error satisfies the builtin error interface
func (e CreateModelRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCreateModelRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CreateModelRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CreateModelRequestValidationError{}
// Validate checks the field values on KeepAliveRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.

View File

@ -148,7 +148,7 @@ message SchedulerCluster {
bytes scopes = 6;
}
// Scheduler represents scheduler for network.
// SeedPeerCluster represents scheduler for network.
message Scheduler {
// Scheduler id.
uint64 id = 1;
@ -333,6 +333,43 @@ message ListApplicationsResponse {
repeated Application applications = 1;
}
// CreateGNNRequest represents to create GNN model request of TrainRequest.
message CreateGNNRequest {
// Protocol buffer file of model.
bytes data = 1 [(validate.rules).bytes.min_len = 1];
// Recall of the model.
double recall = 2 [(validate.rules).double = {gte: 0, lte: 1}];
// Precision of the model.
double precision = 3 [(validate.rules).double = {gte: 0, lte: 1}];
// F1-Score of the model.
double f1_score = 4 [(validate.rules).double = {gte: 0, lte: 1}];
}
// CreateMLPRequest represents to create MLP model request of TrainRequest.
message CreateMLPRequest {
// Protocol buffer file of model.
bytes data = 1 [(validate.rules).bytes.min_len = 1];
// MSE of the model.
double mse = 2 [(validate.rules).double = {gte: 0}];
// MAE of the model.
double mae = 3 [(validate.rules).double = {gte: 0}];
}
// CreateModelRequest represents request of CreateModel.
message CreateModelRequest {
// Scheduler hostname.
string hostname = 1 [(validate.rules).string.min_len = 1];
// Scheduler ip.
string ip = 2 [(validate.rules).string.ip = true];
oneof request {
option (validate.required) = true;
CreateGNNRequest create_gnn_request = 3;
CreateMLPRequest create_mlp_request = 4;
}
}
// KeepAliveRequest represents request of KeepAlive.
message KeepAliveRequest {
// Request source type.
@ -374,6 +411,9 @@ service Manager {
// List applications configuration.
rpc ListApplications(ListApplicationsRequest)returns(ListApplicationsResponse);
// Create model and update data of model to object storage.
rpc CreateModel(CreateModelRequest)returns(google.protobuf.Empty);
// KeepAlive with manager.
rpc KeepAlive(stream KeepAliveRequest)returns(google.protobuf.Empty);
}

View File

@ -41,6 +41,8 @@ type ManagerClient interface {
ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error)
// List applications configuration.
ListApplications(ctx context.Context, in *ListApplicationsRequest, opts ...grpc.CallOption) (*ListApplicationsResponse, error)
// Create model and update data of model to object storage.
CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// KeepAlive with manager.
KeepAlive(ctx context.Context, opts ...grpc.CallOption) (Manager_KeepAliveClient, error)
}
@ -134,6 +136,15 @@ func (c *managerClient) ListApplications(ctx context.Context, in *ListApplicatio
return out, nil
}
func (c *managerClient) CreateModel(ctx context.Context, in *CreateModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/manager.Manager/CreateModel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOption) (Manager_KeepAliveClient, error) {
stream, err := c.cc.NewStream(ctx, &Manager_ServiceDesc.Streams[0], "/manager.Manager/KeepAlive", opts...)
if err != nil {
@ -190,6 +201,8 @@ type ManagerServer interface {
ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error)
// List applications configuration.
ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error)
// Create model and update data of model to object storage.
CreateModel(context.Context, *CreateModelRequest) (*emptypb.Empty, error)
// KeepAlive with manager.
KeepAlive(Manager_KeepAliveServer) error
}
@ -225,6 +238,9 @@ func (UnimplementedManagerServer) ListBuckets(context.Context, *ListBucketsReque
func (UnimplementedManagerServer) ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListApplications not implemented")
}
func (UnimplementedManagerServer) CreateModel(context.Context, *CreateModelRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateModel not implemented")
}
func (UnimplementedManagerServer) KeepAlive(Manager_KeepAliveServer) error {
return status.Errorf(codes.Unimplemented, "method KeepAlive not implemented")
}
@ -402,6 +418,24 @@ func _Manager_ListApplications_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _Manager_CreateModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagerServer).CreateModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/manager.Manager/CreateModel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagerServer).CreateModel(ctx, req.(*CreateModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Manager_KeepAlive_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ManagerServer).KeepAlive(&managerKeepAliveServer{stream})
}
@ -471,6 +505,10 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
MethodName: "ListApplications",
Handler: _Manager_ListApplications_Handler,
},
{
MethodName: "CreateModel",
Handler: _Manager_CreateModel_Handler,
},
},
Streams: []grpc.StreamDesc{
{

View File

@ -5,7 +5,6 @@
//
// mockgen -destination manager_mock.go -source ../manager_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -24,7 +23,6 @@ import (
type MockManagerClient struct {
ctrl *gomock.Controller
recorder *MockManagerClientMockRecorder
isgomock struct{}
}
// MockManagerClientMockRecorder is the mock recorder for MockManagerClient.
@ -44,6 +42,26 @@ func (m *MockManagerClient) EXPECT() *MockManagerClientMockRecorder {
return m.recorder
}
// CreateModel mocks base method.
func (m *MockManagerClient) CreateModel(ctx context.Context, in *manager.CreateModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
varargs := []any{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "CreateModel", varargs...)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModel indicates an expected call of CreateModel.
func (mr *MockManagerClientMockRecorder) CreateModel(ctx, in any, opts ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModel", reflect.TypeOf((*MockManagerClient)(nil).CreateModel), varargs...)
}
// GetObjectStorage mocks base method.
func (m *MockManagerClient) GetObjectStorage(ctx context.Context, in *manager.GetObjectStorageRequest, opts ...grpc.CallOption) (*manager.ObjectStorage, error) {
m.ctrl.T.Helper()
@ -248,7 +266,6 @@ func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in any, opts ...any
type MockManager_KeepAliveClient struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveClientMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveClientMockRecorder is the mock recorder for MockManager_KeepAliveClient.
@ -386,7 +403,6 @@ func (mr *MockManager_KeepAliveClientMockRecorder) Trailer() *gomock.Call {
type MockManagerServer struct {
ctrl *gomock.Controller
recorder *MockManagerServerMockRecorder
isgomock struct{}
}
// MockManagerServerMockRecorder is the mock recorder for MockManagerServer.
@ -406,6 +422,21 @@ func (m *MockManagerServer) EXPECT() *MockManagerServerMockRecorder {
return m.recorder
}
// CreateModel mocks base method.
func (m *MockManagerServer) CreateModel(arg0 context.Context, arg1 *manager.CreateModelRequest) (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateModel", arg0, arg1)
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateModel indicates an expected call of CreateModel.
func (mr *MockManagerServerMockRecorder) CreateModel(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateModel", reflect.TypeOf((*MockManagerServer)(nil).CreateModel), arg0, arg1)
}
// GetObjectStorage mocks base method.
func (m *MockManagerServer) GetObjectStorage(arg0 context.Context, arg1 *manager.GetObjectStorageRequest) (*manager.ObjectStorage, error) {
m.ctrl.T.Helper()
@ -559,7 +590,6 @@ func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 any) *gomock.
type MockUnsafeManagerServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeManagerServerMockRecorder
isgomock struct{}
}
// MockUnsafeManagerServerMockRecorder is the mock recorder for MockUnsafeManagerServer.
@ -595,7 +625,6 @@ func (mr *MockUnsafeManagerServerMockRecorder) mustEmbedUnimplementedManagerServ
type MockManager_KeepAliveServer struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveServerMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveServerMockRecorder is the mock recorder for MockManager_KeepAliveServer.

View File

@ -1051,10 +1051,6 @@ type UpdateSchedulerRequest struct {
Ip string `protobuf:"bytes,6,opt,name=ip,proto3" json:"ip,omitempty"`
// Scheduler port.
Port int32 `protobuf:"varint,7,opt,name=port,proto3" json:"port,omitempty"`
// Scheduler features.
Features []string `protobuf:"bytes,8,rep,name=features,proto3" json:"features,omitempty"`
// Scheduler configuration.
Config []byte `protobuf:"bytes,9,opt,name=config,proto3" json:"config,omitempty"`
}
func (x *UpdateSchedulerRequest) Reset() {
@ -1138,20 +1134,6 @@ func (x *UpdateSchedulerRequest) GetPort() int32 {
return 0
}
func (x *UpdateSchedulerRequest) GetFeatures() []string {
if x != nil {
return x.Features
}
return nil
}
func (x *UpdateSchedulerRequest) GetConfig() []byte {
if x != nil {
return x.Config
}
return nil
}
// ListSchedulersRequest represents request of ListSchedulers.
type ListSchedulersRequest struct {
state protoimpl.MessageState
@ -1172,8 +1154,6 @@ type ListSchedulersRequest struct {
Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
// Dfdaemon commit.
Commit string `protobuf:"bytes,7,opt,name=commit,proto3" json:"commit,omitempty"`
// ID of the cluster to which the scheduler belongs.
SchedulerClusterId uint64 `protobuf:"varint,8,opt,name=scheduler_cluster_id,json=schedulerClusterId,proto3" json:"scheduler_cluster_id,omitempty"`
}
func (x *ListSchedulersRequest) Reset() {
@ -1257,13 +1237,6 @@ func (x *ListSchedulersRequest) GetCommit() string {
return ""
}
func (x *ListSchedulersRequest) GetSchedulerClusterId() uint64 {
if x != nil {
return x.SchedulerClusterId
}
return 0
}
// ListSchedulersResponse represents response of ListSchedulers.
type ListSchedulersResponse struct {
state protoimpl.MessageState
@ -1630,6 +1603,149 @@ func (x *ListApplicationsResponse) GetApplications() []*Application {
return nil
}
// CreateGNNRequest represents to create GNN model request of TrainRequest.
type CreateGNNRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Protocol buffer file of model.
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// Recall of the model.
Recall float64 `protobuf:"fixed64,2,opt,name=recall,proto3" json:"recall,omitempty"`
// Precision of the model.
Precision float64 `protobuf:"fixed64,3,opt,name=precision,proto3" json:"precision,omitempty"`
// F1-Score of the model.
F1Score float64 `protobuf:"fixed64,4,opt,name=f1_score,json=f1Score,proto3" json:"f1_score,omitempty"`
}
func (x *CreateGNNRequest) Reset() {
*x = CreateGNNRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateGNNRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateGNNRequest) ProtoMessage() {}
func (x *CreateGNNRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateGNNRequest.ProtoReflect.Descriptor instead.
func (*CreateGNNRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_manager_v2_manager_proto_rawDescGZIP(), []int{18}
}
func (x *CreateGNNRequest) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
func (x *CreateGNNRequest) GetRecall() float64 {
if x != nil {
return x.Recall
}
return 0
}
func (x *CreateGNNRequest) GetPrecision() float64 {
if x != nil {
return x.Precision
}
return 0
}
func (x *CreateGNNRequest) GetF1Score() float64 {
if x != nil {
return x.F1Score
}
return 0
}
// CreateMLPRequest represents to create MLP model request of TrainRequest.
type CreateMLPRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Protocol buffer file of model.
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// MSE of the model.
Mse float64 `protobuf:"fixed64,2,opt,name=mse,proto3" json:"mse,omitempty"`
// MAE of the model.
Mae float64 `protobuf:"fixed64,3,opt,name=mae,proto3" json:"mae,omitempty"`
}
func (x *CreateMLPRequest) Reset() {
*x = CreateMLPRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateMLPRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateMLPRequest) ProtoMessage() {}
func (x *CreateMLPRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateMLPRequest.ProtoReflect.Descriptor instead.
func (*CreateMLPRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_manager_v2_manager_proto_rawDescGZIP(), []int{19}
}
func (x *CreateMLPRequest) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
func (x *CreateMLPRequest) GetMse() float64 {
if x != nil {
return x.Mse
}
return 0
}
func (x *CreateMLPRequest) GetMae() float64 {
if x != nil {
return x.Mae
}
return 0
}
// KeepAliveRequest represents request of KeepAlive.
type KeepAliveRequest struct {
state protoimpl.MessageState
@ -1649,7 +1765,7 @@ type KeepAliveRequest struct {
func (x *KeepAliveRequest) Reset() {
*x = KeepAliveRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[18]
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1662,7 +1778,7 @@ func (x *KeepAliveRequest) String() string {
func (*KeepAliveRequest) ProtoMessage() {}
func (x *KeepAliveRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[18]
mi := &file_pkg_apis_manager_v2_manager_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1675,7 +1791,7 @@ func (x *KeepAliveRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use KeepAliveRequest.ProtoReflect.Descriptor instead.
func (*KeepAliveRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_manager_v2_manager_proto_rawDescGZIP(), []int{18}
return file_pkg_apis_manager_v2_manager_proto_rawDescGZIP(), []int{20}
}
func (x *KeepAliveRequest) GetSourceType() SourceType {
@ -1873,7 +1989,7 @@ var file_pkg_apis_manager_v2_manager_proto_rawDesc = []byte{
0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42,
0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x70, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x02, 0x69, 0x70, 0x22,
0x95, 0x03, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75,
0xe1, 0x02, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0b, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x6f, 0x75,
@ -1893,146 +2009,160 @@ var file_pkg_apis_manager_v2_manager_proto_rawDesc = []byte{
0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x20, 0x0a, 0x04,
0x70, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a,
0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a,
0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09,
0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x69, 0x64, 0x63, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c,
0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x03, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74,
0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x41, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
0x2e, 0x76, 0x32, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08,
0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52,
0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02,
0x69, 0x70, 0x12, 0x24, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42,
0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x48, 0x00,
0x52, 0x03, 0x69, 0x64, 0x63, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72,
0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x48, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08,
0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x25, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28,
0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01,
0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64,
0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65,
0x72, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x69,
0x64, 0x63, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x4f, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x73, 0x63, 0x68,
0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e,
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73,
0x22, 0x57, 0x0a, 0x0b, 0x55, 0x52, 0x4c, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12,
0x1d, 0x0a, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x12, 0x29,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69,
0x74, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6d, 0x0a, 0x13, 0x41, 0x70, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79,
0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6f,
0x72, 0x69, 0x74, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x75,
0x72, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x52, 0x4c, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69,
0x74, 0x79, 0x52, 0x04, 0x75, 0x72, 0x6c, 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x0b, 0x41, 0x70, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69,
0x64, 0x12, 0x1e, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x1a, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08,
0xfa, 0x42, 0x05, 0x72, 0x03, 0x88, 0x01, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a,
0x03, 0x62, 0x69, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x6f, 0x12,
0x45, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x41,
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69,
0x74, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x72,
0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x9a, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x41,
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x41, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42,
0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01,
0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52,
0x02, 0x69, 0x70, 0x22, 0x57, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x3b, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e,
0x76, 0x32, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c,
0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xbe, 0x01, 0x0a,
0x10, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x41, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
0x2e, 0x76, 0x32, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08,
0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52,
0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x63, 0x6c, 0x75,
0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa,
0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49,
0x64, 0x12, 0x1a, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa,
0x42, 0x07, 0x72, 0x05, 0x70, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x02, 0x69, 0x70, 0x2a, 0x49, 0x0a,
0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x53,
0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10,
0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45,
0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45, 0x45, 0x44, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x5f,
0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x32, 0xcf, 0x05, 0x0a, 0x07, 0x4d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50,
0x65, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32,
0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32,
0x2e, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x0d, 0x4c, 0x69, 0x73,
0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64,
0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65,
0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x49, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65,
0x72, 0x12, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76,
0x32, 0x2e, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0e, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65,
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67,
0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12,
0x4c, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c,
0x65, 0x72, 0x12, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x57, 0x0a,
0x0e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x12,
0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70,
0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x24, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x09, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69,
0x76, 0x65, 0x12, 0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e,
0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x01, 0x42, 0x2b, 0x5a, 0x29, 0x64, 0x37,
0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f,
0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x3b,
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x06,
0x0a, 0x04, 0x5f, 0x69, 0x64, 0x63, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x22, 0xd3, 0x02, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a,
0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e,
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82,
0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73,
0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x24,
0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a,
0x72, 0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x48, 0x00, 0x52, 0x03, 0x69, 0x64,
0x63, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x10, 0x01, 0x18,
0x80, 0x08, 0xd0, 0x01, 0x01, 0x48, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x72, 0x08, 0x10, 0x01, 0x18, 0x80,
0x08, 0xd0, 0x01, 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a,
0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xfa,
0x42, 0x0a, 0x72, 0x08, 0x10, 0x01, 0x18, 0x80, 0x08, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x63, 0x6f,
0x6d, 0x6d, 0x69, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x69, 0x64, 0x63, 0x42, 0x0b, 0x0a, 0x09,
0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4f, 0x0a, 0x16, 0x4c, 0x69, 0x73,
0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x0a,
0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x22, 0x57, 0x0a, 0x0b, 0x55, 0x52,
0x4c, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x72, 0x65, 0x67,
0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
0x01, 0x52, 0x05, 0x72, 0x65, 0x67, 0x65, 0x78, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x22, 0x6d, 0x0a, 0x13, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32,
0x2e, 0x55, 0x52, 0x4c, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x04, 0x75, 0x72,
0x6c, 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05,
0x10, 0x01, 0x18, 0x80, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x75,
0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x88,
0x01, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x69, 0x6f, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x69, 0x6f, 0x12, 0x45, 0x0a, 0x08, 0x70, 0x72, 0x69,
0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x08, 0xfa, 0x42,
0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79,
0x22, 0x9a, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0b,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01,
0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70, 0x22, 0x57, 0x0a,
0x18, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x61, 0x70, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x17, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x70, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xcb, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x47, 0x4e, 0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02,
0x10, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x61,
0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12, 0x19,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x52, 0x06, 0x72, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x12, 0x35, 0x0a, 0x09, 0x70, 0x72, 0x65,
0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x42, 0x17, 0xfa, 0x42,
0x14, 0x12, 0x12, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x29, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x32, 0x0a, 0x08, 0x66, 0x31, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01,
0x28, 0x01, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0x3f, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x07, 0x66, 0x31, 0x53,
0x63, 0x6f, 0x72, 0x65, 0x22, 0x73, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x4c,
0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x10, 0x01, 0x52,
0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x52, 0x03, 0x6d, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x6d, 0x61, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x6d, 0x61, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x10, 0x4b, 0x65,
0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41,
0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32,
0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05,
0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70,
0x65, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f,
0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32,
0x02, 0x28, 0x01, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a,
0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72,
0x05, 0x70, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x02, 0x69, 0x70, 0x2a, 0x49, 0x0a, 0x0a, 0x53, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x43, 0x48, 0x45,
0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0f,
0x0a, 0x0b, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x01, 0x12,
0x14, 0x0a, 0x10, 0x53, 0x45, 0x45, 0x44, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55,
0x52, 0x43, 0x45, 0x10, 0x02, 0x32, 0xcf, 0x05, 0x0a, 0x07, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x12, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72,
0x12, 0x1e, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65,
0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65,
0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65,
0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65,
0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x65, 0x64, 0x50,
0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x21,
0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x53,
0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x53, 0x65, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x6d, 0x61, 0x6e, 0x61,
0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x65,
0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76,
0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e,
0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x0f,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12,
0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32,
0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x57, 0x0a, 0x0e, 0x4c, 0x69,
0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x22, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70,
0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x43, 0x0a, 0x09, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x12,
0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x32, 0x2e, 0x4b, 0x65, 0x65,
0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x01, 0x42, 0x2b, 0x5a, 0x29, 0x64, 0x37, 0x79, 0x2e, 0x69,
0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69,
0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x3b, 0x6d, 0x61, 0x6e,
0x61, 0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -2048,7 +2178,7 @@ func file_pkg_apis_manager_v2_manager_proto_rawDescGZIP() []byte {
}
var file_pkg_apis_manager_v2_manager_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_pkg_apis_manager_v2_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_pkg_apis_manager_v2_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
var file_pkg_apis_manager_v2_manager_proto_goTypes = []interface{}{
(SourceType)(0), // 0: manager.v2.SourceType
(*SeedPeerCluster)(nil), // 1: manager.v2.SeedPeerCluster
@ -2069,9 +2199,11 @@ var file_pkg_apis_manager_v2_manager_proto_goTypes = []interface{}{
(*Application)(nil), // 16: manager.v2.Application
(*ListApplicationsRequest)(nil), // 17: manager.v2.ListApplicationsRequest
(*ListApplicationsResponse)(nil), // 18: manager.v2.ListApplicationsResponse
(*KeepAliveRequest)(nil), // 19: manager.v2.KeepAliveRequest
(v2.Priority)(0), // 20: common.v2.Priority
(*emptypb.Empty)(nil), // 21: google.protobuf.Empty
(*CreateGNNRequest)(nil), // 19: manager.v2.CreateGNNRequest
(*CreateMLPRequest)(nil), // 20: manager.v2.CreateMLPRequest
(*KeepAliveRequest)(nil), // 21: manager.v2.KeepAliveRequest
(v2.Priority)(0), // 22: common.v2.Priority
(*emptypb.Empty)(nil), // 23: google.protobuf.Empty
}
var file_pkg_apis_manager_v2_manager_proto_depIdxs = []int32{
1, // 0: manager.v2.SeedPeer.seed_peer_cluster:type_name -> manager.v2.SeedPeerCluster
@ -2087,8 +2219,8 @@ var file_pkg_apis_manager_v2_manager_proto_depIdxs = []int32{
0, // 10: manager.v2.UpdateSchedulerRequest.source_type:type_name -> manager.v2.SourceType
0, // 11: manager.v2.ListSchedulersRequest.source_type:type_name -> manager.v2.SourceType
9, // 12: manager.v2.ListSchedulersResponse.schedulers:type_name -> manager.v2.Scheduler
20, // 13: manager.v2.URLPriority.value:type_name -> common.v2.Priority
20, // 14: manager.v2.ApplicationPriority.value:type_name -> common.v2.Priority
22, // 13: manager.v2.URLPriority.value:type_name -> common.v2.Priority
22, // 14: manager.v2.ApplicationPriority.value:type_name -> common.v2.Priority
14, // 15: manager.v2.ApplicationPriority.urls:type_name -> manager.v2.URLPriority
15, // 16: manager.v2.Application.priority:type_name -> manager.v2.ApplicationPriority
0, // 17: manager.v2.ListApplicationsRequest.source_type:type_name -> manager.v2.SourceType
@ -2102,16 +2234,16 @@ var file_pkg_apis_manager_v2_manager_proto_depIdxs = []int32{
11, // 25: manager.v2.Manager.UpdateScheduler:input_type -> manager.v2.UpdateSchedulerRequest
12, // 26: manager.v2.Manager.ListSchedulers:input_type -> manager.v2.ListSchedulersRequest
17, // 27: manager.v2.Manager.ListApplications:input_type -> manager.v2.ListApplicationsRequest
19, // 28: manager.v2.Manager.KeepAlive:input_type -> manager.v2.KeepAliveRequest
21, // 28: manager.v2.Manager.KeepAlive:input_type -> manager.v2.KeepAliveRequest
2, // 29: manager.v2.Manager.GetSeedPeer:output_type -> manager.v2.SeedPeer
5, // 30: manager.v2.Manager.ListSeedPeers:output_type -> manager.v2.ListSeedPeersResponse
2, // 31: manager.v2.Manager.UpdateSeedPeer:output_type -> manager.v2.SeedPeer
21, // 32: manager.v2.Manager.DeleteSeedPeer:output_type -> google.protobuf.Empty
23, // 32: manager.v2.Manager.DeleteSeedPeer:output_type -> google.protobuf.Empty
9, // 33: manager.v2.Manager.GetScheduler:output_type -> manager.v2.Scheduler
9, // 34: manager.v2.Manager.UpdateScheduler:output_type -> manager.v2.Scheduler
13, // 35: manager.v2.Manager.ListSchedulers:output_type -> manager.v2.ListSchedulersResponse
18, // 36: manager.v2.Manager.ListApplications:output_type -> manager.v2.ListApplicationsResponse
21, // 37: manager.v2.Manager.KeepAlive:output_type -> google.protobuf.Empty
23, // 37: manager.v2.Manager.KeepAlive:output_type -> google.protobuf.Empty
29, // [29:38] is the sub-list for method output_type
20, // [20:29] is the sub-list for method input_type
20, // [20:20] is the sub-list for extension type_name
@ -2342,6 +2474,30 @@ func file_pkg_apis_manager_v2_manager_proto_init() {
}
}
file_pkg_apis_manager_v2_manager_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateGNNRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_manager_v2_manager_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateMLPRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_manager_v2_manager_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KeepAliveRequest); i {
case 0:
return &v.state
@ -2365,7 +2521,7 @@ func file_pkg_apis_manager_v2_manager_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_manager_v2_manager_proto_rawDesc,
NumEnums: 1,
NumMessages: 19,
NumMessages: 21,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -1836,8 +1836,6 @@ func (m *UpdateSchedulerRequest) validate(all bool) error {
errors = append(errors, err)
}
// no validation rules for Config
if m.Idc != nil {
if m.GetIdc() != "" {
@ -2072,8 +2070,6 @@ func (m *ListSchedulersRequest) validate(all bool) error {
}
// no validation rules for SchedulerClusterId
if m.Idc != nil {
if m.GetIdc() != "" {
@ -3094,6 +3090,283 @@ var _ interface {
ErrorName() string
} = ListApplicationsResponseValidationError{}
// Validate checks the field values on CreateGNNRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *CreateGNNRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CreateGNNRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CreateGNNRequestMultiError, or nil if none found.
func (m *CreateGNNRequest) ValidateAll() error {
return m.validate(true)
}
func (m *CreateGNNRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetData()) < 1 {
err := CreateGNNRequestValidationError{
field: "Data",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if val := m.GetRecall(); val < 0 || val > 1 {
err := CreateGNNRequestValidationError{
field: "Recall",
reason: "value must be inside range [0, 1]",
}
if !all {
return err
}
errors = append(errors, err)
}
if val := m.GetPrecision(); val < 0 || val > 1 {
err := CreateGNNRequestValidationError{
field: "Precision",
reason: "value must be inside range [0, 1]",
}
if !all {
return err
}
errors = append(errors, err)
}
if val := m.GetF1Score(); val < 0 || val > 1 {
err := CreateGNNRequestValidationError{
field: "F1Score",
reason: "value must be inside range [0, 1]",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CreateGNNRequestMultiError(errors)
}
return nil
}
// CreateGNNRequestMultiError is an error wrapping multiple validation errors
// returned by CreateGNNRequest.ValidateAll() if the designated constraints
// aren't met.
type CreateGNNRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CreateGNNRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CreateGNNRequestMultiError) AllErrors() []error { return m }
// CreateGNNRequestValidationError is the validation error returned by
// CreateGNNRequest.Validate if the designated constraints aren't met.
type CreateGNNRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CreateGNNRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CreateGNNRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CreateGNNRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CreateGNNRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CreateGNNRequestValidationError) ErrorName() string { return "CreateGNNRequestValidationError" }
// Error satisfies the builtin error interface
func (e CreateGNNRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCreateGNNRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CreateGNNRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CreateGNNRequestValidationError{}
// Validate checks the field values on CreateMLPRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *CreateMLPRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CreateMLPRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CreateMLPRequestMultiError, or nil if none found.
func (m *CreateMLPRequest) ValidateAll() error {
return m.validate(true)
}
func (m *CreateMLPRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetData()) < 1 {
err := CreateMLPRequestValidationError{
field: "Data",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetMse() < 0 {
err := CreateMLPRequestValidationError{
field: "Mse",
reason: "value must be greater than or equal to 0",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetMae() < 0 {
err := CreateMLPRequestValidationError{
field: "Mae",
reason: "value must be greater than or equal to 0",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CreateMLPRequestMultiError(errors)
}
return nil
}
// CreateMLPRequestMultiError is an error wrapping multiple validation errors
// returned by CreateMLPRequest.ValidateAll() if the designated constraints
// aren't met.
type CreateMLPRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CreateMLPRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CreateMLPRequestMultiError) AllErrors() []error { return m }
// CreateMLPRequestValidationError is the validation error returned by
// CreateMLPRequest.Validate if the designated constraints aren't met.
type CreateMLPRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CreateMLPRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CreateMLPRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CreateMLPRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CreateMLPRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CreateMLPRequestValidationError) ErrorName() string { return "CreateMLPRequestValidationError" }
// Error satisfies the builtin error interface
func (e CreateMLPRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCreateMLPRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CreateMLPRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CreateMLPRequestValidationError{}
// Validate checks the field values on KeepAliveRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.

View File

@ -212,10 +212,6 @@ message UpdateSchedulerRequest {
string ip = 6 [(validate.rules).string = {ip: true}];
// Scheduler port.
int32 port = 7 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
// Scheduler features.
repeated string features = 8;
// Scheduler configuration.
bytes config = 9;
}
// ListSchedulersRequest represents request of ListSchedulers.
@ -234,8 +230,6 @@ message ListSchedulersRequest {
string version = 6 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// Dfdaemon commit.
string commit = 7 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 8;
}
// ListSchedulersResponse represents response of ListSchedulers.
@ -290,6 +284,28 @@ message ListApplicationsResponse {
repeated Application applications = 1;
}
// CreateGNNRequest represents to create GNN model request of TrainRequest.
message CreateGNNRequest {
// Protocol buffer file of model.
bytes data = 1 [(validate.rules).bytes.min_len = 1];
// Recall of the model.
double recall = 2 [(validate.rules).double = {gte: 0, lte: 1}];
// Precision of the model.
double precision = 3 [(validate.rules).double = {gte: 0, lte: 1}];
// F1-Score of the model.
double f1_score = 4 [(validate.rules).double = {gte: 0, lte: 1}];
}
// CreateMLPRequest represents to create MLP model request of TrainRequest.
message CreateMLPRequest {
// Protocol buffer file of model.
bytes data = 1 [(validate.rules).bytes.min_len = 1];
// MSE of the model.
double mse = 2 [(validate.rules).double = {gte: 0}];
// MAE of the model.
double mae = 3 [(validate.rules).double = {gte: 0}];
}
// KeepAliveRequest represents request of KeepAlive.
message KeepAliveRequest {
// Request source type.

View File

@ -5,7 +5,6 @@
//
// mockgen -destination manager_mock.go -source ../manager_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -24,7 +23,6 @@ import (
type MockManagerClient struct {
ctrl *gomock.Controller
recorder *MockManagerClientMockRecorder
isgomock struct{}
}
// MockManagerClientMockRecorder is the mock recorder for MockManagerClient.
@ -228,7 +226,6 @@ func (mr *MockManagerClientMockRecorder) UpdateSeedPeer(ctx, in any, opts ...any
type MockManager_KeepAliveClient struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveClientMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveClientMockRecorder is the mock recorder for MockManager_KeepAliveClient.
@ -366,7 +363,6 @@ func (mr *MockManager_KeepAliveClientMockRecorder) Trailer() *gomock.Call {
type MockManagerServer struct {
ctrl *gomock.Controller
recorder *MockManagerServerMockRecorder
isgomock struct{}
}
// MockManagerServerMockRecorder is the mock recorder for MockManagerServer.
@ -524,7 +520,6 @@ func (mr *MockManagerServerMockRecorder) UpdateSeedPeer(arg0, arg1 any) *gomock.
type MockUnsafeManagerServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeManagerServerMockRecorder
isgomock struct{}
}
// MockUnsafeManagerServerMockRecorder is the mock recorder for MockUnsafeManagerServer.
@ -560,7 +555,6 @@ func (mr *MockUnsafeManagerServerMockRecorder) mustEmbedUnimplementedManagerServ
type MockManager_KeepAliveServer struct {
ctrl *gomock.Controller
recorder *MockManager_KeepAliveServerMockRecorder
isgomock struct{}
}
// MockManager_KeepAliveServerMockRecorder is the mock recorder for MockManager_KeepAliveServer.

View File

@ -5,7 +5,6 @@
//
// mockgen -destination scheduler_mock.go -source ../scheduler_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
@ -24,7 +23,6 @@ import (
type MockSchedulerClient struct {
ctrl *gomock.Controller
recorder *MockSchedulerClientMockRecorder
isgomock struct{}
}
// MockSchedulerClientMockRecorder is the mock recorder for MockSchedulerClient.
@ -204,11 +202,30 @@ func (mr *MockSchedulerClientMockRecorder) StatTask(ctx, in any, opts ...any) *g
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockSchedulerClient)(nil).StatTask), varargs...)
}
// SyncProbes mocks base method.
func (m *MockSchedulerClient) SyncProbes(ctx context.Context, opts ...grpc.CallOption) (scheduler.Scheduler_SyncProbesClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SyncProbes", varargs...)
ret0, _ := ret[0].(scheduler.Scheduler_SyncProbesClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SyncProbes indicates an expected call of SyncProbes.
func (mr *MockSchedulerClientMockRecorder) SyncProbes(ctx any, opts ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncProbes", reflect.TypeOf((*MockSchedulerClient)(nil).SyncProbes), varargs...)
}
// MockScheduler_ReportPieceResultClient is a mock of Scheduler_ReportPieceResultClient interface.
type MockScheduler_ReportPieceResultClient struct {
ctrl *gomock.Controller
recorder *MockScheduler_ReportPieceResultClientMockRecorder
isgomock struct{}
}
// MockScheduler_ReportPieceResultClientMockRecorder is the mock recorder for MockScheduler_ReportPieceResultClient.
@ -342,11 +359,147 @@ func (mr *MockScheduler_ReportPieceResultClientMockRecorder) Trailer() *gomock.C
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockScheduler_ReportPieceResultClient)(nil).Trailer))
}
// MockScheduler_SyncProbesClient is a mock of Scheduler_SyncProbesClient interface.
type MockScheduler_SyncProbesClient struct {
ctrl *gomock.Controller
recorder *MockScheduler_SyncProbesClientMockRecorder
}
// MockScheduler_SyncProbesClientMockRecorder is the mock recorder for MockScheduler_SyncProbesClient.
type MockScheduler_SyncProbesClientMockRecorder struct {
mock *MockScheduler_SyncProbesClient
}
// NewMockScheduler_SyncProbesClient creates a new mock instance.
func NewMockScheduler_SyncProbesClient(ctrl *gomock.Controller) *MockScheduler_SyncProbesClient {
mock := &MockScheduler_SyncProbesClient{ctrl: ctrl}
mock.recorder = &MockScheduler_SyncProbesClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockScheduler_SyncProbesClient) EXPECT() *MockScheduler_SyncProbesClientMockRecorder {
return m.recorder
}
// CloseSend mocks base method.
func (m *MockScheduler_SyncProbesClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockScheduler_SyncProbesClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockScheduler_SyncProbesClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Context))
}
// Header mocks base method.
func (m *MockScheduler_SyncProbesClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Header))
}
// Recv mocks base method.
func (m *MockScheduler_SyncProbesClient) Recv() (*scheduler.SyncProbesResponse, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*scheduler.SyncProbesResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesClient) RecvMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_SyncProbesClientMockRecorder) RecvMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockScheduler_SyncProbesClient) Send(arg0 *scheduler.SyncProbesRequest) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Send(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesClient) SendMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_SyncProbesClientMockRecorder) SendMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).SendMsg), m)
}
// Trailer mocks base method.
func (m *MockScheduler_SyncProbesClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockScheduler_SyncProbesClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockScheduler_SyncProbesClient)(nil).Trailer))
}
// MockSchedulerServer is a mock of SchedulerServer interface.
type MockSchedulerServer struct {
ctrl *gomock.Controller
recorder *MockSchedulerServerMockRecorder
isgomock struct{}
}
// MockSchedulerServerMockRecorder is the mock recorder for MockSchedulerServer.
@ -485,11 +638,24 @@ func (mr *MockSchedulerServerMockRecorder) StatTask(arg0, arg1 any) *gomock.Call
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StatTask", reflect.TypeOf((*MockSchedulerServer)(nil).StatTask), arg0, arg1)
}
// SyncProbes mocks base method.
func (m *MockSchedulerServer) SyncProbes(arg0 scheduler.Scheduler_SyncProbesServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SyncProbes", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SyncProbes indicates an expected call of SyncProbes.
func (mr *MockSchedulerServerMockRecorder) SyncProbes(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncProbes", reflect.TypeOf((*MockSchedulerServer)(nil).SyncProbes), arg0)
}
// MockUnsafeSchedulerServer is a mock of UnsafeSchedulerServer interface.
type MockUnsafeSchedulerServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeSchedulerServerMockRecorder
isgomock struct{}
}
// MockUnsafeSchedulerServerMockRecorder is the mock recorder for MockUnsafeSchedulerServer.
@ -525,7 +691,6 @@ func (mr *MockUnsafeSchedulerServerMockRecorder) mustEmbedUnimplementedScheduler
type MockScheduler_ReportPieceResultServer struct {
ctrl *gomock.Controller
recorder *MockScheduler_ReportPieceResultServerMockRecorder
isgomock struct{}
}
// MockScheduler_ReportPieceResultServerMockRecorder is the mock recorder for MockScheduler_ReportPieceResultServer.
@ -655,3 +820,137 @@ func (mr *MockScheduler_ReportPieceResultServerMockRecorder) SetTrailer(arg0 any
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockScheduler_ReportPieceResultServer)(nil).SetTrailer), arg0)
}
// MockScheduler_SyncProbesServer is a mock of Scheduler_SyncProbesServer interface.
type MockScheduler_SyncProbesServer struct {
ctrl *gomock.Controller
recorder *MockScheduler_SyncProbesServerMockRecorder
}
// MockScheduler_SyncProbesServerMockRecorder is the mock recorder for MockScheduler_SyncProbesServer.
type MockScheduler_SyncProbesServerMockRecorder struct {
mock *MockScheduler_SyncProbesServer
}
// NewMockScheduler_SyncProbesServer creates a new mock instance.
func NewMockScheduler_SyncProbesServer(ctrl *gomock.Controller) *MockScheduler_SyncProbesServer {
mock := &MockScheduler_SyncProbesServer{ctrl: ctrl}
mock.recorder = &MockScheduler_SyncProbesServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockScheduler_SyncProbesServer) EXPECT() *MockScheduler_SyncProbesServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockScheduler_SyncProbesServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockScheduler_SyncProbesServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).Context))
}
// Recv mocks base method.
func (m *MockScheduler_SyncProbesServer) Recv() (*scheduler.SyncProbesRequest, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*scheduler.SyncProbesRequest)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockScheduler_SyncProbesServerMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesServer) RecvMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockScheduler_SyncProbesServerMockRecorder) RecvMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockScheduler_SyncProbesServer) Send(arg0 *scheduler.SyncProbesResponse) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockScheduler_SyncProbesServerMockRecorder) Send(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).Send), arg0)
}
// SendHeader mocks base method.
func (m *MockScheduler_SyncProbesServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockScheduler_SyncProbesServer) SendMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SendMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SendMsg), m)
}
// SetHeader mocks base method.
func (m *MockScheduler_SyncProbesServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockScheduler_SyncProbesServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockScheduler_SyncProbesServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockScheduler_SyncProbesServer)(nil).SetTrailer), arg0)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,8 @@ import "pkg/apis/common/v1/common.proto";
import "pkg/apis/errordetails/v1/errordetails.proto";
import "validate/validate.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "d7y.io/api/v2/pkg/apis/scheduler/v1;scheduler";
@ -89,8 +91,6 @@ message PeerHost{
string location = 7;
// IDC where the peer host is located
string idc = 8;
// Port of proxy server.
int32 proxy_port = 9 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
}
// PieceResult represents request of ReportPieceResult.
@ -269,8 +269,6 @@ message AnnounceHostRequest{
uint64 scheduler_cluster_id = 17;
// Port of object storage server.
int32 object_storage_port = 18 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
// Port of proxy server.
int32 proxy_port = 19 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
}
// CPU Stat.
@ -372,6 +370,60 @@ message Build {
string platform = 4;
}
// ProbeStartedRequest represents started request of SyncProbesRequest.
message ProbeStartedRequest {
}
// Probe information.
message Probe {
// Destination host metadata.
common.Host host = 1 [(validate.rules).message.required = true];
// RTT is the round-trip time sent via this pinger.
google.protobuf.Duration rtt = 2 [(validate.rules).duration.required = true];
// Probe create time.
google.protobuf.Timestamp created_at = 3 [(validate.rules).timestamp.required = true];
}
// ProbeFinishedRequest represents finished request of SyncProbesRequest.
message ProbeFinishedRequest {
// Probes information.
repeated Probe probes = 1 [(validate.rules).repeated = {min_items: 1}];
}
// FailedProbe information.
message FailedProbe {
// Destination host metadata.
common.Host host = 1 [(validate.rules).message.required = true];
// The description of probing failed.
string description = 2 [(validate.rules).string.min_len = 1];
}
// ProbeFailedRequest represents failed request of SyncProbesRequest.
message ProbeFailedRequest {
// Failed probes information.
repeated FailedProbe probes = 1 [(validate.rules).repeated = {min_items: 1}];
}
// SyncProbesRequest represents request of SyncProbes.
message SyncProbesRequest {
// Source host metadata.
common.Host host = 1 [(validate.rules).message.required = true];
oneof request {
option (validate.required) = true;
ProbeStartedRequest probe_started_request = 2;
ProbeFinishedRequest probe_finished_request = 3;
ProbeFailedRequest probe_failed_request = 4;
}
}
// SyncProbesResponse represents response of SyncProbes.
message SyncProbesResponse {
// Hosts needs to be probed.
repeated common.Host hosts = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
}
// Scheduler RPC Service.
service Scheduler{
// RegisterPeerTask registers a peer into task.
@ -397,4 +449,7 @@ service Scheduler{
// LeaveHost makes the peers leaving from host.
rpc LeaveHost(LeaveHostRequest)returns(google.protobuf.Empty);
// SyncProbes sync probes of the host.
rpc SyncProbes(stream SyncProbesRequest)returns(stream SyncProbesResponse);
}

View File

@ -39,6 +39,8 @@ type SchedulerClient interface {
AnnounceHost(ctx context.Context, in *AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// LeaveHost makes the peers leaving from host.
LeaveHost(ctx context.Context, in *LeaveHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error)
}
type schedulerClient struct {
@ -143,6 +145,37 @@ func (c *schedulerClient) LeaveHost(ctx context.Context, in *LeaveHostRequest, o
return out, nil
}
func (c *schedulerClient) SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[1], "/scheduler.Scheduler/SyncProbes", opts...)
if err != nil {
return nil, err
}
x := &schedulerSyncProbesClient{stream}
return x, nil
}
type Scheduler_SyncProbesClient interface {
Send(*SyncProbesRequest) error
Recv() (*SyncProbesResponse, error)
grpc.ClientStream
}
type schedulerSyncProbesClient struct {
grpc.ClientStream
}
func (x *schedulerSyncProbesClient) Send(m *SyncProbesRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *schedulerSyncProbesClient) Recv() (*SyncProbesResponse, error) {
m := new(SyncProbesResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// SchedulerServer is the server API for Scheduler service.
// All implementations should embed UnimplementedSchedulerServer
// for forward compatibility
@ -163,6 +196,8 @@ type SchedulerServer interface {
AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error)
// LeaveHost makes the peers leaving from host.
LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(Scheduler_SyncProbesServer) error
}
// UnimplementedSchedulerServer should be embedded to have forward compatible implementations.
@ -193,6 +228,9 @@ func (UnimplementedSchedulerServer) AnnounceHost(context.Context, *AnnounceHostR
func (UnimplementedSchedulerServer) LeaveHost(context.Context, *LeaveHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaveHost not implemented")
}
func (UnimplementedSchedulerServer) SyncProbes(Scheduler_SyncProbesServer) error {
return status.Errorf(codes.Unimplemented, "method SyncProbes not implemented")
}
// UnsafeSchedulerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SchedulerServer will
@ -357,6 +395,32 @@ func _Scheduler_LeaveHost_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Scheduler_SyncProbes_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).SyncProbes(&schedulerSyncProbesServer{stream})
}
type Scheduler_SyncProbesServer interface {
Send(*SyncProbesResponse) error
Recv() (*SyncProbesRequest, error)
grpc.ServerStream
}
type schedulerSyncProbesServer struct {
grpc.ServerStream
}
func (x *schedulerSyncProbesServer) Send(m *SyncProbesResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *schedulerSyncProbesServer) Recv() (*SyncProbesRequest, error) {
m := new(SyncProbesRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Scheduler_ServiceDesc is the grpc.ServiceDesc for Scheduler service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -400,6 +464,12 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SyncProbes",
Handler: _Scheduler_SyncProbes_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "pkg/apis/scheduler/v1/scheduler.proto",
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ import "pkg/apis/errordetails/v2/errordetails.proto";
import "validate/validate.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
option go_package = "d7y.io/api/v2/pkg/apis/scheduler/v2;scheduler";
@ -110,7 +111,6 @@ message DownloadPieceBackToSourceFailedRequest {
option (validate.required) = true;
errordetails.v2.Backend backend = 2;
errordetails.v2.Unknown unknown = 3;
}
}
@ -190,10 +190,8 @@ message DeletePeerRequest {
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
string task_id = 1 [(validate.rules).string.min_len = 1];
}
// DeleteTaskRequest represents request of DeleteTask.
@ -208,14 +206,6 @@ message DeleteTaskRequest {
message AnnounceHostRequest {
// Host info.
common.v2.Host host = 1 [(validate.rules).message.required = true];
// The interval between dfdaemon announces to scheduler.
optional google.protobuf.Duration interval = 2;
}
// ListHostsResponse represents response of ListHosts.
message ListHostsResponse {
// Hosts info.
repeated common.v2.Host hosts = 1;
}
// DeleteHostRequest represents request of DeleteHost.
@ -224,77 +214,82 @@ message DeleteHostRequest{
string host_id = 1 [(validate.rules).string.min_len = 1];
}
// ProbeStartedRequest represents started request of SyncProbesRequest.
message ProbeStartedRequest {
}
// Probe information.
message Probe {
// Destination host metadata.
common.v2.Host host = 1 [(validate.rules).message.required = true];
// RTT is the round-trip time sent via this pinger.
google.protobuf.Duration rtt = 2 [(validate.rules).duration.required = true];
// Probe create time.
google.protobuf.Timestamp created_at = 3 [(validate.rules).timestamp.required = true];
}
// ProbeFinishedRequest represents finished request of SyncProbesRequest.
message ProbeFinishedRequest {
// Probes information.
repeated Probe probes = 1 [(validate.rules).repeated = {min_items: 1}];
}
// FailedProbe information.
message FailedProbe {
// Destination host metadata.
common.v2.Host host = 1 [(validate.rules).message.required = true];
// The description of probing failed.
optional string description = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// ProbeFailedRequest represents failed request of SyncProbesRequest.
message ProbeFailedRequest {
// Failed probes information.
repeated FailedProbe probes = 1 [(validate.rules).repeated = {min_items: 1}];
}
// SyncProbesRequest represents request of SyncProbes.
message SyncProbesRequest {
// Source host metadata.
common.v2.Host host = 1 [(validate.rules).message.required = true];
oneof request {
option (validate.required) = true;
ProbeStartedRequest probe_started_request = 2;
ProbeFinishedRequest probe_finished_request = 3;
ProbeFailedRequest probe_failed_request = 4;
}
}
// SyncProbesResponse represents response of SyncProbes.
message SyncProbesResponse {
// Hosts needs to be probed.
repeated common.v2.Host hosts = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}];
}
// RegisterCachePeerRequest represents cache peer registered request of AnnounceCachePeerRequest.
message RegisterCachePeerRequest {
// Download url.
string url = 1 [(validate.rules).string.uri = true];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 2 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]+)$", ignore_empty: true}];
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
optional common.v2.Range range = 3;
// Task type.
common.v2.TaskType type = 4 [(validate.rules).enum.defined_only = true];
// URL tag identifies different task for same url.
optional string tag = 5;
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Tag is used to distinguish different cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 6;
// Peer priority.
common.v2.Priority priority = 7 [(validate.rules).enum.defined_only = true];
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 8;
// Task request headers.
map<string, string> request_header = 9;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB).
optional uint64 piece_length = 10 [(validate.rules).uint64 = {gte: 4194304, ignore_empty: true}];
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 11 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
optional string application = 4;
// Task piece length.
uint64 piece_length = 5 [(validate.rules).uint64.gte = 1];
// File path to be exported.
string output_path = 6 [(validate.rules).string.min_len = 1];
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
bool prefetch = 16;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 17;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 21;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 22 [(validate.rules).string = {ip: true, ignore_empty: true}];
optional google.protobuf.Duration timeout = 7;
}
// DownloadCachePeerStartedRequest represents cache peer download started request of AnnounceCachePeerRequest.
message DownloadCachePeerStartedRequest {
}
// DownloadCachePeerBackToSourceStartedRequest represents cache peer download back-to-source started request of AnnounceCachePeerRequest.
message DownloadCachePeerBackToSourceStartedRequest {
// The description of the back-to-source reason.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// RescheduleCachePeerRequest represents reschedule request of AnnounceCachePeerRequest.
message RescheduleCachePeerRequest {
// Candidate parent ids.
@ -306,18 +301,8 @@ message RescheduleCachePeerRequest {
// DownloadCachePeerFinishedRequest represents cache peer download finished request of AnnounceCachePeerRequest.
message DownloadCachePeerFinishedRequest {
// Total content length.
uint64 content_length = 1;
// Total piece count.
uint32 piece_count = 2;
}
// DownloadCachePeerBackToSourceFinishedRequest represents cache peer download back-to-source finished request of AnnounceCachePeerRequest.
message DownloadCachePeerBackToSourceFinishedRequest {
// Total content length.
uint64 content_length = 1;
// Total piece count.
uint32 piece_count = 2;
uint32 piece_count = 1;
}
// DownloadCachePeerFailedRequest represents cache peer download failed request of AnnounceCachePeerRequest.
@ -326,12 +311,6 @@ message DownloadCachePeerFailedRequest {
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// DownloadCachePeerBackToSourceFailedRequest represents cache peer download back-to-source failed request of AnnounceCachePeerRequest.
message DownloadCachePeerBackToSourceFailedRequest {
// The description of the download back-to-source failed.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// AnnounceCachePeerRequest represents request of AnnounceCachePeer.
message AnnounceCachePeerRequest {
// Host id.
@ -346,16 +325,11 @@ message AnnounceCachePeerRequest {
RegisterCachePeerRequest register_cache_peer_request = 4;
DownloadCachePeerStartedRequest download_cache_peer_started_request = 5;
DownloadCachePeerBackToSourceStartedRequest download_cache_peer_back_to_source_started_request = 6;
RescheduleCachePeerRequest reschedule_cache_peer_request = 7;
DownloadCachePeerFinishedRequest download_cache_peer_finished_request = 8;
DownloadCachePeerBackToSourceFinishedRequest download_cache_peer_back_to_source_finished_request = 9;
DownloadCachePeerFailedRequest download_cache_peer_failed_request = 10;
DownloadCachePeerBackToSourceFailedRequest download_cache_peer_back_to_source_failed_request = 11;
DownloadPieceFinishedRequest download_piece_finished_request = 12;
DownloadPieceBackToSourceFinishedRequest download_piece_back_to_source_finished_request = 13;
DownloadPieceFailedRequest download_piece_failed_request = 14;
DownloadPieceBackToSourceFailedRequest download_piece_back_to_source_failed_request = 15;
RescheduleCachePeerRequest reschedule_cache_peer_request = 6;
DownloadCachePeerFinishedRequest download_cache_peer_finished_request = 7;
DownloadCachePeerFailedRequest download_cache_peer_failed_request = 8;
DownloadPieceFinishedRequest download_piece_finished_request = 9;
DownloadPieceFailedRequest download_piece_failed_request = 10;
}
}
@ -374,9 +348,8 @@ message AnnounceCachePeerResponse {
oneof response {
option (validate.required) = true;
EmptyCacheTaskResponse empty_cache_task_response = 1;
NormalCacheTaskResponse normal_cache_task_response = 2;
NeedBackToSourceResponse need_back_to_source_response = 3;
EmptyCacheTaskResponse empty_task_response = 1;
NormalCacheTaskResponse normal_task_response = 2;
}
}
@ -400,129 +373,8 @@ message DeleteCachePeerRequest {
string peer_id = 3 [(validate.rules).string.min_len = 1];
}
// StatCacheTaskRequest represents request of StatCacheTask.
message StatCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
}
// DeleteCacheTaskRequest represents request of DeleteCacheTask.
message DeleteCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
}
// RegisterPersistentCachePeerRequest represents persistent cache peer registered request of AnnouncePersistentCachePeerRequest.
message RegisterPersistentCachePeerRequest {
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 1;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 2;
// Application of task.
optional string application = 3;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB)
uint64 piece_length = 4 [(validate.rules).uint64.gte = 4194304];
// File path to be exported.
optional string output_path = 5 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Download timeout.
optional google.protobuf.Duration timeout = 6;
}
// DownloadPersistentCachePeerStartedRequest represents persistent cache peer download started request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerStartedRequest {
}
// ReschedulePersistentCachePeerRequest represents reschedule request of AnnouncePersistentCachePeerRequest.
message ReschedulePersistentCachePeerRequest {
// Candidate parent ids.
repeated common.v2.PersistentCachePeer candidate_parents = 1;
// The description of the reschedule reason.
optional string description = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// DownloadPersistentCachePeerFinishedRequest represents persistent cache peer download finished request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFinishedRequest {
// Total piece count.
uint32 piece_count = 1;
}
// DownloadPersistentCachePeerFailedRequest represents persistent cache peer download failed request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFailedRequest {
// The description of the download failed.
optional string description = 1 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// AnnouncePersistentCachePeerRequest represents request of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
oneof request {
option (validate.required) = true;
RegisterPersistentCachePeerRequest register_persistent_cache_peer_request = 4;
DownloadPersistentCachePeerStartedRequest download_persistent_cache_peer_started_request = 5;
ReschedulePersistentCachePeerRequest reschedule_persistent_cache_peer_request = 6;
DownloadPersistentCachePeerFinishedRequest download_persistent_cache_peer_finished_request = 7;
DownloadPersistentCachePeerFailedRequest download_persistent_cache_peer_failed_request = 8;
DownloadPieceFinishedRequest download_piece_finished_request = 9;
DownloadPieceFailedRequest download_piece_failed_request = 10;
}
}
// EmptyPersistentCacheTaskResponse represents empty persistent cache task response of AnnouncePersistentCachePeerResponse.
message EmptyPersistentCacheTaskResponse {
}
// NormalPersistentCacheTaskResponse represents normal persistent cache task response of AnnouncePersistentCachePeerResponse.
message NormalPersistentCacheTaskResponse {
// Candidate parents.
repeated common.v2.PersistentCachePeer candidate_parents = 1 [(validate.rules).repeated.min_items = 1];
}
// AnnouncePersistentCachePeerResponse represents response of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerResponse {
oneof response {
option (validate.required) = true;
EmptyPersistentCacheTaskResponse empty_persistent_cache_task_response = 1;
NormalPersistentCacheTaskResponse normal_persistent_cache_task_response = 2;
}
}
// StatPersistentCachePeerRequest represents request of StatPersistentCachePeer.
message StatPersistentCachePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
}
// DeletePersistentCachePeerRequest represents request of DeletePersistentCachePeer.
message DeletePersistentCachePeerRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
}
// UploadPersistentCacheTaskStartedRequest represents upload persistent cache task started request of UploadPersistentCacheTaskStartedRequest.
message UploadPersistentCacheTaskStartedRequest {
// UploadCacheTaskRequest represents request of UploadCacheTask.
message UploadCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
@ -531,195 +383,30 @@ message UploadPersistentCacheTaskStartedRequest {
string peer_id = 3 [(validate.rules).string.min_len = 1];
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 4 [(validate.rules).uint64.gte = 1];
// Tag is used to distinguish different persistent cache tasks.
// Tag is used to distinguish different cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB)
uint64 piece_length = 7 [(validate.rules).uint64.gte = 4194304];
// Task content length.
uint64 content_length = 8;
// Task piece count.
uint32 piece_count = 9;
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 10 [(validate.rules).duration = {gte:{seconds: 300}, lte:{seconds: 604800}}];
// Task piece length.
uint64 piece_length = 7 [(validate.rules).uint64.gte = 1];
// TTL of the cache task.
google.protobuf.Duration ttl = 8 [(validate.rules).duration = {gte:{seconds: 60}, lte:{seconds: 604800}}];
// Upload timeout.
optional google.protobuf.Duration timeout = 9;
}
// UploadPersistentCacheTaskFinishedRequest represents upload persistent cache task finished request of UploadPersistentCacheTaskFinishedRequest.
message UploadPersistentCacheTaskFinishedRequest {
// StatCacheTaskRequest represents request of StatCacheTask.
message StatCacheTaskRequest {
// Task id.
string task_id = 1 [(validate.rules).string.min_len = 1];
}
// DeleteCacheTaskRequest represents request of DeleteCacheTask.
message DeleteCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
}
// UploadPersistentCacheTaskFailedRequest represents upload persistent cache task failed request of UploadPersistentCacheTaskFailedRequest.
message UploadPersistentCacheTaskFailedRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
// The description of the upload failed.
optional string description = 4 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Host id.
string host_id = 1 [(validate.rules).string.min_len = 1];
// Task id.
string task_id = 2 [(validate.rules).string.min_len = 1];
}
// PreheatImageRequest represents request of PreheatImage.
message PreheatImageRequest {
// URL is the image manifest url for preheating.
string url = 1 [(validate.rules).string.uri = true];
// Piece Length is the piece length(bytes) for downloading file. The value needs to
// be greater than 4MiB (4,194,304 bytes) and less than 64MiB (67,108,864 bytes),
// for example: 4194304(4mib), 8388608(8mib). If the piece length is not specified,
// the piece length will be calculated according to the file size.
optional uint64 piece_length = 2 [(validate.rules).uint64 = {gte: 4194304, lte: 67108864, ignore_empty: true}];
// Tag is the tag for preheating.
optional string tag = 3;
// Application is the application string for preheating.
optional string application = 4;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 5;
// Header is the http headers for authentication.
map<string, string> header = 6;
// Username is the username for authentication.
optional string username = 7;
// Password is the password for authentication.
optional string password = 8;
// Platform is the platform for preheating, such as linux/amd64, linux/arm64, etc.
optional string platform = 9;
// Scope is the scope for preheating, it can be one of the following values:
// - single_seed_peer: preheat from a single seed peer.
// - all_seed_peers: preheat from all seed peers.
// - all_peers: preheat from all available peers.
string scope = 10 [(validate.rules).string.pattern = "^(single_seed_peer|all_seed_peers|all_peers)$"];
// IPs is a list of specific peer IPs for preheating.
// This field has the highest priority: if provided, both 'Count' and 'Percentage' will be ignored.
// Applies to 'all_peers' and 'all_seed_peers' scopes.
repeated string ips = 11;
// Percentage is the percentage of available peers to preheat.
// This field has the lowest priority and is only used if both 'IPs' and 'Count' are not provided.
// It must be a value between 1 and 100 (inclusive) if provided.
// Applies to 'all_peers' and 'all_seed_peers' scopes.
optional uint32 percentage = 12 [(validate.rules).uint32 = {gte: 1, lte: 100, ignore_empty: true}];
// Count is the desired number of peers to preheat.
// This field is used only when 'IPs' is not specified. It has priority over 'Percentage'.
// It must be a value between 1 and 200 (inclusive) if provided.
// Applies to 'all_peers' and 'all_seed_peers' scopes.
optional uint32 count = 13 [(validate.rules).uint32 = {gte: 1, lte: 200, ignore_empty: true}];
// ConcurrentTaskCount specifies the maximum number of tasks (e.g., image layers) to preheat concurrently.
// For example, if preheating 100 layers with ConcurrentTaskCount set to 10, up to 10 layers are processed simultaneously.
// If ConcurrentPeerCount is 10 for 1000 peers, each layer is preheated by 10 peers concurrently.
// Default is 8, maximum is 100.
optional int64 concurrent_task_count = 14 [(validate.rules).int64 = {gte: 1, lte: 100, ignore_empty: true}];
// ConcurrentPeerCount specifies the maximum number of peers to preheat concurrently for a single task (e.g., an image layer).
// For example, if preheating a layer with ConcurrentPeerCount set to 10, up to 10 peers process that layer simultaneously.
// Default is 500, maximum is 1000.
optional int64 concurrent_peer_count = 15 [(validate.rules).int64 = {gte: 1, lte: 1000, ignore_empty: true}];
// Timeout is the timeout for preheating, default is 30 minutes.
optional google.protobuf.Duration timeout = 16;
// Preheat priority.
common.v2.Priority priority = 17 [(validate.rules).enum.defined_only = true];
// certificate_chain is the client certs with DER format for the backend client.
repeated bytes certificate_chain = 18;
// insecure_skip_verify indicates whether to skip TLS verification.
bool insecure_skip_verify = 19;
}
// StatImageRequest represents request of StatImage.
message StatImageRequest {
// URL is the image manifest url for preheating.
string url = 1 [(validate.rules).string.uri = true];
// Piece Length is the piece length(bytes) for downloading file. The value needs to
// be greater than 4MiB (4,194,304 bytes) and less than 64MiB (67,108,864 bytes),
// for example: 4194304(4mib), 8388608(8mib). If the piece length is not specified,
// the piece length will be calculated according to the file size.
optional uint64 piece_length = 2 [(validate.rules).uint64 = {gte: 4194304, lte: 67108864, ignore_empty: true}];
// Tag is the tag for preheating.
optional string tag = 3;
// Application is the application string for preheating.
optional string application = 4;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 5;
// Header is the http headers for authentication.
map<string, string> header = 6;
// Username is the username for authentication.
optional string username = 7;
// Password is the password for authentication.
optional string password = 8;
// Platform is the platform for preheating, such as linux/amd64, linux/arm64, etc.
optional string platform = 9;
// ConcurrentLayerCount specifies the maximum number of layers to get concurrently.
// For example, if stat 100 layers with ConcurrentLayerCount set to 10, up to 10 layers are processed simultaneously.
// If ConcurrentPeerCount is 10 for 1000 peers, each layer is stated by 10 peers concurrently.
// Default is 8, maximum is 100.
optional int64 concurrent_layer_count = 10 [(validate.rules).int64 = {gte: 1, lte: 100, ignore_empty: true}];
// ConcurrentPeerCount specifies the maximum number of peers stat concurrently for a single task (e.g., an image layer).
// For example, if stat a layer with ConcurrentPeerCount set to 10, up to 10 peers process that layer simultaneously.
// Default is 500, maximum is 1000.
optional int64 concurrent_peer_count = 11 [(validate.rules).int64 = {gte: 1, lte: 1000, ignore_empty: true}];
// Timeout is the timeout for preheating, default is 30 minutes.
optional google.protobuf.Duration timeout = 12;
// certificate_chain is the client certs with DER format for the backend client.
repeated bytes certificate_chain = 13;
// insecure_skip_verify indicates whether to skip TLS verification.
bool insecure_skip_verify = 14;
}
// StatImageResponse represents response of StatImage.
message StatImageResponse {
// Image is the image information.
Image image = 1;
// Peers is the peers that have downloaded the image.
repeated PeerImage peers = 2;
}
// PeerImage represents a peer in the get image job.
message PeerImage {
// IP is the IP address of the peer.
string ip = 1 [(validate.rules).string.ip = true];
// Hostname is the hostname of the peer.
string hostname = 2 [(validate.rules).string.min_len = 1];
// CachedLayers is the list of layers that the peer has downloaded.
repeated Layer cached_layers = 3;
}
// Image represents the image information.
message Image {
// Layers is the list of layers of the image.
repeated Layer layers = 1;
}
// Layer represents a layer of the image.
message Layer {
// URL is the URL of the layer.
string url = 1 [(validate.rules).string.uri = true];
}
// Scheduler RPC Service.
@ -742,12 +429,12 @@ service Scheduler {
// AnnounceHost announces host to scheduler.
rpc AnnounceHost(AnnounceHostRequest)returns(google.protobuf.Empty);
// ListHosts lists hosts in scheduler.
rpc ListHosts(google.protobuf.Empty)returns(ListHostsResponse);
// DeleteHost releases host in scheduler.
rpc DeleteHost(DeleteHostRequest)returns(google.protobuf.Empty);
// SyncProbes sync probes of the host.
rpc SyncProbes(stream SyncProbesRequest)returns(stream SyncProbesResponse);
// AnnounceCachePeer announces cache peer to scheduler.
rpc AnnounceCachePeer(stream AnnounceCachePeerRequest) returns(stream AnnounceCachePeerResponse);
@ -757,52 +444,12 @@ service Scheduler {
// DeleteCachePeer releases cache peer in scheduler.
rpc DeleteCachePeer(DeleteCachePeerRequest)returns(google.protobuf.Empty);
// UploadCacheTask uploads cache task to scheduler.
rpc UploadCacheTask(UploadCacheTaskRequest)returns(common.v2.CacheTask);
// Checks information of cache task.
rpc StatCacheTask(StatCacheTaskRequest)returns(common.v2.CacheTask);
// DeleteCacheTask releases cache task in scheduler.
rpc DeleteCacheTask(DeleteCacheTaskRequest)returns(google.protobuf.Empty);
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
rpc AnnouncePersistentCachePeer(stream AnnouncePersistentCachePeerRequest) returns(stream AnnouncePersistentCachePeerResponse);
// Checks information of persistent cache peer.
rpc StatPersistentCachePeer(StatPersistentCachePeerRequest)returns(common.v2.PersistentCachePeer);
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
rpc DeletePersistentCachePeer(DeletePersistentCachePeerRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
rpc UploadPersistentCacheTaskStarted(UploadPersistentCacheTaskStartedRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
rpc UploadPersistentCacheTaskFinished(UploadPersistentCacheTaskFinishedRequest)returns(common.v2.PersistentCacheTask);
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
rpc UploadPersistentCacheTaskFailed(UploadPersistentCacheTaskFailedRequest)returns(google.protobuf.Empty);
// Checks information of persistent cache task.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest)returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask releases persistent cache task in scheduler.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest)returns(google.protobuf.Empty);
// PreheatImage synchronously resolves an image manifest and triggers an asynchronous preheat task.
//
// This is a blocking call. The RPC will not return until the server has completed the
// initial synchronous work: resolving the image manifest and preparing all layer URLs.
//
// After this call successfully returns, a scheduler on the server begins the actual
// preheating process, instructing peers to download the layers in the background.
//
// A successful response (google.protobuf.Empty) confirms that the preparation is complete
// and the asynchronous download task has been scheduled.
rpc PreheatImage(PreheatImageRequest)returns(google.protobuf.Empty);
// StatImage provides detailed status for a container image's distribution in peers.
//
// This is a blocking call that first resolves the image manifest and then queries
// all peers to collect the image's download state across the network.
// The response includes both layer information and the status on each peer.
rpc StatImage(StatImageRequest)returns(StatImageResponse);
}

View File

@ -36,53 +36,22 @@ type SchedulerClient interface {
DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// AnnounceHost announces host to scheduler.
AnnounceHost(ctx context.Context, in *AnnounceHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// ListHosts lists hosts in scheduler.
ListHosts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListHostsResponse, error)
// DeleteHost releases host in scheduler.
DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error)
// AnnounceCachePeer announces cache peer to scheduler.
AnnounceCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnounceCachePeerClient, error)
// Checks information of cache peer.
StatCachePeer(ctx context.Context, in *StatCachePeerRequest, opts ...grpc.CallOption) (*v2.CachePeer, error)
// DeleteCachePeer releases cache peer in scheduler.
DeleteCachePeer(ctx context.Context, in *DeleteCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// UploadCacheTask uploads cache task to scheduler.
UploadCacheTask(ctx context.Context, in *UploadCacheTaskRequest, opts ...grpc.CallOption) (*v2.CacheTask, error)
// Checks information of cache task.
StatCacheTask(ctx context.Context, in *StatCacheTaskRequest, opts ...grpc.CallOption) (*v2.CacheTask, error)
// DeleteCacheTask releases cache task in scheduler.
DeleteCacheTask(ctx context.Context, in *DeleteCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
AnnouncePersistentCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentCachePeerClient, error)
// Checks information of persistent cache peer.
StatPersistentCachePeer(ctx context.Context, in *StatPersistentCachePeerRequest, opts ...grpc.CallOption) (*v2.PersistentCachePeer, error)
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
DeletePersistentCachePeer(ctx context.Context, in *DeletePersistentCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
UploadPersistentCacheTaskStarted(ctx context.Context, in *UploadPersistentCacheTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
UploadPersistentCacheTaskFinished(ctx context.Context, in *UploadPersistentCacheTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error)
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
UploadPersistentCacheTaskFailed(ctx context.Context, in *UploadPersistentCacheTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Checks information of persistent cache task.
StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error)
// DeletePersistentCacheTask releases persistent cache task in scheduler.
DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// PreheatImage synchronously resolves an image manifest and triggers an asynchronous preheat task.
//
// This is a blocking call. The RPC will not return until the server has completed the
// initial synchronous work: resolving the image manifest and preparing all layer URLs.
//
// After this call successfully returns, a scheduler on the server begins the actual
// preheating process, instructing peers to download the layers in the background.
//
// A successful response (google.protobuf.Empty) confirms that the preparation is complete
// and the asynchronous download task has been scheduled.
PreheatImage(ctx context.Context, in *PreheatImageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// StatImage provides detailed status for a container image's distribution in peers.
//
// This is a blocking call that first resolves the image manifest and then queries
// all peers to collect the image's download state across the network.
// The response includes both layer information and the status on each peer.
StatImage(ctx context.Context, in *StatImageRequest, opts ...grpc.CallOption) (*StatImageResponse, error)
}
type schedulerClient struct {
@ -169,15 +138,6 @@ func (c *schedulerClient) AnnounceHost(ctx context.Context, in *AnnounceHostRequ
return out, nil
}
func (c *schedulerClient) ListHosts(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListHostsResponse, error) {
out := new(ListHostsResponse)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/ListHosts", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) DeleteHost(ctx context.Context, in *DeleteHostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeleteHost", in, out, opts...)
@ -187,8 +147,39 @@ func (c *schedulerClient) DeleteHost(ctx context.Context, in *DeleteHostRequest,
return out, nil
}
func (c *schedulerClient) SyncProbes(ctx context.Context, opts ...grpc.CallOption) (Scheduler_SyncProbesClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[1], "/scheduler.v2.Scheduler/SyncProbes", opts...)
if err != nil {
return nil, err
}
x := &schedulerSyncProbesClient{stream}
return x, nil
}
type Scheduler_SyncProbesClient interface {
Send(*SyncProbesRequest) error
Recv() (*SyncProbesResponse, error)
grpc.ClientStream
}
type schedulerSyncProbesClient struct {
grpc.ClientStream
}
func (x *schedulerSyncProbesClient) Send(m *SyncProbesRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *schedulerSyncProbesClient) Recv() (*SyncProbesResponse, error) {
m := new(SyncProbesResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *schedulerClient) AnnounceCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnounceCachePeerClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[1], "/scheduler.v2.Scheduler/AnnounceCachePeer", opts...)
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[2], "/scheduler.v2.Scheduler/AnnounceCachePeer", opts...)
if err != nil {
return nil, err
}
@ -236,6 +227,15 @@ func (c *schedulerClient) DeleteCachePeer(ctx context.Context, in *DeleteCachePe
return out, nil
}
func (c *schedulerClient) UploadCacheTask(ctx context.Context, in *UploadCacheTaskRequest, opts ...grpc.CallOption) (*v2.CacheTask, error) {
out := new(v2.CacheTask)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadCacheTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) StatCacheTask(ctx context.Context, in *StatCacheTaskRequest, opts ...grpc.CallOption) (*v2.CacheTask, error) {
out := new(v2.CacheTask)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatCacheTask", in, out, opts...)
@ -254,118 +254,6 @@ func (c *schedulerClient) DeleteCacheTask(ctx context.Context, in *DeleteCacheTa
return out, nil
}
func (c *schedulerClient) AnnouncePersistentCachePeer(ctx context.Context, opts ...grpc.CallOption) (Scheduler_AnnouncePersistentCachePeerClient, error) {
stream, err := c.cc.NewStream(ctx, &Scheduler_ServiceDesc.Streams[2], "/scheduler.v2.Scheduler/AnnouncePersistentCachePeer", opts...)
if err != nil {
return nil, err
}
x := &schedulerAnnouncePersistentCachePeerClient{stream}
return x, nil
}
type Scheduler_AnnouncePersistentCachePeerClient interface {
Send(*AnnouncePersistentCachePeerRequest) error
Recv() (*AnnouncePersistentCachePeerResponse, error)
grpc.ClientStream
}
type schedulerAnnouncePersistentCachePeerClient struct {
grpc.ClientStream
}
func (x *schedulerAnnouncePersistentCachePeerClient) Send(m *AnnouncePersistentCachePeerRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *schedulerAnnouncePersistentCachePeerClient) Recv() (*AnnouncePersistentCachePeerResponse, error) {
m := new(AnnouncePersistentCachePeerResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *schedulerClient) StatPersistentCachePeer(ctx context.Context, in *StatPersistentCachePeerRequest, opts ...grpc.CallOption) (*v2.PersistentCachePeer, error) {
out := new(v2.PersistentCachePeer)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentCachePeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) DeletePersistentCachePeer(ctx context.Context, in *DeletePersistentCachePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentCachePeer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) UploadPersistentCacheTaskStarted(ctx context.Context, in *UploadPersistentCacheTaskStartedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) UploadPersistentCacheTaskFinished(ctx context.Context, in *UploadPersistentCacheTaskFinishedRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) {
out := new(v2.PersistentCacheTask)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) UploadPersistentCacheTaskFailed(ctx context.Context, in *UploadPersistentCacheTaskFailedRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) StatPersistentCacheTask(ctx context.Context, in *StatPersistentCacheTaskRequest, opts ...grpc.CallOption) (*v2.PersistentCacheTask, error) {
out := new(v2.PersistentCacheTask)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatPersistentCacheTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) DeletePersistentCacheTask(ctx context.Context, in *DeletePersistentCacheTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/DeletePersistentCacheTask", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) PreheatImage(ctx context.Context, in *PreheatImageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/PreheatImage", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *schedulerClient) StatImage(ctx context.Context, in *StatImageRequest, opts ...grpc.CallOption) (*StatImageResponse, error) {
out := new(StatImageResponse)
err := c.cc.Invoke(ctx, "/scheduler.v2.Scheduler/StatImage", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SchedulerServer is the server API for Scheduler service.
// All implementations should embed UnimplementedSchedulerServer
// for forward compatibility
@ -382,53 +270,22 @@ type SchedulerServer interface {
DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error)
// AnnounceHost announces host to scheduler.
AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error)
// ListHosts lists hosts in scheduler.
ListHosts(context.Context, *emptypb.Empty) (*ListHostsResponse, error)
// DeleteHost releases host in scheduler.
DeleteHost(context.Context, *DeleteHostRequest) (*emptypb.Empty, error)
// SyncProbes sync probes of the host.
SyncProbes(Scheduler_SyncProbesServer) error
// AnnounceCachePeer announces cache peer to scheduler.
AnnounceCachePeer(Scheduler_AnnounceCachePeerServer) error
// Checks information of cache peer.
StatCachePeer(context.Context, *StatCachePeerRequest) (*v2.CachePeer, error)
// DeleteCachePeer releases cache peer in scheduler.
DeleteCachePeer(context.Context, *DeleteCachePeerRequest) (*emptypb.Empty, error)
// UploadCacheTask uploads cache task to scheduler.
UploadCacheTask(context.Context, *UploadCacheTaskRequest) (*v2.CacheTask, error)
// Checks information of cache task.
StatCacheTask(context.Context, *StatCacheTaskRequest) (*v2.CacheTask, error)
// DeleteCacheTask releases cache task in scheduler.
DeleteCacheTask(context.Context, *DeleteCacheTaskRequest) (*emptypb.Empty, error)
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
AnnouncePersistentCachePeer(Scheduler_AnnouncePersistentCachePeerServer) error
// Checks information of persistent cache peer.
StatPersistentCachePeer(context.Context, *StatPersistentCachePeerRequest) (*v2.PersistentCachePeer, error)
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
DeletePersistentCachePeer(context.Context, *DeletePersistentCachePeerRequest) (*emptypb.Empty, error)
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
UploadPersistentCacheTaskStarted(context.Context, *UploadPersistentCacheTaskStartedRequest) (*emptypb.Empty, error)
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
UploadPersistentCacheTaskFinished(context.Context, *UploadPersistentCacheTaskFinishedRequest) (*v2.PersistentCacheTask, error)
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
UploadPersistentCacheTaskFailed(context.Context, *UploadPersistentCacheTaskFailedRequest) (*emptypb.Empty, error)
// Checks information of persistent cache task.
StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error)
// DeletePersistentCacheTask releases persistent cache task in scheduler.
DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error)
// PreheatImage synchronously resolves an image manifest and triggers an asynchronous preheat task.
//
// This is a blocking call. The RPC will not return until the server has completed the
// initial synchronous work: resolving the image manifest and preparing all layer URLs.
//
// After this call successfully returns, a scheduler on the server begins the actual
// preheating process, instructing peers to download the layers in the background.
//
// A successful response (google.protobuf.Empty) confirms that the preparation is complete
// and the asynchronous download task has been scheduled.
PreheatImage(context.Context, *PreheatImageRequest) (*emptypb.Empty, error)
// StatImage provides detailed status for a container image's distribution in peers.
//
// This is a blocking call that first resolves the image manifest and then queries
// all peers to collect the image's download state across the network.
// The response includes both layer information and the status on each peer.
StatImage(context.Context, *StatImageRequest) (*StatImageResponse, error)
}
// UnimplementedSchedulerServer should be embedded to have forward compatible implementations.
@ -453,12 +310,12 @@ func (UnimplementedSchedulerServer) DeleteTask(context.Context, *DeleteTaskReque
func (UnimplementedSchedulerServer) AnnounceHost(context.Context, *AnnounceHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method AnnounceHost not implemented")
}
func (UnimplementedSchedulerServer) ListHosts(context.Context, *emptypb.Empty) (*ListHostsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListHosts not implemented")
}
func (UnimplementedSchedulerServer) DeleteHost(context.Context, *DeleteHostRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteHost not implemented")
}
func (UnimplementedSchedulerServer) SyncProbes(Scheduler_SyncProbesServer) error {
return status.Errorf(codes.Unimplemented, "method SyncProbes not implemented")
}
func (UnimplementedSchedulerServer) AnnounceCachePeer(Scheduler_AnnounceCachePeerServer) error {
return status.Errorf(codes.Unimplemented, "method AnnounceCachePeer not implemented")
}
@ -468,42 +325,15 @@ func (UnimplementedSchedulerServer) StatCachePeer(context.Context, *StatCachePee
func (UnimplementedSchedulerServer) DeleteCachePeer(context.Context, *DeleteCachePeerRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteCachePeer not implemented")
}
func (UnimplementedSchedulerServer) UploadCacheTask(context.Context, *UploadCacheTaskRequest) (*v2.CacheTask, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadCacheTask not implemented")
}
func (UnimplementedSchedulerServer) StatCacheTask(context.Context, *StatCacheTaskRequest) (*v2.CacheTask, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatCacheTask not implemented")
}
func (UnimplementedSchedulerServer) DeleteCacheTask(context.Context, *DeleteCacheTaskRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteCacheTask not implemented")
}
func (UnimplementedSchedulerServer) AnnouncePersistentCachePeer(Scheduler_AnnouncePersistentCachePeerServer) error {
return status.Errorf(codes.Unimplemented, "method AnnouncePersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentCachePeer(context.Context, *StatPersistentCachePeerRequest) (*v2.PersistentCachePeer, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentCachePeer(context.Context, *DeletePersistentCachePeerRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCachePeer not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskStarted(context.Context, *UploadPersistentCacheTaskStartedRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskStarted not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskFinished(context.Context, *UploadPersistentCacheTaskFinishedRequest) (*v2.PersistentCacheTask, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskFinished not implemented")
}
func (UnimplementedSchedulerServer) UploadPersistentCacheTaskFailed(context.Context, *UploadPersistentCacheTaskFailedRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadPersistentCacheTaskFailed not implemented")
}
func (UnimplementedSchedulerServer) StatPersistentCacheTask(context.Context, *StatPersistentCacheTaskRequest) (*v2.PersistentCacheTask, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatPersistentCacheTask not implemented")
}
func (UnimplementedSchedulerServer) DeletePersistentCacheTask(context.Context, *DeletePersistentCacheTaskRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeletePersistentCacheTask not implemented")
}
func (UnimplementedSchedulerServer) PreheatImage(context.Context, *PreheatImageRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method PreheatImage not implemented")
}
func (UnimplementedSchedulerServer) StatImage(context.Context, *StatImageRequest) (*StatImageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatImage not implemented")
}
// UnsafeSchedulerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SchedulerServer will
@ -632,24 +462,6 @@ func _Scheduler_AnnounceHost_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
func _Scheduler_ListHosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).ListHosts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/ListHosts",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).ListHosts(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_DeleteHost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteHostRequest)
if err := dec(in); err != nil {
@ -668,6 +480,32 @@ func _Scheduler_DeleteHost_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler)
}
func _Scheduler_SyncProbes_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).SyncProbes(&schedulerSyncProbesServer{stream})
}
type Scheduler_SyncProbesServer interface {
Send(*SyncProbesResponse) error
Recv() (*SyncProbesRequest, error)
grpc.ServerStream
}
type schedulerSyncProbesServer struct {
grpc.ServerStream
}
func (x *schedulerSyncProbesServer) Send(m *SyncProbesResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *schedulerSyncProbesServer) Recv() (*SyncProbesRequest, error) {
m := new(SyncProbesRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Scheduler_AnnounceCachePeer_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).AnnounceCachePeer(&schedulerAnnounceCachePeerServer{stream})
}
@ -730,6 +568,24 @@ func _Scheduler_DeleteCachePeer_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
func _Scheduler_UploadCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadCacheTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).UploadCacheTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/UploadCacheTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).UploadCacheTask(ctx, req.(*UploadCacheTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_StatCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatCacheTaskRequest)
if err := dec(in); err != nil {
@ -766,194 +622,6 @@ func _Scheduler_DeleteCacheTask_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
func _Scheduler_AnnouncePersistentCachePeer_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SchedulerServer).AnnouncePersistentCachePeer(&schedulerAnnouncePersistentCachePeerServer{stream})
}
type Scheduler_AnnouncePersistentCachePeerServer interface {
Send(*AnnouncePersistentCachePeerResponse) error
Recv() (*AnnouncePersistentCachePeerRequest, error)
grpc.ServerStream
}
type schedulerAnnouncePersistentCachePeerServer struct {
grpc.ServerStream
}
func (x *schedulerAnnouncePersistentCachePeerServer) Send(m *AnnouncePersistentCachePeerResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *schedulerAnnouncePersistentCachePeerServer) Recv() (*AnnouncePersistentCachePeerRequest, error) {
m := new(AnnouncePersistentCachePeerRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Scheduler_StatPersistentCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatPersistentCachePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).StatPersistentCachePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/StatPersistentCachePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).StatPersistentCachePeer(ctx, req.(*StatPersistentCachePeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_DeletePersistentCachePeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePersistentCachePeerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).DeletePersistentCachePeer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/DeletePersistentCachePeer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).DeletePersistentCachePeer(ctx, req.(*DeletePersistentCachePeerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_UploadPersistentCacheTaskStarted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadPersistentCacheTaskStartedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).UploadPersistentCacheTaskStarted(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).UploadPersistentCacheTaskStarted(ctx, req.(*UploadPersistentCacheTaskStartedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_UploadPersistentCacheTaskFinished_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadPersistentCacheTaskFinishedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).UploadPersistentCacheTaskFinished(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).UploadPersistentCacheTaskFinished(ctx, req.(*UploadPersistentCacheTaskFinishedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_UploadPersistentCacheTaskFailed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadPersistentCacheTaskFailedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).UploadPersistentCacheTaskFailed(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).UploadPersistentCacheTaskFailed(ctx, req.(*UploadPersistentCacheTaskFailedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_StatPersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatPersistentCacheTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).StatPersistentCacheTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/StatPersistentCacheTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).StatPersistentCacheTask(ctx, req.(*StatPersistentCacheTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_DeletePersistentCacheTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeletePersistentCacheTaskRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).DeletePersistentCacheTask(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/DeletePersistentCacheTask",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).DeletePersistentCacheTask(ctx, req.(*DeletePersistentCacheTaskRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_PreheatImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PreheatImageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).PreheatImage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/PreheatImage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).PreheatImage(ctx, req.(*PreheatImageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Scheduler_StatImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatImageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SchedulerServer).StatImage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/scheduler.v2.Scheduler/StatImage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SchedulerServer).StatImage(ctx, req.(*StatImageRequest))
}
return interceptor(ctx, in, info, handler)
}
// Scheduler_ServiceDesc is the grpc.ServiceDesc for Scheduler service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -981,10 +649,6 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
MethodName: "AnnounceHost",
Handler: _Scheduler_AnnounceHost_Handler,
},
{
MethodName: "ListHosts",
Handler: _Scheduler_ListHosts_Handler,
},
{
MethodName: "DeleteHost",
Handler: _Scheduler_DeleteHost_Handler,
@ -997,6 +661,10 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
MethodName: "DeleteCachePeer",
Handler: _Scheduler_DeleteCachePeer_Handler,
},
{
MethodName: "UploadCacheTask",
Handler: _Scheduler_UploadCacheTask_Handler,
},
{
MethodName: "StatCacheTask",
Handler: _Scheduler_StatCacheTask_Handler,
@ -1005,42 +673,6 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
MethodName: "DeleteCacheTask",
Handler: _Scheduler_DeleteCacheTask_Handler,
},
{
MethodName: "StatPersistentCachePeer",
Handler: _Scheduler_StatPersistentCachePeer_Handler,
},
{
MethodName: "DeletePersistentCachePeer",
Handler: _Scheduler_DeletePersistentCachePeer_Handler,
},
{
MethodName: "UploadPersistentCacheTaskStarted",
Handler: _Scheduler_UploadPersistentCacheTaskStarted_Handler,
},
{
MethodName: "UploadPersistentCacheTaskFinished",
Handler: _Scheduler_UploadPersistentCacheTaskFinished_Handler,
},
{
MethodName: "UploadPersistentCacheTaskFailed",
Handler: _Scheduler_UploadPersistentCacheTaskFailed_Handler,
},
{
MethodName: "StatPersistentCacheTask",
Handler: _Scheduler_StatPersistentCacheTask_Handler,
},
{
MethodName: "DeletePersistentCacheTask",
Handler: _Scheduler_DeletePersistentCacheTask_Handler,
},
{
MethodName: "PreheatImage",
Handler: _Scheduler_PreheatImage_Handler,
},
{
MethodName: "StatImage",
Handler: _Scheduler_StatImage_Handler,
},
},
Streams: []grpc.StreamDesc{
{
@ -1050,14 +682,14 @@ var Scheduler_ServiceDesc = grpc.ServiceDesc{
ClientStreams: true,
},
{
StreamName: "AnnounceCachePeer",
Handler: _Scheduler_AnnounceCachePeer_Handler,
StreamName: "SyncProbes",
Handler: _Scheduler_SyncProbes_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "AnnouncePersistentCachePeer",
Handler: _Scheduler_AnnouncePersistentCachePeer_Handler,
StreamName: "AnnounceCachePeer",
Handler: _Scheduler_AnnounceCachePeer_Handler,
ServerStreams: true,
ClientStreams: true,
},

View File

@ -0,0 +1,264 @@
//
// Copyright 2022 The Dragonfly Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.6
// source: pkg/apis/security/v1/security.proto
package security
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Certificate request type.
// Dragonfly supports peers authentication with Mutual TLS(mTLS)
// For mTLS, all peers need to request TLS certificates for communicating
// The server side may overwrite ant requested certificate filed based on its policies.
type CertificateRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// ASN.1 DER form certificate request.
// The public key in the CSR is used to generate the certificate,
// and other fields in the generated certificate may be overwritten by the CA.
Csr []byte `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"`
// Optional: requested certificate validity period.
ValidityPeriod *durationpb.Duration `protobuf:"bytes,2,opt,name=validity_period,json=validityPeriod,proto3" json:"validity_period,omitempty"`
}
func (x *CertificateRequest) Reset() {
*x = CertificateRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertificateRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertificateRequest) ProtoMessage() {}
func (x *CertificateRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertificateRequest.ProtoReflect.Descriptor instead.
func (*CertificateRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_security_v1_security_proto_rawDescGZIP(), []int{0}
}
func (x *CertificateRequest) GetCsr() []byte {
if x != nil {
return x.Csr
}
return nil
}
func (x *CertificateRequest) GetValidityPeriod() *durationpb.Duration {
if x != nil {
return x.ValidityPeriod
}
return nil
}
// Certificate response type.
type CertificateResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// ASN.1 DER form certificate chain.
CertificateChain [][]byte `protobuf:"bytes,1,rep,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"`
}
func (x *CertificateResponse) Reset() {
*x = CertificateResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CertificateResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CertificateResponse) ProtoMessage() {}
func (x *CertificateResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_security_v1_security_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CertificateResponse.ProtoReflect.Descriptor instead.
func (*CertificateResponse) Descriptor() ([]byte, []int) {
return file_pkg_apis_security_v1_security_proto_rawDescGZIP(), []int{1}
}
func (x *CertificateResponse) GetCertificateChain() [][]byte {
if x != nil {
return x.CertificateChain
}
return nil
}
var File_pkg_apis_security_v1_security_proto protoreflect.FileDescriptor
var file_pkg_apis_security_v1_security_proto_rawDesc = []byte{
0x0a, 0x23, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72,
0x69, 0x74, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x1a,
0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7d, 0x0a, 0x12, 0x43, 0x65, 0x72, 0x74,
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19,
0x0a, 0x03, 0x63, 0x73, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04,
0x7a, 0x02, 0x10, 0x01, 0x52, 0x03, 0x63, 0x73, 0x72, 0x12, 0x4c, 0x0a, 0x0f, 0x76, 0x61, 0x6c,
0x69, 0x64, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa,
0x42, 0x05, 0xaa, 0x01, 0x02, 0x08, 0x01, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74,
0x79, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x4c, 0x0a, 0x13, 0x43, 0x65, 0x72, 0x74, 0x69,
0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35,
0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68,
0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01,
0x02, 0x08, 0x01, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
0x43, 0x68, 0x61, 0x69, 0x6e, 0x32, 0x60, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
0x63, 0x61, 0x74, 0x65, 0x12, 0x51, 0x0a, 0x10, 0x49, 0x73, 0x73, 0x75, 0x65, 0x43, 0x65, 0x72,
0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72,
0x69, 0x74, 0x79, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74,
0x79, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2d, 0x5a, 0x2b, 0x64, 0x37, 0x79, 0x2e, 0x69,
0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69,
0x73, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65,
0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_pkg_apis_security_v1_security_proto_rawDescOnce sync.Once
file_pkg_apis_security_v1_security_proto_rawDescData = file_pkg_apis_security_v1_security_proto_rawDesc
)
func file_pkg_apis_security_v1_security_proto_rawDescGZIP() []byte {
file_pkg_apis_security_v1_security_proto_rawDescOnce.Do(func() {
file_pkg_apis_security_v1_security_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_apis_security_v1_security_proto_rawDescData)
})
return file_pkg_apis_security_v1_security_proto_rawDescData
}
var file_pkg_apis_security_v1_security_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_pkg_apis_security_v1_security_proto_goTypes = []interface{}{
(*CertificateRequest)(nil), // 0: security.CertificateRequest
(*CertificateResponse)(nil), // 1: security.CertificateResponse
(*durationpb.Duration)(nil), // 2: google.protobuf.Duration
}
var file_pkg_apis_security_v1_security_proto_depIdxs = []int32{
2, // 0: security.CertificateRequest.validity_period:type_name -> google.protobuf.Duration
0, // 1: security.Certificate.IssueCertificate:input_type -> security.CertificateRequest
1, // 2: security.Certificate.IssueCertificate:output_type -> security.CertificateResponse
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_pkg_apis_security_v1_security_proto_init() }
func file_pkg_apis_security_v1_security_proto_init() {
if File_pkg_apis_security_v1_security_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_pkg_apis_security_v1_security_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertificateRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_security_v1_security_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertificateResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_security_v1_security_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_pkg_apis_security_v1_security_proto_goTypes,
DependencyIndexes: file_pkg_apis_security_v1_security_proto_depIdxs,
MessageInfos: file_pkg_apis_security_v1_security_proto_msgTypes,
}.Build()
File_pkg_apis_security_v1_security_proto = out.File
file_pkg_apis_security_v1_security_proto_rawDesc = nil
file_pkg_apis_security_v1_security_proto_goTypes = nil
file_pkg_apis_security_v1_security_proto_depIdxs = nil
}

View File

@ -0,0 +1,273 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: pkg/apis/security/v1/security.proto
package security
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on CertificateRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *CertificateRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CertificateRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CertificateRequestMultiError, or nil if none found.
func (m *CertificateRequest) ValidateAll() error {
return m.validate(true)
}
func (m *CertificateRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetCsr()) < 1 {
err := CertificateRequestValidationError{
field: "Csr",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if m.GetValidityPeriod() == nil {
err := CertificateRequestValidationError{
field: "ValidityPeriod",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CertificateRequestMultiError(errors)
}
return nil
}
// CertificateRequestMultiError is an error wrapping multiple validation errors
// returned by CertificateRequest.ValidateAll() if the designated constraints
// aren't met.
type CertificateRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CertificateRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CertificateRequestMultiError) AllErrors() []error { return m }
// CertificateRequestValidationError is the validation error returned by
// CertificateRequest.Validate if the designated constraints aren't met.
type CertificateRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CertificateRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CertificateRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CertificateRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CertificateRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CertificateRequestValidationError) ErrorName() string {
return "CertificateRequestValidationError"
}
// Error satisfies the builtin error interface
func (e CertificateRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCertificateRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CertificateRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CertificateRequestValidationError{}
// Validate checks the field values on CertificateResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *CertificateResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on CertificateResponse with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// CertificateResponseMultiError, or nil if none found.
func (m *CertificateResponse) ValidateAll() error {
return m.validate(true)
}
func (m *CertificateResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetCertificateChain()) < 1 {
err := CertificateResponseValidationError{
field: "CertificateChain",
reason: "value must contain at least 1 item(s)",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return CertificateResponseMultiError(errors)
}
return nil
}
// CertificateResponseMultiError is an error wrapping multiple validation
// errors returned by CertificateResponse.ValidateAll() if the designated
// constraints aren't met.
type CertificateResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m CertificateResponseMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m CertificateResponseMultiError) AllErrors() []error { return m }
// CertificateResponseValidationError is the validation error returned by
// CertificateResponse.Validate if the designated constraints aren't met.
type CertificateResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e CertificateResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e CertificateResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e CertificateResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e CertificateResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e CertificateResponseValidationError) ErrorName() string {
return "CertificateResponseValidationError"
}
// Error satisfies the builtin error interface
func (e CertificateResponseValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sCertificateResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = CertificateResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = CertificateResponseValidationError{}

View File

@ -0,0 +1,54 @@
/*
* Copyright 2022 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package security;
import "google/protobuf/duration.proto";
import "validate/validate.proto";
option go_package = "d7y.io/api/v2/pkg/apis/security/v1;security";
// Refer: https://github.com/istio/api/blob/master/security/v1alpha1/ca.proto
// Istio defines similar api for signing certificate, but it's not applicable in Dragonfly.
// Certificate request type.
// Dragonfly supports peers authentication with Mutual TLS(mTLS)
// For mTLS, all peers need to request TLS certificates for communicating
// The server side may overwrite ant requested certificate filed based on its policies.
message CertificateRequest {
// ASN.1 DER form certificate request.
// The public key in the CSR is used to generate the certificate,
// and other fields in the generated certificate may be overwritten by the CA.
bytes csr = 1 [(validate.rules).bytes.min_len = 1];
// Optional: requested certificate validity period.
google.protobuf.Duration validity_period = 2 [(validate.rules).duration.required = true];
}
// Certificate response type.
message CertificateResponse {
// ASN.1 DER form certificate chain.
repeated bytes certificate_chain = 1 [(validate.rules).repeated.min_items = 1];
}
// Service for managing certificates issued by the CA.
service Certificate {
// Using provided CSR, returns a signed certificate.
rpc IssueCertificate(CertificateRequest)
returns (CertificateResponse) {
}
}

View File

@ -0,0 +1,105 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.6
// source: pkg/apis/security/v1/security.proto
package security
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// CertificateClient is the client API for Certificate service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type CertificateClient interface {
// Using provided CSR, returns a signed certificate.
IssueCertificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error)
}
type certificateClient struct {
cc grpc.ClientConnInterface
}
func NewCertificateClient(cc grpc.ClientConnInterface) CertificateClient {
return &certificateClient{cc}
}
func (c *certificateClient) IssueCertificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificateResponse, error) {
out := new(CertificateResponse)
err := c.cc.Invoke(ctx, "/security.Certificate/IssueCertificate", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CertificateServer is the server API for Certificate service.
// All implementations should embed UnimplementedCertificateServer
// for forward compatibility
type CertificateServer interface {
// Using provided CSR, returns a signed certificate.
IssueCertificate(context.Context, *CertificateRequest) (*CertificateResponse, error)
}
// UnimplementedCertificateServer should be embedded to have forward compatible implementations.
type UnimplementedCertificateServer struct {
}
func (UnimplementedCertificateServer) IssueCertificate(context.Context, *CertificateRequest) (*CertificateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IssueCertificate not implemented")
}
// UnsafeCertificateServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CertificateServer will
// result in compilation errors.
type UnsafeCertificateServer interface {
mustEmbedUnimplementedCertificateServer()
}
func RegisterCertificateServer(s grpc.ServiceRegistrar, srv CertificateServer) {
s.RegisterService(&Certificate_ServiceDesc, srv)
}
func _Certificate_IssueCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CertificateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CertificateServer).IssueCertificate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/security.Certificate/IssueCertificate",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CertificateServer).IssueCertificate(ctx, req.(*CertificateRequest))
}
return interceptor(ctx, in, info, handler)
}
// Certificate_ServiceDesc is the grpc.ServiceDesc for Certificate service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Certificate_ServiceDesc = grpc.ServiceDesc{
ServiceName: "security.Certificate",
HandlerType: (*CertificateServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "IssueCertificate",
Handler: _Certificate_IssueCertificate_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "pkg/apis/security/v1/security.proto",
}

View File

@ -0,0 +1,19 @@
/*
* Copyright 2023 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package mocks
//go:generate mockgen -destination trainer_mock.go -source ../trainer_grpc.pb.go -package mocks

View File

@ -0,0 +1,406 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: ../trainer_grpc.pb.go
//
// Generated by this command:
//
// mockgen -destination trainer_mock.go -source ../trainer_grpc.pb.go -package mocks
//
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
trainer "d7y.io/api/v2/pkg/apis/trainer/v1"
gomock "go.uber.org/mock/gomock"
grpc "google.golang.org/grpc"
metadata "google.golang.org/grpc/metadata"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// MockTrainerClient is a mock of TrainerClient interface.
type MockTrainerClient struct {
ctrl *gomock.Controller
recorder *MockTrainerClientMockRecorder
}
// MockTrainerClientMockRecorder is the mock recorder for MockTrainerClient.
type MockTrainerClientMockRecorder struct {
mock *MockTrainerClient
}
// NewMockTrainerClient creates a new mock instance.
func NewMockTrainerClient(ctrl *gomock.Controller) *MockTrainerClient {
mock := &MockTrainerClient{ctrl: ctrl}
mock.recorder = &MockTrainerClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTrainerClient) EXPECT() *MockTrainerClientMockRecorder {
return m.recorder
}
// Train mocks base method.
func (m *MockTrainerClient) Train(ctx context.Context, opts ...grpc.CallOption) (trainer.Trainer_TrainClient, error) {
m.ctrl.T.Helper()
varargs := []any{ctx}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Train", varargs...)
ret0, _ := ret[0].(trainer.Trainer_TrainClient)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Train indicates an expected call of Train.
func (mr *MockTrainerClientMockRecorder) Train(ctx any, opts ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{ctx}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Train", reflect.TypeOf((*MockTrainerClient)(nil).Train), varargs...)
}
// MockTrainer_TrainClient is a mock of Trainer_TrainClient interface.
type MockTrainer_TrainClient struct {
ctrl *gomock.Controller
recorder *MockTrainer_TrainClientMockRecorder
}
// MockTrainer_TrainClientMockRecorder is the mock recorder for MockTrainer_TrainClient.
type MockTrainer_TrainClientMockRecorder struct {
mock *MockTrainer_TrainClient
}
// NewMockTrainer_TrainClient creates a new mock instance.
func NewMockTrainer_TrainClient(ctrl *gomock.Controller) *MockTrainer_TrainClient {
mock := &MockTrainer_TrainClient{ctrl: ctrl}
mock.recorder = &MockTrainer_TrainClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTrainer_TrainClient) EXPECT() *MockTrainer_TrainClientMockRecorder {
return m.recorder
}
// CloseAndRecv mocks base method.
func (m *MockTrainer_TrainClient) CloseAndRecv() (*emptypb.Empty, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseAndRecv")
ret0, _ := ret[0].(*emptypb.Empty)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CloseAndRecv indicates an expected call of CloseAndRecv.
func (mr *MockTrainer_TrainClientMockRecorder) CloseAndRecv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseAndRecv", reflect.TypeOf((*MockTrainer_TrainClient)(nil).CloseAndRecv))
}
// CloseSend mocks base method.
func (m *MockTrainer_TrainClient) CloseSend() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CloseSend")
ret0, _ := ret[0].(error)
return ret0
}
// CloseSend indicates an expected call of CloseSend.
func (mr *MockTrainer_TrainClientMockRecorder) CloseSend() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockTrainer_TrainClient)(nil).CloseSend))
}
// Context mocks base method.
func (m *MockTrainer_TrainClient) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockTrainer_TrainClientMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockTrainer_TrainClient)(nil).Context))
}
// Header mocks base method.
func (m *MockTrainer_TrainClient) Header() (metadata.MD, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Header")
ret0, _ := ret[0].(metadata.MD)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Header indicates an expected call of Header.
func (mr *MockTrainer_TrainClientMockRecorder) Header() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockTrainer_TrainClient)(nil).Header))
}
// RecvMsg mocks base method.
func (m_2 *MockTrainer_TrainClient) RecvMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockTrainer_TrainClientMockRecorder) RecvMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockTrainer_TrainClient)(nil).RecvMsg), m)
}
// Send mocks base method.
func (m *MockTrainer_TrainClient) Send(arg0 *trainer.TrainRequest) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Send indicates an expected call of Send.
func (mr *MockTrainer_TrainClientMockRecorder) Send(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockTrainer_TrainClient)(nil).Send), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockTrainer_TrainClient) SendMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockTrainer_TrainClientMockRecorder) SendMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockTrainer_TrainClient)(nil).SendMsg), m)
}
// Trailer mocks base method.
func (m *MockTrainer_TrainClient) Trailer() metadata.MD {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Trailer")
ret0, _ := ret[0].(metadata.MD)
return ret0
}
// Trailer indicates an expected call of Trailer.
func (mr *MockTrainer_TrainClientMockRecorder) Trailer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockTrainer_TrainClient)(nil).Trailer))
}
// MockTrainerServer is a mock of TrainerServer interface.
type MockTrainerServer struct {
ctrl *gomock.Controller
recorder *MockTrainerServerMockRecorder
}
// MockTrainerServerMockRecorder is the mock recorder for MockTrainerServer.
type MockTrainerServerMockRecorder struct {
mock *MockTrainerServer
}
// NewMockTrainerServer creates a new mock instance.
func NewMockTrainerServer(ctrl *gomock.Controller) *MockTrainerServer {
mock := &MockTrainerServer{ctrl: ctrl}
mock.recorder = &MockTrainerServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTrainerServer) EXPECT() *MockTrainerServerMockRecorder {
return m.recorder
}
// Train mocks base method.
func (m *MockTrainerServer) Train(arg0 trainer.Trainer_TrainServer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Train", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Train indicates an expected call of Train.
func (mr *MockTrainerServerMockRecorder) Train(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Train", reflect.TypeOf((*MockTrainerServer)(nil).Train), arg0)
}
// MockUnsafeTrainerServer is a mock of UnsafeTrainerServer interface.
type MockUnsafeTrainerServer struct {
ctrl *gomock.Controller
recorder *MockUnsafeTrainerServerMockRecorder
}
// MockUnsafeTrainerServerMockRecorder is the mock recorder for MockUnsafeTrainerServer.
type MockUnsafeTrainerServerMockRecorder struct {
mock *MockUnsafeTrainerServer
}
// NewMockUnsafeTrainerServer creates a new mock instance.
func NewMockUnsafeTrainerServer(ctrl *gomock.Controller) *MockUnsafeTrainerServer {
mock := &MockUnsafeTrainerServer{ctrl: ctrl}
mock.recorder = &MockUnsafeTrainerServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockUnsafeTrainerServer) EXPECT() *MockUnsafeTrainerServerMockRecorder {
return m.recorder
}
// mustEmbedUnimplementedTrainerServer mocks base method.
func (m *MockUnsafeTrainerServer) mustEmbedUnimplementedTrainerServer() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "mustEmbedUnimplementedTrainerServer")
}
// mustEmbedUnimplementedTrainerServer indicates an expected call of mustEmbedUnimplementedTrainerServer.
func (mr *MockUnsafeTrainerServerMockRecorder) mustEmbedUnimplementedTrainerServer() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "mustEmbedUnimplementedTrainerServer", reflect.TypeOf((*MockUnsafeTrainerServer)(nil).mustEmbedUnimplementedTrainerServer))
}
// MockTrainer_TrainServer is a mock of Trainer_TrainServer interface.
type MockTrainer_TrainServer struct {
ctrl *gomock.Controller
recorder *MockTrainer_TrainServerMockRecorder
}
// MockTrainer_TrainServerMockRecorder is the mock recorder for MockTrainer_TrainServer.
type MockTrainer_TrainServerMockRecorder struct {
mock *MockTrainer_TrainServer
}
// NewMockTrainer_TrainServer creates a new mock instance.
func NewMockTrainer_TrainServer(ctrl *gomock.Controller) *MockTrainer_TrainServer {
mock := &MockTrainer_TrainServer{ctrl: ctrl}
mock.recorder = &MockTrainer_TrainServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTrainer_TrainServer) EXPECT() *MockTrainer_TrainServerMockRecorder {
return m.recorder
}
// Context mocks base method.
func (m *MockTrainer_TrainServer) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockTrainer_TrainServerMockRecorder) Context() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockTrainer_TrainServer)(nil).Context))
}
// Recv mocks base method.
func (m *MockTrainer_TrainServer) Recv() (*trainer.TrainRequest, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Recv")
ret0, _ := ret[0].(*trainer.TrainRequest)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Recv indicates an expected call of Recv.
func (mr *MockTrainer_TrainServerMockRecorder) Recv() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockTrainer_TrainServer)(nil).Recv))
}
// RecvMsg mocks base method.
func (m_2 *MockTrainer_TrainServer) RecvMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "RecvMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// RecvMsg indicates an expected call of RecvMsg.
func (mr *MockTrainer_TrainServerMockRecorder) RecvMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockTrainer_TrainServer)(nil).RecvMsg), m)
}
// SendAndClose mocks base method.
func (m *MockTrainer_TrainServer) SendAndClose(arg0 *emptypb.Empty) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendAndClose", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendAndClose indicates an expected call of SendAndClose.
func (mr *MockTrainer_TrainServerMockRecorder) SendAndClose(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAndClose", reflect.TypeOf((*MockTrainer_TrainServer)(nil).SendAndClose), arg0)
}
// SendHeader mocks base method.
func (m *MockTrainer_TrainServer) SendHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SendHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SendHeader indicates an expected call of SendHeader.
func (mr *MockTrainer_TrainServerMockRecorder) SendHeader(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockTrainer_TrainServer)(nil).SendHeader), arg0)
}
// SendMsg mocks base method.
func (m_2 *MockTrainer_TrainServer) SendMsg(m any) error {
m_2.ctrl.T.Helper()
ret := m_2.ctrl.Call(m_2, "SendMsg", m)
ret0, _ := ret[0].(error)
return ret0
}
// SendMsg indicates an expected call of SendMsg.
func (mr *MockTrainer_TrainServerMockRecorder) SendMsg(m any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockTrainer_TrainServer)(nil).SendMsg), m)
}
// SetHeader mocks base method.
func (m *MockTrainer_TrainServer) SetHeader(arg0 metadata.MD) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetHeader", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetHeader indicates an expected call of SetHeader.
func (mr *MockTrainer_TrainServerMockRecorder) SetHeader(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockTrainer_TrainServer)(nil).SetHeader), arg0)
}
// SetTrailer mocks base method.
func (m *MockTrainer_TrainServer) SetTrailer(arg0 metadata.MD) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetTrailer", arg0)
}
// SetTrailer indicates an expected call of SetTrailer.
func (mr *MockTrainer_TrainServerMockRecorder) SetTrailer(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockTrainer_TrainServer)(nil).SetTrailer), arg0)
}

View File

@ -0,0 +1,376 @@
//
// Copyright 2023 The Dragonfly Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.6
// source: pkg/apis/trainer/v1/trainer.proto
package trainer
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// TrainGNNRequest represents to train GNN model request of TrainRequest.
type TrainGNNRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Dataset of training GNN.
Dataset []byte `protobuf:"bytes,1,opt,name=dataset,proto3" json:"dataset,omitempty"`
}
func (x *TrainGNNRequest) Reset() {
*x = TrainGNNRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_trainer_v1_trainer_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TrainGNNRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TrainGNNRequest) ProtoMessage() {}
func (x *TrainGNNRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_trainer_v1_trainer_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TrainGNNRequest.ProtoReflect.Descriptor instead.
func (*TrainGNNRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_trainer_v1_trainer_proto_rawDescGZIP(), []int{0}
}
func (x *TrainGNNRequest) GetDataset() []byte {
if x != nil {
return x.Dataset
}
return nil
}
// TrainMLPRequest represents to train MLP model request of TrainRequest.
type TrainMLPRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Dataset of training MLP.
Dataset []byte `protobuf:"bytes,1,opt,name=dataset,proto3" json:"dataset,omitempty"`
}
func (x *TrainMLPRequest) Reset() {
*x = TrainMLPRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_trainer_v1_trainer_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TrainMLPRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TrainMLPRequest) ProtoMessage() {}
func (x *TrainMLPRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_trainer_v1_trainer_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TrainMLPRequest.ProtoReflect.Descriptor instead.
func (*TrainMLPRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_trainer_v1_trainer_proto_rawDescGZIP(), []int{1}
}
func (x *TrainMLPRequest) GetDataset() []byte {
if x != nil {
return x.Dataset
}
return nil
}
// TrainRequest represents request of Train.
type TrainRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Scheduler hostname.
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
// Scheduler ip.
Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
// Types that are assignable to Request:
//
// *TrainRequest_TrainGnnRequest
// *TrainRequest_TrainMlpRequest
Request isTrainRequest_Request `protobuf_oneof:"request"`
}
func (x *TrainRequest) Reset() {
*x = TrainRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_trainer_v1_trainer_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TrainRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TrainRequest) ProtoMessage() {}
func (x *TrainRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_trainer_v1_trainer_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TrainRequest.ProtoReflect.Descriptor instead.
func (*TrainRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_trainer_v1_trainer_proto_rawDescGZIP(), []int{2}
}
func (x *TrainRequest) GetHostname() string {
if x != nil {
return x.Hostname
}
return ""
}
func (x *TrainRequest) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
func (m *TrainRequest) GetRequest() isTrainRequest_Request {
if m != nil {
return m.Request
}
return nil
}
func (x *TrainRequest) GetTrainGnnRequest() *TrainGNNRequest {
if x, ok := x.GetRequest().(*TrainRequest_TrainGnnRequest); ok {
return x.TrainGnnRequest
}
return nil
}
func (x *TrainRequest) GetTrainMlpRequest() *TrainMLPRequest {
if x, ok := x.GetRequest().(*TrainRequest_TrainMlpRequest); ok {
return x.TrainMlpRequest
}
return nil
}
type isTrainRequest_Request interface {
isTrainRequest_Request()
}
type TrainRequest_TrainGnnRequest struct {
TrainGnnRequest *TrainGNNRequest `protobuf:"bytes,3,opt,name=train_gnn_request,json=trainGnnRequest,proto3,oneof"`
}
type TrainRequest_TrainMlpRequest struct {
TrainMlpRequest *TrainMLPRequest `protobuf:"bytes,4,opt,name=train_mlp_request,json=trainMlpRequest,proto3,oneof"`
}
func (*TrainRequest_TrainGnnRequest) isTrainRequest_Request() {}
func (*TrainRequest_TrainMlpRequest) isTrainRequest_Request() {}
var File_pkg_apis_trainer_v1_trainer_proto protoreflect.FileDescriptor
var file_pkg_apis_trainer_v1_trainer_proto_rawDesc = []byte{
0x0a, 0x21, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x69, 0x6e,
0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a,
0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x47, 0x4e,
0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x07, 0x64, 0x61, 0x74, 0x61,
0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02,
0x10, 0x01, 0x52, 0x07, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x22, 0x34, 0x0a, 0x0f, 0x54,
0x72, 0x61, 0x69, 0x6e, 0x4d, 0x4c, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21,
0x0a, 0x07, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42,
0x07, 0xfa, 0x42, 0x04, 0x7a, 0x02, 0x10, 0x01, 0x52, 0x07, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65,
0x74, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x68,
0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x70, 0x01, 0x52, 0x02, 0x69, 0x70,
0x12, 0x49, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x5f, 0x67, 0x6e, 0x6e, 0x5f, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x72,
0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x47, 0x4e,
0x4e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x69,
0x6e, 0x47, 0x6e, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x11, 0x74,
0x72, 0x61, 0x69, 0x6e, 0x5f, 0x6d, 0x6c, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x65, 0x72,
0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x4d, 0x4c, 0x50, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x4d, 0x6c, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x32, 0x46, 0x0a, 0x07, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x65,
0x72, 0x12, 0x3b, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x12, 0x18, 0x2e, 0x74, 0x72, 0x61,
0x69, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x01, 0x42, 0x2b,
0x5a, 0x29, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f,
0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x65, 0x72,
0x2f, 0x76, 0x31, 0x3b, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_pkg_apis_trainer_v1_trainer_proto_rawDescOnce sync.Once
file_pkg_apis_trainer_v1_trainer_proto_rawDescData = file_pkg_apis_trainer_v1_trainer_proto_rawDesc
)
func file_pkg_apis_trainer_v1_trainer_proto_rawDescGZIP() []byte {
file_pkg_apis_trainer_v1_trainer_proto_rawDescOnce.Do(func() {
file_pkg_apis_trainer_v1_trainer_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_apis_trainer_v1_trainer_proto_rawDescData)
})
return file_pkg_apis_trainer_v1_trainer_proto_rawDescData
}
var file_pkg_apis_trainer_v1_trainer_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_pkg_apis_trainer_v1_trainer_proto_goTypes = []interface{}{
(*TrainGNNRequest)(nil), // 0: trainer.v1.TrainGNNRequest
(*TrainMLPRequest)(nil), // 1: trainer.v1.TrainMLPRequest
(*TrainRequest)(nil), // 2: trainer.v1.TrainRequest
(*emptypb.Empty)(nil), // 3: google.protobuf.Empty
}
var file_pkg_apis_trainer_v1_trainer_proto_depIdxs = []int32{
0, // 0: trainer.v1.TrainRequest.train_gnn_request:type_name -> trainer.v1.TrainGNNRequest
1, // 1: trainer.v1.TrainRequest.train_mlp_request:type_name -> trainer.v1.TrainMLPRequest
2, // 2: trainer.v1.Trainer.Train:input_type -> trainer.v1.TrainRequest
3, // 3: trainer.v1.Trainer.Train:output_type -> google.protobuf.Empty
3, // [3:4] is the sub-list for method output_type
2, // [2:3] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_pkg_apis_trainer_v1_trainer_proto_init() }
func file_pkg_apis_trainer_v1_trainer_proto_init() {
if File_pkg_apis_trainer_v1_trainer_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_pkg_apis_trainer_v1_trainer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainGNNRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_trainer_v1_trainer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainMLPRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_pkg_apis_trainer_v1_trainer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_pkg_apis_trainer_v1_trainer_proto_msgTypes[2].OneofWrappers = []interface{}{
(*TrainRequest_TrainGnnRequest)(nil),
(*TrainRequest_TrainMlpRequest)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_trainer_v1_trainer_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_pkg_apis_trainer_v1_trainer_proto_goTypes,
DependencyIndexes: file_pkg_apis_trainer_v1_trainer_proto_depIdxs,
MessageInfos: file_pkg_apis_trainer_v1_trainer_proto_msgTypes,
}.Build()
File_pkg_apis_trainer_v1_trainer_proto = out.File
file_pkg_apis_trainer_v1_trainer_proto_rawDesc = nil
file_pkg_apis_trainer_v1_trainer_proto_goTypes = nil
file_pkg_apis_trainer_v1_trainer_proto_depIdxs = nil
}

View File

@ -0,0 +1,479 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: pkg/apis/trainer/v1/trainer.proto
package trainer
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"sort"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = sort.Sort
)
// Validate checks the field values on TrainGNNRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *TrainGNNRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on TrainGNNRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// TrainGNNRequestMultiError, or nil if none found.
func (m *TrainGNNRequest) ValidateAll() error {
return m.validate(true)
}
func (m *TrainGNNRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetDataset()) < 1 {
err := TrainGNNRequestValidationError{
field: "Dataset",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return TrainGNNRequestMultiError(errors)
}
return nil
}
// TrainGNNRequestMultiError is an error wrapping multiple validation errors
// returned by TrainGNNRequest.ValidateAll() if the designated constraints
// aren't met.
type TrainGNNRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m TrainGNNRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m TrainGNNRequestMultiError) AllErrors() []error { return m }
// TrainGNNRequestValidationError is the validation error returned by
// TrainGNNRequest.Validate if the designated constraints aren't met.
type TrainGNNRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e TrainGNNRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e TrainGNNRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e TrainGNNRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e TrainGNNRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e TrainGNNRequestValidationError) ErrorName() string { return "TrainGNNRequestValidationError" }
// Error satisfies the builtin error interface
func (e TrainGNNRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sTrainGNNRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = TrainGNNRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = TrainGNNRequestValidationError{}
// Validate checks the field values on TrainMLPRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *TrainMLPRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on TrainMLPRequest with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// TrainMLPRequestMultiError, or nil if none found.
func (m *TrainMLPRequest) ValidateAll() error {
return m.validate(true)
}
func (m *TrainMLPRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(m.GetDataset()) < 1 {
err := TrainMLPRequestValidationError{
field: "Dataset",
reason: "value length must be at least 1 bytes",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return TrainMLPRequestMultiError(errors)
}
return nil
}
// TrainMLPRequestMultiError is an error wrapping multiple validation errors
// returned by TrainMLPRequest.ValidateAll() if the designated constraints
// aren't met.
type TrainMLPRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m TrainMLPRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m TrainMLPRequestMultiError) AllErrors() []error { return m }
// TrainMLPRequestValidationError is the validation error returned by
// TrainMLPRequest.Validate if the designated constraints aren't met.
type TrainMLPRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e TrainMLPRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e TrainMLPRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e TrainMLPRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e TrainMLPRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e TrainMLPRequestValidationError) ErrorName() string { return "TrainMLPRequestValidationError" }
// Error satisfies the builtin error interface
func (e TrainMLPRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sTrainMLPRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = TrainMLPRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = TrainMLPRequestValidationError{}
// Validate checks the field values on TrainRequest with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *TrainRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on TrainRequest with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in TrainRequestMultiError, or
// nil if none found.
func (m *TrainRequest) ValidateAll() error {
return m.validate(true)
}
func (m *TrainRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if utf8.RuneCountInString(m.GetHostname()) < 1 {
err := TrainRequestValidationError{
field: "Hostname",
reason: "value length must be at least 1 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if ip := net.ParseIP(m.GetIp()); ip == nil {
err := TrainRequestValidationError{
field: "Ip",
reason: "value must be a valid IP address",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent := false
switch v := m.Request.(type) {
case *TrainRequest_TrainGnnRequest:
if v == nil {
err := TrainRequestValidationError{
field: "Request",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent = true
if all {
switch v := interface{}(m.GetTrainGnnRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, TrainRequestValidationError{
field: "TrainGnnRequest",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, TrainRequestValidationError{
field: "TrainGnnRequest",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetTrainGnnRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TrainRequestValidationError{
field: "TrainGnnRequest",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *TrainRequest_TrainMlpRequest:
if v == nil {
err := TrainRequestValidationError{
field: "Request",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent = true
if all {
switch v := interface{}(m.GetTrainMlpRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, TrainRequestValidationError{
field: "TrainMlpRequest",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, TrainRequestValidationError{
field: "TrainMlpRequest",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetTrainMlpRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return TrainRequestValidationError{
field: "TrainMlpRequest",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
_ = v // ensures v is used
}
if !oneofRequestPresent {
err := TrainRequestValidationError{
field: "Request",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if len(errors) > 0 {
return TrainRequestMultiError(errors)
}
return nil
}
// TrainRequestMultiError is an error wrapping multiple validation errors
// returned by TrainRequest.ValidateAll() if the designated constraints aren't met.
type TrainRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m TrainRequestMultiError) Error() string {
var msgs []string
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m TrainRequestMultiError) AllErrors() []error { return m }
// TrainRequestValidationError is the validation error returned by
// TrainRequest.Validate if the designated constraints aren't met.
type TrainRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e TrainRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e TrainRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e TrainRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e TrainRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e TrainRequestValidationError) ErrorName() string { return "TrainRequestValidationError" }
// Error satisfies the builtin error interface
func (e TrainRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sTrainRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = TrainRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = TrainRequestValidationError{}

View File

@ -0,0 +1,57 @@
/*
* Copyright 2023 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package trainer.v1;
import "google/protobuf/empty.proto";
import "validate/validate.proto";
option go_package = "d7y.io/api/v2/pkg/apis/trainer/v1;trainer";
// TrainGNNRequest represents to train GNN model request of TrainRequest.
message TrainGNNRequest {
// Dataset of training GNN.
bytes dataset = 1 [(validate.rules).bytes.min_len = 1];
}
// TrainMLPRequest represents to train MLP model request of TrainRequest.
message TrainMLPRequest {
// Dataset of training MLP.
bytes dataset = 1 [(validate.rules).bytes.min_len = 1];
}
// TrainRequest represents request of Train.
message TrainRequest {
// Scheduler hostname.
string hostname = 1 [(validate.rules).string.min_len = 1];
// Scheduler ip.
string ip = 2 [(validate.rules).string.ip = true];
oneof request {
option (validate.required) = true;
TrainGNNRequest train_gnn_request = 3;
TrainMLPRequest train_mlp_request = 4;
}
}
// Trainer RPC Service.
service Trainer {
// Train trains models of scheduler using dataset.
rpc Train(stream TrainRequest) returns(google.protobuf.Empty);
}

View File

@ -0,0 +1,140 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.6
// source: pkg/apis/trainer/v1/trainer.proto
package trainer
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// TrainerClient is the client API for Trainer service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type TrainerClient interface {
// Train trains models of scheduler using dataset.
Train(ctx context.Context, opts ...grpc.CallOption) (Trainer_TrainClient, error)
}
type trainerClient struct {
cc grpc.ClientConnInterface
}
func NewTrainerClient(cc grpc.ClientConnInterface) TrainerClient {
return &trainerClient{cc}
}
func (c *trainerClient) Train(ctx context.Context, opts ...grpc.CallOption) (Trainer_TrainClient, error) {
stream, err := c.cc.NewStream(ctx, &Trainer_ServiceDesc.Streams[0], "/trainer.v1.Trainer/Train", opts...)
if err != nil {
return nil, err
}
x := &trainerTrainClient{stream}
return x, nil
}
type Trainer_TrainClient interface {
Send(*TrainRequest) error
CloseAndRecv() (*emptypb.Empty, error)
grpc.ClientStream
}
type trainerTrainClient struct {
grpc.ClientStream
}
func (x *trainerTrainClient) Send(m *TrainRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *trainerTrainClient) CloseAndRecv() (*emptypb.Empty, error) {
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
m := new(emptypb.Empty)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// TrainerServer is the server API for Trainer service.
// All implementations should embed UnimplementedTrainerServer
// for forward compatibility
type TrainerServer interface {
// Train trains models of scheduler using dataset.
Train(Trainer_TrainServer) error
}
// UnimplementedTrainerServer should be embedded to have forward compatible implementations.
type UnimplementedTrainerServer struct {
}
func (UnimplementedTrainerServer) Train(Trainer_TrainServer) error {
return status.Errorf(codes.Unimplemented, "method Train not implemented")
}
// UnsafeTrainerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TrainerServer will
// result in compilation errors.
type UnsafeTrainerServer interface {
mustEmbedUnimplementedTrainerServer()
}
func RegisterTrainerServer(s grpc.ServiceRegistrar, srv TrainerServer) {
s.RegisterService(&Trainer_ServiceDesc, srv)
}
func _Trainer_Train_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(TrainerServer).Train(&trainerTrainServer{stream})
}
type Trainer_TrainServer interface {
SendAndClose(*emptypb.Empty) error
Recv() (*TrainRequest, error)
grpc.ServerStream
}
type trainerTrainServer struct {
grpc.ServerStream
}
func (x *trainerTrainServer) SendAndClose(m *emptypb.Empty) error {
return x.ServerStream.SendMsg(m)
}
func (x *trainerTrainServer) Recv() (*TrainRequest, error) {
m := new(TrainRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Trainer_ServiceDesc is the grpc.ServiceDesc for Trainer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Trainer_ServiceDesc = grpc.ServiceDesc{
ServiceName: "trainer.v1.Trainer",
HandlerType: (*TrainerServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Train",
Handler: _Trainer_Train_Handler,
ClientStreams: true,
},
},
Metadata: "pkg/apis/trainer/v1/trainer.proto",
}

View File

@ -38,31 +38,18 @@ enum SizeScope {
// TaskType represents type of task.
enum TaskType {
// STANDARD is standard type of task, it can download from source, remote peer and
// local peer(local cache). When the standard task is never downloaded in the
// P2P cluster, dfdaemon will download the task from the source. When the standard
// task is downloaded in the P2P cluster, dfdaemon will download the task from
// the remote peer or local peer(local cache), where peers use disk storage to store tasks.
STANDARD = 0;
// DFDAEMON is dfdeamon type of task,
// dfdeamon task is a normal p2p task.
DFDAEMON = 0;
// PERSISTENT is persistent type of task, it can import file and export file in P2P cluster.
// When the persistent task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to
// prevent data loss.
PERSISTENT = 1;
// DFCACHE is dfcache type of task,
// dfcache task is a cache task, and the task url is fake url.
// It can only be used for caching and cannot be downloaded back to source.
DFCACHE = 1;
// PERSISTENT_CACHE is persistent cache type of task, it can import file and export file in P2P cluster.
// When the persistent cache task is imported into the P2P cluster, dfdaemon will store
// the task in the peer's disk and copy multiple replicas to remote peers to prevent data loss.
// When the expiration time is reached, task will be deleted in the P2P cluster.
PERSISTENT_CACHE = 2;
// CACHE is cache type of task, it can download from source, remote peer and
// local peer(local cache). When the cache task is never downloaded in the
// P2P cluster, dfdaemon will download the cache task from the source. When the cache
// task is downloaded in the P2P cluster, dfdaemon will download the cache task from
// the remote peer or local peer(local cache), where peers use memory storage to store cache tasks.
CACHE = 3;
// DFSTORE is dfstore type of task,
// dfstore task is a persistent task in backend.
DFSTORE = 2;
}
// TrafficType represents type of traffic.
@ -143,43 +130,16 @@ message Peer {
message CachePeer {
// Peer id.
string id = 1;
// Range is url range of request.
optional Range range = 2;
// Peer priority.
Priority priority = 3;
// Pieces of peer.
repeated Piece pieces = 4;
// Peer downloads costs time.
google.protobuf.Duration cost = 5;
// Peer state.
string state = 6;
// Cache Task info.
CacheTask task = 7;
// Host info.
Host host = 8;
// NeedBackToSource needs downloaded from source.
bool need_back_to_source = 9;
// Peer create time.
google.protobuf.Timestamp created_at = 10;
// Peer update time.
google.protobuf.Timestamp updated_at = 11;
}
// PersistentCachePeer metadata.
message PersistentCachePeer {
// Peer id.
string id = 1;
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
// Persistent represents whether the cache peer is persistent.
// If the cache peer is persistent, the cache peer will
// not be deleted when dfdamon runs garbage collection.
bool persistent = 2;
// Peer downloads costs time.
google.protobuf.Duration cost = 3;
// Peer state.
string state = 4;
// Persistent task info.
PersistentCacheTask task = 5;
// Task info.
CacheTask task = 5;
// Host info.
Host host = 6;
// Peer create time.
@ -196,12 +156,7 @@ message Task {
TaskType type = 2;
// Download url.
string url = 3;
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
optional string digest = 4;
// URL tag identifies different task for same url.
optional string tag = 5;
@ -215,89 +170,39 @@ message Task {
repeated string filtered_query_params = 7;
// Task request headers.
map<string, string> request_header = 8;
// Task piece length.
uint64 piece_length = 9;
// Task content length.
uint64 content_length = 9;
uint64 content_length = 10;
// Task piece count.
uint32 piece_count = 10;
uint32 piece_count = 11;
// Task size scope.
SizeScope size_scope = 11;
SizeScope size_scope = 12;
// Pieces of task.
repeated Piece pieces = 12;
repeated Piece pieces = 13;
// Task state.
string state = 13;
string state = 14;
// Task peer count.
uint32 peer_count = 14;
uint32 peer_count = 15;
// Task contains available peer.
bool has_available_peer = 15;
bool has_available_peer = 16;
// Task create time.
google.protobuf.Timestamp created_at = 16;
google.protobuf.Timestamp created_at = 17;
// Task update time.
google.protobuf.Timestamp updated_at = 17;
google.protobuf.Timestamp updated_at = 18;
}
// CacheTask metadata.
message CacheTask {
// Task id.
string id = 1;
// Task type.
TaskType type = 2;
// Download url.
string url = 3;
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 4;
// URL tag identifies different task for same url.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 7;
// Task request headers.
map<string, string> request_header = 8;
// Task content length.
uint64 content_length = 9;
// Task piece count.
uint32 piece_count = 10;
// Task size scope.
SizeScope size_scope = 11;
// Pieces of task.
repeated Piece pieces = 12;
// Task state.
string state = 13;
// Task peer count.
uint32 peer_count = 14;
// Task contains available peer.
bool has_available_peer = 15;
// Task create time.
google.protobuf.Timestamp created_at = 16;
// Task update time.
google.protobuf.Timestamp updated_at = 17;
}
// PersistentCacheTask metadata.
message PersistentCacheTask {
// Task id.
string id = 1;
// Replica count of the persistent cache task. The persistent cache task will
// not be deleted when dfdamon runs garbage collection. It only be deleted
// when the task is deleted by the user.
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 2;
// Current replica count of the persistent cache task. The persistent cache task
// will not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 current_persistent_replica_count = 3;
// Current replica count of the cache task. If cache task is not persistent,
// the persistent cache task will be deleted when dfdaemon runs garbage collection.
uint64 current_replica_count = 4;
// Tag is used to distinguish different persistent cache tasks.
// Replica count of the cache task.
uint64 replica_count = 3;
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
string digest = 4;
// Tag is used to distinguish different cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
@ -309,7 +214,7 @@ message PersistentCacheTask {
uint32 piece_count = 9;
// Task state.
string state = 10;
// TTL of the persistent cache task.
// TTL of the cache task.
google.protobuf.Duration ttl = 11;
// Task create time.
google.protobuf.Timestamp created_at = 12;
@ -353,10 +258,6 @@ message Host {
optional Build build = 16;
// ID of the cluster to which the host belongs.
uint64 scheduler_cluster_id = 17;
// Disable shared data for other peers.
bool disable_shared = 18;
// Port of proxy server.
int32 proxy_port = 19;
}
// CPU Stat.
@ -424,23 +325,6 @@ message Network {
optional string location = 3;
// IDC where the peer host is located
optional string idc = 4;
// Maximum bandwidth of the network interface, in bps (bits per second).
uint64 max_rx_bandwidth = 9;
// Receive bandwidth of the network interface, in bps (bits per second).
optional uint64 rx_bandwidth = 10;
// Maximum bandwidth of the network interface for transmission, in bps (bits per second).
uint64 max_tx_bandwidth = 11;
// Transmit bandwidth of the network interface, in bps (bits per second).
optional uint64 tx_bandwidth = 12;
reserved 5;
reserved "download_rate";
reserved 6;
reserved "download_rate_limit";
reserved 7;
reserved "upload_rate";
reserved 8;
reserved "upload_rate_limit";
}
// Disk Stat.
@ -461,10 +345,6 @@ message Disk {
uint64 inodes_free = 7;
// Used percent of indoes on the data path of dragonfly directory.
double inodes_used_percent = 8;
// Disk read bandwidth, in bytes per second.
uint64 read_bandwidth = 9;
// Disk write bandwidth, in bytes per second.
uint64 write_bandwidth = 10;
}
// Build information.
@ -508,70 +388,19 @@ message Download {
// Task request headers.
map<string, string> request_header = 9;
// Task piece length.
optional uint64 piece_length = 10;
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
uint64 piece_length = 10;
// File path to be exported.
optional string output_path = 11;
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
// Dfdaemon will disable download back-to-source by itself, if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
// Scheduler will triggers peer to download back-to-source, if need_back_to_source is true.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
// prefetch pre-downloads all pieces of the task when download task with range request.
bool prefetch = 16;
// Object storage protocol information.
optional ObjectStorage object_storage = 17;
// HDFS protocol information.
optional HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// force_hard_link is the flag to indicate whether the download file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 22;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 23;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 24;
reserved 21;
reserved "load_to_cache";
}
// Object Storage related information.
message ObjectStorage {
// Region is the region of the object storage service.
optional string region = 1;
// Endpoint is the endpoint of the object storage service.
optional string endpoint = 2;
// Access key that used to access the object storage service.
optional string access_key_id = 3;
// Access secret that used to access the object storage service.
optional string access_key_secret = 4;
// Session token that used to access s3 storage service.
optional string session_token = 5;
// Local path to credential file for Google Cloud Storage service OAuth2 authentication.
optional string credential_path = 6;
// Predefined ACL that used for the Google Cloud Storage service.
optional string predefined_acl = 7;
// Temporary STS security token for accessing OSS.
optional string security_token = 8;
}
// HDFS related information.
message HDFS {
// Delegation token for Web HDFS operator.
optional string delegation_token = 1;
}
// Range represents download range.

View File

@ -43,9 +43,6 @@ message DownloadTaskStartedResponse {
// Need to download pieces.
repeated common.v2.Piece pieces = 4;
// is_finished indicates whether the download task is finished.
bool is_finished = 5;
}
// DownloadPieceFinishedResponse represents piece download finished response of DownloadTaskResponse.
@ -103,153 +100,40 @@ message DownloadPieceRequest{
message DownloadPieceResponse {
// Piece information.
common.v2.Piece piece = 1;
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2;
}
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2;
// local_only specifies whether to query task information from local client only.
// If true, the query will be restricted to the local client.
// By default (false), the query may be forwarded to the scheduler
// for a cluster-wide search.
bool local_only = 3;
}
// ListTaskEntriesRequest represents request of ListTaskEntries.
message ListTaskEntriesRequest {
// Task id.
string task_id = 1;
// URL to be listed the entries.
string url = 2;
// HTTP header to be sent with the request.
map<string, string> request_header = 3;
// List timeout.
optional google.protobuf.Duration timeout = 4;
// certificate_chain is the client certs with DER format for the backend client to list the entries.
repeated bytes certificate_chain = 5;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 6;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 7;
// Remote IP represents the IP address of the client initiating the list request.
optional string remote_ip = 8;
}
// ListTaskEntriesResponse represents response of ListTaskEntries.
message ListTaskEntriesResponse {
// Content length is the content length of the response
uint64 content_length = 1;
// HTTP header to be sent with the request.
map<string, string> response_header = 2;
// Backend HTTP status code.
optional int32 status_code = 3;
/// Entries is the information of the entries in the directory.
repeated Entry entries = 4;
}
// Entry represents an entry in a directory.
message Entry {
// URL of the entry.
string url = 1;
// Size of the entry.
uint64 content_length = 2;
// Is directory or not.
bool is_dir = 3;
}
// DeleteTaskRequest represents request of DeleteTask.
message DeleteTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2;
}
// DownloadCacheTaskRequest represents request of DownloadCacheTask.
message DownloadCacheTaskRequest {
// Download url.
string url = 1;
// Digest of the task digest, for example :xxx or sha256:yyy.
optional string digest = 2;
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
optional common.v2.Range range = 3;
// Task type.
common.v2.TaskType type = 4;
// URL tag identifies different task for same url.
optional string tag = 5;
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Tag is used to distinguish different cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 6;
// Peer priority.
common.v2.Priority priority = 7;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 8;
// Task request headers.
map<string, string> request_header = 9;
optional string application = 4;
// Task piece length.
optional uint64 piece_length = 10;
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 11;
uint64 piece_length = 5;
// File path to be exported.
string output_path = 6;
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
bool prefetch = 16;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 17;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 21;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 22;
optional google.protobuf.Duration timeout = 7;
}
// DownloadCacheTaskStartedResponse represents cache task download started response of DownloadCacheTaskResponse.
message DownloadCacheTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
// Range is url range of request. If protocol is http, range
// is parsed from http header. If other protocol, range comes
// from download range field.
optional common.v2.Range range = 2;
// Task response headers.
map<string, string> response_header = 3;
// Need to download pieces.
repeated common.v2.Piece pieces = 4;
// is_finished indicates whether the download task is finished.
bool is_finished = 5;
}
// DownloadCacheTaskStartedResponse represents task download started response of DownloadCacheTaskResponse.
message DownloadCacheTaskStartedResponse {}
// DownloadCacheTaskResponse represents response of DownloadCacheTask.
message DownloadCacheTaskResponse {
@ -266,253 +150,41 @@ message DownloadCacheTaskResponse {
}
}
// SyncCachePiecesRequest represents request of SyncCachePieces.
message SyncCachePiecesRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Interested piece numbers.
repeated uint32 interested_cache_piece_numbers = 3;
}
// SyncCachePiecesResponse represents response of SyncCachePieces.
message SyncCachePiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
}
// DownloadCachePieceRequest represents request of DownloadCachePiece.
message DownloadCachePieceRequest{
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Piece number.
uint32 piece_number = 3;
}
// DownloadCachePieceResponse represents response of DownloadCachePieces.
message DownloadCachePieceResponse {
// Piece information.
common.v2.Piece piece = 1;
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2;
// UploadCacheTaskRequest represents request of UploadCacheTask.
message UploadCacheTaskRequest {
// Upload file path of cache task.
string path = 1;
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 2;
// Tag is used to distinguish different cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 4;
// Task piece length.
uint64 piece_length = 5;
// TTL of the cache task.
google.protobuf.Duration ttl = 6;
// Upload timeout.
optional google.protobuf.Duration timeout = 7;
}
// StatCacheTaskRequest represents request of StatCacheTask.
message StatCacheTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2;
// local_only specifies whether to query task information from local client only.
// If true, the query will be restricted to the local client.
// By default (false), the query may be forwarded to the scheduler
// for a cluster-wide search.
bool local_only = 3;
}
// DeleteCacheTaskRequest represents request of DeleteCacheTask.
message DeleteCacheTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2;
}
// DownloadPersistentCacheTaskRequest represents request of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 2;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 4;
// File path to be exported. If output_path is set, the exported file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the export. If hard link creation fails,
// it will copy the file to the output path after the export is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 5;
// Download timeout.
optional google.protobuf.Duration timeout = 6;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 7;
// force_hard_link is the flag to indicate whether the exported file must be hard linked to the output path.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
bool force_hard_link = 8;
// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
// Returns an error if the computed digest mismatches the expected value.
//
// Performance
// Digest calculation increases processing time. Enable only when data integrity verification is critical.
optional string digest = 9;
// Remote IP represents the IP address of the client initiating the download request.
optional string remote_ip = 10;
}
// DownloadPersistentCacheTaskStartedResponse represents task download started response of DownloadPersistentCacheTaskResponse.
message DownloadPersistentCacheTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
}
// DownloadPersistentCacheTaskResponse represents response of DownloadPersistentCacheTask.
message DownloadPersistentCacheTaskResponse {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
oneof response {
DownloadPersistentCacheTaskStartedResponse download_persistent_cache_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
}
}
// UploadPersistentCacheTaskRequest represents request of UploadPersistentCacheTask.
message UploadPersistentCacheTaskRequest {
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on the file content, tag and application by crc32 algorithm`.
optional string content_for_calculating_task_id = 1;
// Upload file path of persistent cache task.
string path = 2;
// Replica count of the persistent persistent cache task.
uint64 persistent_replica_count = 3;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 4;
// Application of the persistent cache task.
optional string application = 5;
// Piece length of the persistent cache task, the value needs to be greater than or equal to 4194304(4MiB).
optional uint64 piece_length = 6;
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 7;
// Download timeout.
optional google.protobuf.Duration timeout = 8;
// Remote IP represents the IP address of the client initiating the upload request.
optional string remote_ip = 9;
}
// UpdatePersistentCacheTaskRequest represents request of UpdatePersistentCacheTask.
message UpdatePersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Remote IP represents the IP address of the client initiating the list request.
optional string remote_ip = 3;
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the stat request.
optional string remote_ip = 2;
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Task id.
string task_id = 1;
// Remote IP represents the IP address of the client initiating the delete request.
optional string remote_ip = 2;
}
// SyncPersistentCachePiecesRequest represents request of SyncPersistentCachePieces.
message SyncPersistentCachePiecesRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Interested piece numbers.
repeated uint32 interested_piece_numbers = 3;
}
// SyncPersistentCachePiecesResponse represents response of SyncPersistentCachePieces.
message SyncPersistentCachePiecesResponse {
// Exist piece number.
uint32 number = 1;
// Piece offset.
uint64 offset = 2;
// Piece length.
uint64 length = 3;
}
// DownloadPersistentCachePieceRequest represents request of DownloadPersistentCachePiece.
message DownloadPersistentCachePieceRequest{
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Piece number.
uint32 piece_number = 3;
}
// DownloadPersistentCachePieceResponse represents response of DownloadPersistentCachePieces.
message DownloadPersistentCachePieceResponse {
// Piece information.
common.v2.Piece piece = 1;
// Piece metadata digest, it is used to verify the integrity of the piece metadata.
optional string digest = 2;
}
// SyncHostRequest represents request of SyncHost.
message SyncHostRequest {
// Host id.
string host_id = 1;
// Peer id.
string peer_id = 2;
}
// IBVerbsQueuePairEndpoint represents queue pair endpoint of IBVerbs.
message IBVerbsQueuePairEndpoint {
// Number of the queue pair.
uint32 num = 1;
// Local identifier of the context.
uint32 lid = 2;
// Global identifier of the context.
bytes gid = 3;
}
// ExchangeIBVerbsQueuePairEndpointRequest represents request of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointRequest {
// Information of the source's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1;
}
// ExchangeIBVerbsQueuePairEndpointResponse represents response of ExchangeIBVerbsQueuePairEndpoint.
message ExchangeIBVerbsQueuePairEndpointResponse {
// Information of the destination's queue pair endpoint of IBVerbs.
IBVerbsQueuePairEndpoint endpoint = 1;
}
// DfdaemonUpload represents upload service of dfdaemon.
service DfdaemonUpload {
service DfdaemonUpload{
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// SyncPieces syncs piece metadatas from remote peer.
rpc SyncPieces(SyncPiecesRequest) returns(stream SyncPiecesResponse);
@ -527,70 +199,31 @@ service DfdaemonUpload {
// DeleteCacheTask deletes cache task from p2p network.
rpc DeleteCacheTask(DeleteCacheTaskRequest) returns(google.protobuf.Empty);
// SyncCachePieces syncs cache piece metadatas from remote peer.
rpc SyncCachePieces(SyncCachePiecesRequest) returns(stream SyncCachePiecesResponse);
// DownloadCachePiece downloads cache piece from the remote peer.
rpc DownloadCachePiece(DownloadCachePieceRequest)returns(DownloadCachePieceResponse);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
rpc UpdatePersistentCacheTask(UpdatePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask deletes persistent cache task from p2p network.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest) returns(google.protobuf.Empty);
// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
rpc SyncPersistentCachePieces(SyncPersistentCachePiecesRequest) returns(stream SyncPersistentCachePiecesResponse);
// DownloadPersistentCachePiece downloads persistent cache piece from p2p network.
rpc DownloadPersistentCachePiece(DownloadPersistentCachePieceRequest)returns(DownloadPersistentCachePieceResponse);
// SyncHost sync host info from parents.
rpc SyncHost(SyncHostRequest) returns (stream common.v2.Host);
// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
rpc ExchangeIBVerbsQueuePairEndpoint(ExchangeIBVerbsQueuePairEndpointRequest) returns(ExchangeIBVerbsQueuePairEndpointResponse);
}
// DfdaemonDownload represents download service of dfdaemon.
service DfdaemonDownload {
service DfdaemonDownload{
// DownloadTask downloads task from p2p network.
rpc DownloadTask(DownloadTaskRequest) returns(stream DownloadTaskResponse);
// StatTask stats task information.
rpc StatTask(StatTaskRequest) returns(common.v2.Task);
// ListTaskEntries lists task entries for downloading directory.
rpc ListTaskEntries(ListTaskEntriesRequest) returns(ListTaskEntriesResponse);
// DeleteTask deletes task from p2p network.
rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty);
// DeleteHost releases host in scheduler.
rpc DeleteHost(google.protobuf.Empty)returns(google.protobuf.Empty);
// DownloadCacheTask downloads cache task from p2p network.
// DownloadCacheTask downloads cache task from p2p network.
rpc DownloadCacheTask(DownloadCacheTaskRequest) returns(stream DownloadCacheTaskResponse);
// UploadCacheTask uploads cache task to p2p network.
rpc UploadCacheTask(UploadCacheTaskRequest) returns(common.v2.CacheTask);
// StatCacheTask stats cache task information.
rpc StatCacheTask(StatCacheTaskRequest) returns(common.v2.CacheTask);
// DeleteCacheTask deletes cache task from p2p network.
rpc DeleteCacheTask(DeleteCacheTaskRequest) returns(google.protobuf.Empty);
// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
rpc DownloadPersistentCacheTask(DownloadPersistentCacheTaskRequest) returns(stream DownloadPersistentCacheTaskResponse);
// UploadPersistentCacheTask uploads persistent cache task to p2p network.
rpc UploadPersistentCacheTask(UploadPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
// StatPersistentCacheTask stats persistent cache task information.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest) returns(common.v2.PersistentCacheTask);
}

View File

@ -25,11 +25,5 @@ message Backend {
// Backend HTTP response header.
map<string, string> header = 2;
// Backend HTTP status code.
optional int32 status_code = 3;
}
// Unknown is error detail for Unknown.
message Unknown {
// Unknown error message.
optional string message = 1;
int32 status_code = 3;
}

View File

@ -209,10 +209,6 @@ message UpdateSchedulerRequest {
string ip = 6;
// Scheduler port.
int32 port = 7;
// Scheduler features.
repeated string features = 8;
// Scheduler Configuration.
bytes config = 9;
}
// ListSchedulersRequest represents request of ListSchedulers.
@ -231,8 +227,6 @@ message ListSchedulersRequest {
string version = 6;
// Dfdaemon commit.
string commit = 7;
// ID of the cluster to which the scheduler belongs.
uint64 scheduler_cluster_id = 8;
}
// ListSchedulersResponse represents response of ListSchedulers.
@ -287,6 +281,28 @@ message ListApplicationsResponse {
repeated Application applications = 1;
}
// CreateGNNRequest represents to create GNN model request of TrainRequest.
message CreateGNNRequest {
// Protocol buffer file of model.
bytes data = 1;
// Recall of the model.
double recall = 2;
// Precision of the model.
double precision = 3;
// F1-Score of the model.
double f1_score = 4;
}
// CreateMLPRequest represents to create MLP model request of TrainRequest.
message CreateMLPRequest {
// Protocol buffer file of model.
bytes data = 1;
// MSE of the model.
double mse = 2;
// MAE of the model.
double mae = 3;
}
// KeepAliveRequest represents request of KeepAlive.
message KeepAliveRequest {
// Request source type.

View File

@ -105,7 +105,6 @@ message DownloadPieceBackToSourceFailedRequest {
oneof response {
errordetails.v2.Backend backend = 2;
errordetails.v2.Unknown unknown = 3;
}
}
@ -181,10 +180,8 @@ message DeletePeerRequest {
// StatTaskRequest represents request of StatTask.
message StatTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
string task_id = 1;
}
// DeleteTaskRequest represents request of DeleteTask.
@ -199,14 +196,6 @@ message DeleteTaskRequest {
message AnnounceHostRequest {
// Host information.
common.v2.Host host = 1;
// The interval between dfdaemon announces to scheduler.
optional google.protobuf.Duration interval = 2;
}
// ListHostsResponse represents response of ListHosts.
message ListHostsResponse {
// Hosts info.
repeated common.v2.Host hosts = 1;
}
// DeleteHostRequest represents request of DeleteHost.
@ -215,99 +204,93 @@ message DeleteHostRequest{
string host_id = 1;
}
// ProbeStartedRequest represents started request of SyncProbesRequest.
message ProbeStartedRequest {
}
// Probe information.
message Probe {
// Destination host metadata.
common.v2.Host host = 1;
// RTT is the round-trip time sent via this pinger.
google.protobuf.Duration rtt = 2;
// Probe create time.
google.protobuf.Timestamp created_at = 3;
}
// ProbeFinishedRequest represents finished request of SyncProbesRequest.
message ProbeFinishedRequest {
// Probes information.
repeated Probe probes = 1;
}
// FailedProbe information.
message FailedProbe {
// Destination host metadata.
common.v2.Host host = 1;
// The description of probing failed.
optional string description = 2;
}
// ProbeFailedRequest represents failed request of SyncProbesRequest.
message ProbeFailedRequest {
// Failed probes information.
repeated FailedProbe probes = 1;
}
// SyncProbesRequest represents request of SyncProbes.
message SyncProbesRequest {
// Source host metadata.
common.v2.Host host = 1;
oneof request {
ProbeStartedRequest probe_started_request = 2;
ProbeFinishedRequest probe_finished_request = 3;
ProbeFailedRequest probe_failed_request = 4;
}
}
// SyncProbesResponse represents response of SyncProbes.
message SyncProbesResponse {
// Hosts needs to be probed.
repeated common.v2.Host hosts = 1;
}
// RegisterCachePeerRequest represents cache peer registered request of AnnounceCachePeerRequest.
message RegisterCachePeerRequest {
// Download url.
string url = 1;
// Digest of the task digest, for example :xxx or sha256:yyy.
optional string digest = 2;
// Range is url range of request. If protocol is http, range
// will set in request header. If protocol is others, range
// will set in range field.
optional common.v2.Range range = 3;
// Task type.
common.v2.TaskType type = 4;
// URL tag identifies different task for same url.
optional string tag = 5;
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Tag is used to distinguish different cache tasks.
optional string tag = 3;
// Application of task.
optional string application = 6;
// Peer priority.
common.v2.Priority priority = 7;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 8;
// Task request headers.
map<string, string> request_header = 9;
optional string application = 4;
// Task piece length.
optional uint64 piece_length = 10;
// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
// it will copy the file to the output path after the download is completed.
// For more details refer to https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.
optional string output_path = 11;
uint64 piece_length = 5;
// File path to be exported.
string output_path = 6;
// Download timeout.
optional google.protobuf.Duration timeout = 12;
// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
bool disable_back_to_source = 13;
// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
bool need_back_to_source = 14;
// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
repeated bytes certificate_chain = 15;
// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
bool prefetch = 16;
// Object storage protocol information.
optional common.v2.ObjectStorage object_storage = 17;
// HDFS protocol information.
optional common.v2.HDFS hdfs = 18;
// is_prefetch is the flag to indicate whether the request is a prefetch request.
bool is_prefetch = 19;
// need_piece_content is the flag to indicate whether the response needs to return piece content.
bool need_piece_content = 20;
// content_for_calculating_task_id is the content used to calculate the task id.
// If content_for_calculating_task_id is set, use its value to calculate the task ID.
// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
optional string content_for_calculating_task_id = 21;
// remote_ip represents the IP address of the client initiating the download request.
// For proxy requests, it is set to the IP address of the request source.
// For dfget requests, it is set to the IP address of the dfget.
optional string remote_ip = 22;
optional google.protobuf.Duration timeout = 7;
}
// DownloadCachePeerStartedRequest represents cache peer download started request of AnnounceCachePeerRequest.
message DownloadCachePeerStartedRequest {
}
// DownloadCachePeerBackToSourceStartedRequest represents cache peer download back-to-source started request of AnnounceCachePeerRequest.
message DownloadCachePeerBackToSourceStartedRequest {
// The description of the back-to-source reason.
optional string description = 1;
}
// RescheduleCachePeerRequest represents reschedule request of AnnounceCachePeerRequest.
message RescheduleCachePeerRequest {
// Candidate parent ids.
repeated common.v2.CachePeer candidate_parents = 1;
// The description of the reschedule reason.
optional string description = 2;
}
// DownloadCachePeerFinishedRequest represents cache peer download finished request of AnnounceCachePeerRequest.
message DownloadCachePeerFinishedRequest {
// Total content length.
uint64 content_length = 1;
// Total piece count.
uint32 piece_count = 2;
}
// DownloadCachePeerBackToSourceFinishedRequest represents cache peer download back-to-source finished request of AnnounceCachePeerRequest.
message DownloadCachePeerBackToSourceFinishedRequest {
// Total content length.
uint64 content_length = 1;
// Total piece count.
uint32 piece_count = 2;
uint32 piece_count = 1;
}
// DownloadCachePeerFailedRequest represents cache peer download failed request of AnnounceCachePeerRequest.
@ -316,12 +299,6 @@ message DownloadCachePeerFailedRequest {
optional string description = 1;
}
// DownloadCachePeerBackToSourceFailedRequest represents cache peer download back-to-source failed request of AnnounceCachePeerRequest.
message DownloadCachePeerBackToSourceFailedRequest {
// The description of the download back-to-source failed.
optional string description = 1;
}
// AnnounceCachePeerRequest represents request of AnnounceCachePeer.
message AnnounceCachePeerRequest {
// Host id.
@ -334,16 +311,11 @@ message AnnounceCachePeerRequest {
oneof request {
RegisterCachePeerRequest register_cache_peer_request = 4;
DownloadCachePeerStartedRequest download_cache_peer_started_request = 5;
DownloadCachePeerBackToSourceStartedRequest download_cache_peer_back_to_source_started_request = 6;
RescheduleCachePeerRequest reschedule_cache_peer_request = 7;
DownloadCachePeerFinishedRequest download_cache_peer_finished_request = 8;
DownloadCachePeerBackToSourceFinishedRequest download_cache_peer_back_to_source_finished_request = 9;
DownloadCachePeerFailedRequest download_cache_peer_failed_request = 10;
DownloadCachePeerBackToSourceFailedRequest download_cache_peer_back_to_source_failed_request = 11;
DownloadPieceFinishedRequest download_piece_finished_request = 12;
DownloadPieceBackToSourceFinishedRequest download_piece_back_to_source_finished_request = 13;
DownloadPieceFailedRequest download_piece_failed_request = 14;
DownloadPieceBackToSourceFailedRequest download_piece_back_to_source_failed_request = 15;
RescheduleCachePeerRequest reschedule_cache_peer_request = 6;
DownloadCachePeerFinishedRequest download_cache_peer_finished_request = 7;
DownloadCachePeerFailedRequest download_cache_peer_failed_request = 8;
DownloadPieceFinishedRequest download_piece_finished_request = 9;
DownloadPieceFailedRequest download_piece_failed_request = 10;
}
}
@ -354,15 +326,14 @@ message EmptyCacheTaskResponse {
// NormalCacheTaskResponse represents normal cache task response of AnnounceCachePeerResponse.
message NormalCacheTaskResponse {
// Candidate parents.
repeated common.v2.CachePeer candidate_parents = 1;
repeated common.v2.CachePeer candidate_cache_parents = 1;
}
// AnnounceCachePeerResponse represents response of AnnounceCachePeer.
message AnnounceCachePeerResponse {
oneof response {
EmptyCacheTaskResponse empty_cache_task_response = 1;
NormalCacheTaskResponse normal_cache_task_response = 2;
NeedBackToSourceResponse need_back_to_source_response = 3;
EmptyCacheTaskResponse empty_task_response = 1;
NormalCacheTaskResponse normal_task_response = 2;
}
}
@ -386,12 +357,32 @@ message DeleteCachePeerRequest {
string peer_id = 3;
}
// StatCacheTaskRequest represents request of StatCacheTask.
message StatCacheTaskRequest {
// UploadCacheTaskRequest represents request of UploadCacheTask.
message UploadCacheTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 4;
// Tag is used to distinguish different cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Task piece length.
uint64 piece_length = 7;
// TTL of the cache task.
google.protobuf.Duration ttl = 8;
// Upload timeout.
optional google.protobuf.Duration timeout = 9;
}
// StatCacheTaskRequest represents request of StatCacheTask.
message StatCacheTaskRequest {
// Task id.
string task_id = 1;
}
// DeleteCacheTaskRequest represents request of DeleteCacheTask.
@ -402,310 +393,8 @@ message DeleteCacheTaskRequest {
string task_id = 2;
}
// RegisterPersistentCachePeerRequest represents persistent cache peer registered request of AnnouncePersistentCachePeerRequest.
message RegisterPersistentCachePeerRequest {
// Persistent represents whether the persistent cache task is persistent.
// If the persistent cache task is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
bool persistent = 1;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 2;
// Application of task.
optional string application = 3;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB).
uint64 piece_length = 4;
// File path to be exported.
optional string output_path = 5;
// Download timeout.
optional google.protobuf.Duration timeout = 6;
}
// DownloadPersistentCachePeerStartedRequest represents persistent cache peer download started request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerStartedRequest {
}
// ReschedulePersistentCachePeerRequest represents reschedule request of AnnouncePersistentCachePeerRequest.
message ReschedulePersistentCachePeerRequest {
// Candidate parent ids.
repeated common.v2.PersistentCachePeer candidate_parents = 1;
// The description of the reschedule reason.
optional string description = 2;
}
// DownloadPersistentCachePeerFinishedRequest represents persistent cache peer download finished request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFinishedRequest {
// Total piece count.
uint32 piece_count = 1;
}
// DownloadPersistentCachePeerFailedRequest represents persistent cache peer download failed request of AnnouncePersistentCachePeerRequest.
message DownloadPersistentCachePeerFailedRequest {
// The description of the download failed.
optional string description = 1;
}
// AnnouncePersistentCachePeerRequest represents request of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
oneof request {
RegisterPersistentCachePeerRequest register_persistent_cache_peer_request = 4;
DownloadPersistentCachePeerStartedRequest download_persistent_cache_peer_started_request = 5;
ReschedulePersistentCachePeerRequest reschedule_persistent_cache_peer_request = 6;
DownloadPersistentCachePeerFinishedRequest download_persistent_cache_peer_finished_request = 7;
DownloadPersistentCachePeerFailedRequest download_persistent_cache_peer_failed_request = 8;
DownloadPieceFinishedRequest download_piece_finished_request = 9;
DownloadPieceFailedRequest download_piece_failed_request = 10;
}
}
// EmptyPersistentCacheTaskResponse represents empty persistent cache task response of AnnouncePersistentCachePeerResponse.
message EmptyPersistentCacheTaskResponse {
}
// NormalPersistentCacheTaskResponse represents normal persistent cache task response of AnnouncePersistentCachePeerResponse.
message NormalPersistentCacheTaskResponse {
// Candidate parents.
repeated common.v2.PersistentCachePeer candidate_cache_parents = 1;
}
// AnnouncePersistentCachePeerResponse represents response of AnnouncePersistentCachePeer.
message AnnouncePersistentCachePeerResponse {
oneof response {
EmptyPersistentCacheTaskResponse empty_persistent_cache_task_response = 1;
NormalPersistentCacheTaskResponse normal_persistent_cache_task_response = 2;
}
}
// StatPersistentCachePeerRequest represents request of StatPersistentCachePeer.
message StatPersistentCachePeerRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
}
// DeletePersistentCachePeerRequest represents request of DeletePersistentCachePeer.
message DeletePersistentCachePeerRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
}
// UploadPersistentCacheTaskStartedRequest represents upload persistent cache task started request of UploadPersistentCacheTaskStarted.
message UploadPersistentCacheTaskStartedRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
// Replica count of the persistent cache task.
uint64 persistent_replica_count = 4;
// Tag is used to distinguish different persistent cache tasks.
optional string tag = 5;
// Application of task.
optional string application = 6;
// Task piece length, the value needs to be greater than or equal to 4194304(4MiB).
uint64 piece_length = 7;
// Task content length.
uint64 content_length = 8;
// Task piece count.
uint32 piece_count = 9;
// TTL of the persistent cache task.
google.protobuf.Duration ttl = 10;
}
// UploadPersistentCacheTaskFinishedRequest represents upload persistent cache task finished request of UploadPersistentCacheTaskFinished.
message UploadPersistentCacheTaskFinishedRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
}
// UploadPersistentCacheTaskFailedRequest represents upload persistent cache task failed request of UploadPersistentCacheTaskFailed.
message UploadPersistentCacheTaskFailedRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
// Peer id.
string peer_id = 3;
// The description of the upload failed.
optional string description = 4;
}
// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
message StatPersistentCacheTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
}
// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
message DeletePersistentCacheTaskRequest {
// Host id.
string host_id = 1;
// Task id.
string task_id = 2;
}
// PreheatImageRequest represents request of PreheatImage.
message PreheatImageRequest {
// URL is the image manifest url for preheating.
string url = 1;
// Piece Length is the piece length(bytes) for downloading file. The value needs to
// be greater than 4MiB (4,194,304 bytes) and less than 64MiB (67,108,864 bytes),
// for example: 4194304(4mib), 8388608(8mib). If the piece length is not specified,
// the piece length will be calculated according to the file size.
optional uint64 piece_length = 2;
// Tag is the tag for preheating.
optional string tag = 3;
// Application is the application string for preheating.
optional string application = 4;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 5;
// Header is the http headers for authentication.
map<string, string> header = 6;
// Username is the username for authentication.
optional string username = 7;
// Password is the password for authentication.
optional string password = 8;
// Platform is the platform for preheating, such as linux/amd64, linux/arm64, etc.
optional string platform = 9;
// Scope is the scope for preheating, it can be one of the following values:
// - single_seed_peer: preheat from a single seed peer.
// - all_peers: preheat from all available peers.
// - all_seed_peers: preheat from all seed peers.
string scope = 10;
// IPs is a list of specific peer IPs for preheating.
// This field has the highest priority: if provided, both 'Count' and 'Percentage' will be ignored.
// Applies to 'all_peers' and 'all_seed_peers' scopes.
repeated string ips = 11;
// Percentage is the percentage of available peers to preheat.
// This field has the lowest priority and is only used if both 'IPs' and 'Count' are not provided.
// It must be a value between 1 and 100 (inclusive) if provided.
// Applies to 'all_peers' and 'all_seed_peers' scopes.
optional uint32 percentage = 12;
// Count is the desired number of peers to preheat.
// This field is used only when 'IPs' is not specified. It has priority over 'Percentage'.
// It must be a value between 1 and 200 (inclusive) if provided.
// Applies to 'all_peers' and 'all_seed_peers' scopes.
optional uint32 count = 13;
// ConcurrentTaskCount specifies the maximum number of tasks (e.g., image layers) to preheat concurrently.
// For example, if preheating 100 layers with ConcurrentTaskCount set to 10, up to 10 layers are processed simultaneously.
// If ConcurrentPeerCount is 10 for 1000 peers, each layer is preheated by 10 peers concurrently.
// Default is 8, maximum is 100.
optional int64 concurrent_task_count = 14;
// ConcurrentPeerCount specifies the maximum number of peers to preheat concurrently for a single task (e.g., an image layer).
// For example, if preheating a layer with ConcurrentPeerCount set to 10, up to 10 peers process that layer simultaneously.
// Default is 500, maximum is 1000.
optional int64 concurrent_peer_count = 15;
// Timeout is the timeout for preheating, default is 30 minutes.
optional google.protobuf.Duration timeout = 16;
// Preheat priority.
common.v2.Priority priority = 17;
// certificate_chain is the client certs with DER format for the backend client.
repeated bytes certificate_chain = 18;
// insecure_skip_verify indicates whether to skip TLS verification.
bool insecure_skip_verify = 19;
}
// StatImageRequest represents request of StatImage.
message StatImageRequest {
// URL is the image manifest url for preheating.
string url = 1;
// Piece Length is the piece length(bytes) for downloading file. The value needs to
// be greater than 4MiB (4,194,304 bytes) and less than 64MiB (67,108,864 bytes),
// for example: 4194304(4mib), 8388608(8mib). If the piece length is not specified,
// the piece length will be calculated according to the file size.
optional uint64 piece_length = 2;
// Tag is the tag for preheating.
optional string tag = 3;
// Application is the application string for preheating.
optional string application = 4;
// Filtered query params to generate the task id.
// When filter is ["Signature", "Expires", "ns"], for example:
// http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io
// will generate the same task id.
// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
repeated string filtered_query_params = 5;
// Header is the http headers for authentication.
map<string, string> header = 6;
// Username is the username for authentication.
optional string username = 7;
// Password is the password for authentication.
optional string password = 8;
// Platform is the platform for preheating, such as linux/amd64, linux/arm64, etc.
optional string platform = 9;
// ConcurrentLayerCount specifies the maximum number of layers to get concurrently.
// For example, if stat 100 layers with ConcurrentLayerCount set to 10, up to 10 layers are processed simultaneously.
// If ConcurrentPeerCount is 10 for 1000 peers, each layer is stated by 10 peers concurrently.
// Default is 8, maximum is 100.
optional int64 concurrent_layer_count = 10;
// ConcurrentPeerCount specifies the maximum number of peers stat concurrently for a single task (e.g., an image layer).
// For example, if stat a layer with ConcurrentPeerCount set to 10, up to 10 peers process that layer simultaneously.
// Default is 500, maximum is 1000.
optional int64 concurrent_peer_count = 11;
// Timeout is the timeout for preheating, default is 30 minutes.
optional google.protobuf.Duration timeout = 12;
// certificate_chain is the client certs with DER format for the backend client.
repeated bytes certificate_chain = 13;
// insecure_skip_verify indicates whether to skip TLS verification.
bool insecure_skip_verify = 14;
}
// StatImageResponse represents response of StatImage.
message StatImageResponse {
// Image is the image information.
Image image = 1;
// Peers is the peers that have downloaded the image.
repeated PeerImage peers = 2;
}
// PeerImage represents a peer in the get image job.
message PeerImage {
// IP is the IP address of the peer.
string ip = 1;
// Hostname is the hostname of the peer.
string hostname = 2;
// CachedLayers is the list of layers that the peer has downloaded.
repeated Layer cached_layers = 3;
}
// Image represents the image information.
message Image {
// Layers is the list of layers of the image.
repeated Layer layers = 1;
}
// Layer represents a layer of the image.
message Layer {
// URL is the URL of the layer.
string url = 1;
}
// Scheduler RPC Service.
service Scheduler {
service Scheduler{
// AnnouncePeer announces peer to scheduler.
rpc AnnouncePeer(stream AnnouncePeerRequest) returns(stream AnnouncePeerResponse);
@ -724,67 +413,27 @@ service Scheduler {
// AnnounceHost announces host to scheduler.
rpc AnnounceHost(AnnounceHostRequest)returns(google.protobuf.Empty);
// ListHosts lists hosts in scheduler.
rpc ListHosts(google.protobuf.Empty)returns(ListHostsResponse);
// DeleteHost releases host in scheduler.
rpc DeleteHost(DeleteHostRequest)returns(google.protobuf.Empty);
// SyncProbes sync probes of the host.
rpc SyncProbes(stream SyncProbesRequest)returns(stream SyncProbesResponse);
// AnnounceCachePeer announces cache peer to scheduler.
rpc AnnounceCachePeer(stream AnnounceCachePeerRequest) returns(stream AnnounceCachePeerResponse);
// Checks information of cache peer.
rpc StatCachePeer(StatCachePeerRequest)returns(common.v2.CachePeer);
// DeletCacheePeer releases cache peer in scheduler.
// DeleteCachePeer releases cache peer in scheduler.
rpc DeleteCachePeer(DeleteCachePeerRequest)returns(google.protobuf.Empty);
// UploadCacheTask uploads cache task to scheduler.
rpc UploadCacheTask(UploadCacheTaskRequest)returns(common.v2.CacheTask);
// Checks information of cache task.
rpc StatCacheTask(StatCacheTaskRequest)returns(common.v2.CacheTask);
// DeleteCacheTask releases cache task in scheduler.
rpc DeleteCacheTask(DeleteCacheTaskRequest)returns(google.protobuf.Empty);
// AnnouncePersistentCachePeer announces persistent cache peer to scheduler.
rpc AnnouncePersistentCachePeer(stream AnnouncePersistentCachePeerRequest) returns(stream AnnouncePersistentCachePeerResponse);
// Checks information of persistent cache peer.
rpc StatPersistentCachePeer(StatPersistentCachePeerRequest)returns(common.v2.PersistentCachePeer);
// DeletePersistentCachePeer releases persistent cache peer in scheduler.
rpc DeletePersistentCachePeer(DeletePersistentCachePeerRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskStarted uploads persistent cache task started to scheduler.
rpc UploadPersistentCacheTaskStarted(UploadPersistentCacheTaskStartedRequest)returns(google.protobuf.Empty);
// UploadPersistentCacheTaskFinished uploads persistent cache task finished to scheduler.
rpc UploadPersistentCacheTaskFinished(UploadPersistentCacheTaskFinishedRequest)returns(common.v2.PersistentCacheTask);
// UploadPersistentCacheTaskFailed uploads persistent cache task failed to scheduler.
rpc UploadPersistentCacheTaskFailed(UploadPersistentCacheTaskFailedRequest)returns(google.protobuf.Empty);
// Checks information of persistent cache task.
rpc StatPersistentCacheTask(StatPersistentCacheTaskRequest)returns(common.v2.PersistentCacheTask);
// DeletePersistentCacheTask releases persistent cache task in scheduler.
rpc DeletePersistentCacheTask(DeletePersistentCacheTaskRequest)returns(google.protobuf.Empty);
// PreheatImage synchronously resolves an image manifest and triggers an asynchronous preheat task.
//
// This is a blocking call. The RPC will not return until the server has completed the
// initial synchronous work: resolving the image manifest and preparing all layer URLs.
//
// After this call successfully returns, a scheduler on the server begins the actual
// preheating process, instructing peers to download the layers in the background.
//
// A successful response (google.protobuf.Empty) confirms that the preparation is complete
// and the asynchronous download task has been scheduled.
rpc PreheatImage(PreheatImageRequest)returns(google.protobuf.Empty);
// StatImage provides detailed status for a container image's distribution in peers.
//
// This is a blocking call that first resolves the image manifest and then queries
// all peers to collect the image's download state across the network.
// The response includes both layer information and the status on each peer.
rpc StatImage(StatImageRequest)returns(StatImageResponse);
}

51
proto/security.proto Normal file
View File

@ -0,0 +1,51 @@
/*
* Copyright 2022 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package security;
import "google/protobuf/duration.proto";
// Refer: https://github.com/istio/api/blob/master/security/v1alpha1/ca.proto
// Istio defines similar api for signing certificate, but it's not applicable in Dragonfly.
// Certificate request type.
// Dragonfly supports peers authentication with Mutual TLS(mTLS)
// For mTLS, all peers need to request TLS certificates for communicating
// The server side may overwrite ant requested certificate filed based on its policies.
message CertificateRequest {
// ASN.1 DER form certificate request.
// The public key in the CSR is used to generate the certificate,
// and other fields in the generated certificate may be overwritten by the CA.
bytes csr = 1;
// Optional: requested certificate validity period.
google.protobuf.Duration validity_period = 2;
}
// Certificate response type.
message CertificateResponse {
// ASN.1 DER form certificate chain.
repeated bytes certificate_chain = 1;
}
// Service for managing certificates issued by the CA.
service Certificate {
// Using provided CSR, returns a signed certificate.
rpc IssueCertificate(CertificateRequest)
returns (CertificateResponse) {
}
}

View File

@ -1,4 +1,3 @@
// This file is @generated by prost-build.
/// Peer metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
@ -46,49 +45,9 @@ pub struct CachePeer {
/// Peer id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Range is url range of request.
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<Range>,
/// Peer priority.
#[prost(enumeration = "Priority", tag = "3")]
pub priority: i32,
/// Pieces of peer.
#[prost(message, repeated, tag = "4")]
pub pieces: ::prost::alloc::vec::Vec<Piece>,
/// Peer downloads costs time.
#[prost(message, optional, tag = "5")]
pub cost: ::core::option::Option<::prost_wkt_types::Duration>,
/// Peer state.
#[prost(string, tag = "6")]
pub state: ::prost::alloc::string::String,
/// Cache Task info.
#[prost(message, optional, tag = "7")]
pub task: ::core::option::Option<CacheTask>,
/// Host info.
#[prost(message, optional, tag = "8")]
pub host: ::core::option::Option<Host>,
/// NeedBackToSource needs downloaded from source.
#[prost(bool, tag = "9")]
pub need_back_to_source: bool,
/// Peer create time.
#[prost(message, optional, tag = "10")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Peer update time.
#[prost(message, optional, tag = "11")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// PersistentCachePeer metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PersistentCachePeer {
/// Peer id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Persistent represents whether the persistent cache peer is persistent.
/// If the persistent cache peer is persistent, the persistent cache peer will
/// not be deleted when dfdaemon runs garbage collection. It only be deleted
/// when the task is deleted by the user.
/// Persistent represents whether the cache peer is persistent.
/// If the cache peer is persistent, the cache peer will
/// not be deleted when dfdamon runs garbage collection.
#[prost(bool, tag = "2")]
pub persistent: bool,
/// Peer downloads costs time.
@ -97,9 +56,9 @@ pub struct PersistentCachePeer {
/// Peer state.
#[prost(string, tag = "4")]
pub state: ::prost::alloc::string::String,
/// Persistent task info.
/// Task info.
#[prost(message, optional, tag = "5")]
pub task: ::core::option::Option<PersistentCacheTask>,
pub task: ::core::option::Option<CacheTask>,
/// Host info.
#[prost(message, optional, tag = "6")]
pub host: ::core::option::Option<Host>,
@ -124,12 +83,7 @@ pub struct Task {
/// Download url.
#[prost(string, tag = "3")]
pub url: ::prost::alloc::string::String,
/// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
/// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
/// Returns an error if the computed digest mismatches the expected value.
///
/// Performance
/// Digest calculation increases processing time. Enable only when data integrity verification is critical.
/// Digest of the task digest, for example blake3:xxx or sha256:yyy.
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// URL tag identifies different task for same url.
@ -139,7 +93,7 @@ pub struct Task {
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
/// Filtered query params to generate the task id.
/// When filter is \["Signature", "Expires", "ns"\], for example:
/// When filter is ["Signature", "Expires", "ns"], for example:
/// <http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io> and <http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io>
/// will generate the same task id.
/// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
@ -151,32 +105,35 @@ pub struct Task {
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Task content length.
/// Task piece length.
#[prost(uint64, tag = "9")]
pub piece_length: u64,
/// Task content length.
#[prost(uint64, tag = "10")]
pub content_length: u64,
/// Task piece count.
#[prost(uint32, tag = "10")]
#[prost(uint32, tag = "11")]
pub piece_count: u32,
/// Task size scope.
#[prost(enumeration = "SizeScope", tag = "11")]
#[prost(enumeration = "SizeScope", tag = "12")]
pub size_scope: i32,
/// Pieces of task.
#[prost(message, repeated, tag = "12")]
#[prost(message, repeated, tag = "13")]
pub pieces: ::prost::alloc::vec::Vec<Piece>,
/// Task state.
#[prost(string, tag = "13")]
#[prost(string, tag = "14")]
pub state: ::prost::alloc::string::String,
/// Task peer count.
#[prost(uint32, tag = "14")]
#[prost(uint32, tag = "15")]
pub peer_count: u32,
/// Task contains available peer.
#[prost(bool, tag = "15")]
#[prost(bool, tag = "16")]
pub has_available_peer: bool,
/// Task create time.
#[prost(message, optional, tag = "16")]
#[prost(message, optional, tag = "17")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Task update time.
#[prost(message, optional, tag = "17")]
#[prost(message, optional, tag = "18")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// CacheTask metadata.
@ -187,90 +144,16 @@ pub struct CacheTask {
/// Task id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Task type.
#[prost(enumeration = "TaskType", tag = "2")]
pub r#type: i32,
/// Download url.
#[prost(string, tag = "3")]
pub url: ::prost::alloc::string::String,
/// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
/// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
/// Returns an error if the computed digest mismatches the expected value.
///
/// Performance
/// Digest calculation increases processing time. Enable only when data integrity verification is critical.
#[prost(string, optional, tag = "4")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
/// URL tag identifies different task for same url.
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
/// Application of task.
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
/// Filtered query params to generate the task id.
/// When filter is \["Signature", "Expires", "ns"\], for example:
/// <http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io> and <http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io>
/// will generate the same task id.
/// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
#[prost(string, repeated, tag = "7")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Task request headers.
#[prost(map = "string, string", tag = "8")]
pub request_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Task content length.
#[prost(uint64, tag = "9")]
pub content_length: u64,
/// Task piece count.
#[prost(uint32, tag = "10")]
pub piece_count: u32,
/// Task size scope.
#[prost(enumeration = "SizeScope", tag = "11")]
pub size_scope: i32,
/// Pieces of task.
#[prost(message, repeated, tag = "12")]
pub pieces: ::prost::alloc::vec::Vec<Piece>,
/// Task state.
#[prost(string, tag = "13")]
pub state: ::prost::alloc::string::String,
/// Task peer count.
#[prost(uint32, tag = "14")]
pub peer_count: u32,
/// Task contains available peer.
#[prost(bool, tag = "15")]
pub has_available_peer: bool,
/// Task create time.
#[prost(message, optional, tag = "16")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
/// Task update time.
#[prost(message, optional, tag = "17")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// PersistentCacheTask metadata.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PersistentCacheTask {
/// Task id.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Replica count of the persistent cache task. The persistent cache task will
/// not be deleted when dfdamon runs garbage collection. It only be deleted
/// when the task is deleted by the user.
/// Replica count of the persistent cache task.
#[prost(uint64, tag = "2")]
pub persistent_replica_count: u64,
/// Current replica count of the persistent cache task. The persistent cache task
/// will not be deleted when dfdaemon runs garbage collection. It only be deleted
/// when the task is deleted by the user.
/// Replica count of the cache task.
#[prost(uint64, tag = "3")]
pub current_persistent_replica_count: u64,
/// Current replica count of the cache task. If cache task is not persistent,
/// the persistent cache task will be deleted when dfdaemon runs garbage collection.
#[prost(uint64, tag = "4")]
pub current_replica_count: u64,
/// Tag is used to distinguish different persistent cache tasks.
pub replica_count: u64,
/// Digest of the task digest, for example blake3:xxx or sha256:yyy.
#[prost(string, tag = "4")]
pub digest: ::prost::alloc::string::String,
/// Tag is used to distinguish different cache tasks.
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
/// Application of task.
@ -288,7 +171,7 @@ pub struct PersistentCacheTask {
/// Task state.
#[prost(string, tag = "10")]
pub state: ::prost::alloc::string::String,
/// TTL of the persistent cache task.
/// TTL of the cache task.
#[prost(message, optional, tag = "11")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
/// Task create time.
@ -354,17 +237,11 @@ pub struct Host {
/// ID of the cluster to which the host belongs.
#[prost(uint64, tag = "17")]
pub scheduler_cluster_id: u64,
/// Disable shared data for other peers.
#[prost(bool, tag = "18")]
pub disable_shared: bool,
/// Port of proxy server.
#[prost(int32, tag = "19")]
pub proxy_port: i32,
}
/// CPU Stat.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cpu {
/// Number of logical cores in the system.
#[prost(uint32, tag = "1")]
@ -386,7 +263,7 @@ pub struct Cpu {
/// kinds of work. Time units are in seconds.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CpuTimes {
/// CPU time of user.
#[prost(double, tag = "1")]
@ -422,7 +299,7 @@ pub struct CpuTimes {
/// Memory Stat.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Memory {
/// Total amount of RAM on this system.
#[prost(uint64, tag = "1")]
@ -460,23 +337,11 @@ pub struct Network {
/// IDC where the peer host is located
#[prost(string, optional, tag = "4")]
pub idc: ::core::option::Option<::prost::alloc::string::String>,
/// Maximum bandwidth of the network interface, in bps (bits per second).
#[prost(uint64, tag = "9")]
pub max_rx_bandwidth: u64,
/// Receive bandwidth of the network interface, in bps (bits per second).
#[prost(uint64, optional, tag = "10")]
pub rx_bandwidth: ::core::option::Option<u64>,
/// Maximum bandwidth of the network interface for transmission, in bps (bits per second).
#[prost(uint64, tag = "11")]
pub max_tx_bandwidth: u64,
/// Transmit bandwidth of the network interface, in bps (bits per second).
#[prost(uint64, optional, tag = "12")]
pub tx_bandwidth: ::core::option::Option<u64>,
}
/// Disk Stat.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Disk {
/// Total amount of disk on the data path of dragonfly.
#[prost(uint64, tag = "1")]
@ -502,12 +367,6 @@ pub struct Disk {
/// Used percent of indoes on the data path of dragonfly directory.
#[prost(double, tag = "8")]
pub inodes_used_percent: f64,
/// Disk read bandwidth, in bytes per second.
#[prost(uint64, tag = "9")]
pub read_bandwidth: u64,
/// Disk write bandwidth, in bytes per second.
#[prost(uint64, tag = "10")]
pub write_bandwidth: u64,
}
/// Build information.
#[derive(serde::Serialize, serde::Deserialize)]
@ -559,7 +418,7 @@ pub struct Download {
#[prost(enumeration = "Priority", tag = "7")]
pub priority: i32,
/// Filtered query params to generate the task id.
/// When filter is \["Signature", "Expires", "ns"\], for example:
/// When filter is ["Signature", "Expires", "ns"], for example:
/// <http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io> and <http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io>
/// will generate the same task id.
/// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
@ -572,101 +431,31 @@ pub struct Download {
::prost::alloc::string::String,
>,
/// Task piece length.
#[prost(uint64, optional, tag = "10")]
pub piece_length: ::core::option::Option<u64>,
/// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
/// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
/// it will copy the file to the output path after the download is completed.
/// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
#[prost(uint64, tag = "10")]
pub piece_length: u64,
/// File path to be exported.
#[prost(string, optional, tag = "11")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
/// Download timeout.
#[prost(message, optional, tag = "12")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
/// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
/// Dfdaemon will disable download back-to-source by itself, if disable_back_to_source is true.
#[prost(bool, tag = "13")]
pub disable_back_to_source: bool,
/// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
/// Scheduler will triggers peer to download back-to-source, if need_back_to_source is true.
#[prost(bool, tag = "14")]
pub need_back_to_source: bool,
/// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
#[prost(bytes = "vec", repeated, tag = "15")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
/// prefetch pre-downloads all pieces of the task when download task with range request.
#[prost(bool, tag = "16")]
pub prefetch: bool,
/// Object storage protocol information.
#[prost(message, optional, tag = "17")]
pub object_storage: ::core::option::Option<ObjectStorage>,
/// HDFS protocol information.
#[prost(message, optional, tag = "18")]
pub hdfs: ::core::option::Option<Hdfs>,
/// is_prefetch is the flag to indicate whether the request is a prefetch request.
#[prost(bool, tag = "19")]
pub is_prefetch: bool,
/// need_piece_content is the flag to indicate whether the response needs to return piece content.
#[prost(bool, tag = "20")]
pub need_piece_content: bool,
/// force_hard_link is the flag to indicate whether the download file must be hard linked to the output path.
/// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
#[prost(bool, tag = "22")]
pub force_hard_link: bool,
/// content_for_calculating_task_id is the content used to calculate the task id.
/// If content_for_calculating_task_id is set, use its value to calculate the task ID.
/// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
#[prost(string, optional, tag = "23")]
pub content_for_calculating_task_id: ::core::option::Option<
::prost::alloc::string::String,
>,
/// remote_ip represents the IP address of the client initiating the download request.
/// For proxy requests, it is set to the IP address of the request source.
/// For dfget requests, it is set to the IP address of the dfget.
#[prost(string, optional, tag = "24")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// Object Storage related information.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectStorage {
/// Region is the region of the object storage service.
#[prost(string, optional, tag = "1")]
pub region: ::core::option::Option<::prost::alloc::string::String>,
/// Endpoint is the endpoint of the object storage service.
#[prost(string, optional, tag = "2")]
pub endpoint: ::core::option::Option<::prost::alloc::string::String>,
/// Access key that used to access the object storage service.
#[prost(string, optional, tag = "3")]
pub access_key_id: ::core::option::Option<::prost::alloc::string::String>,
/// Access secret that used to access the object storage service.
#[prost(string, optional, tag = "4")]
pub access_key_secret: ::core::option::Option<::prost::alloc::string::String>,
/// Session token that used to access s3 storage service.
#[prost(string, optional, tag = "5")]
pub session_token: ::core::option::Option<::prost::alloc::string::String>,
/// Local path to credential file for Google Cloud Storage service OAuth2 authentication.
#[prost(string, optional, tag = "6")]
pub credential_path: ::core::option::Option<::prost::alloc::string::String>,
/// Predefined ACL that used for the Google Cloud Storage service.
#[prost(string, optional, tag = "7")]
pub predefined_acl: ::core::option::Option<::prost::alloc::string::String>,
/// Temporary STS security token for accessing OSS.
#[prost(string, optional, tag = "8")]
pub security_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// HDFS related information.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Hdfs {
/// Delegation token for Web HDFS operator.
#[prost(string, optional, tag = "1")]
pub delegation_token: ::core::option::Option<::prost::alloc::string::String>,
}
/// Range represents download range.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Range {
/// Start of range.
#[prost(uint64, tag = "1")]
@ -751,28 +540,16 @@ impl SizeScope {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TaskType {
/// STANDARD is standard type of task, it can download from source, remote peer and
/// local peer(local cache). When the standard task is never downloaded in the
/// P2P cluster, dfdaemon will download the task from the source. When the standard
/// task is downloaded in the P2P cluster, dfdaemon will download the task from
/// the remote peer or local peer(local cache), where peers use disk storage to store tasks.
Standard = 0,
/// PERSISTENT is persistent type of task, it can import file and export file in P2P cluster.
/// When the persistent task is imported into the P2P cluster, dfdaemon will store
/// the task in the peer's disk and copy multiple replicas to remote peers to
/// prevent data loss.
Persistent = 1,
/// PERSISTENT_CACHE is persistent cache type of task, it can import file and export file in P2P cluster.
/// When the persistent cache task is imported into the P2P cluster, dfdaemon will store
/// the task in the peer's disk and copy multiple replicas to remote peers to prevent data loss.
/// When the expiration time is reached, task will be deleted in the P2P cluster.
PersistentCache = 2,
/// CACHE is cache type of task, it can download from source, remote peer and
/// local peer(local cache). When the cache task is never downloaded in the
/// P2P cluster, dfdaemon will download the cache task from the source. When the cache
/// task is downloaded in the P2P cluster, dfdaemon will download the cache task from
/// the remote peer or local peer(local cache), where peers use memory storage to store cache tasks.
Cache = 3,
/// DFDAEMON is dfdeamon type of task,
/// dfdeamon task is a normal p2p task.
Dfdaemon = 0,
/// DFCACHE is dfcache type of task,
/// dfcache task is a cache task, and the task url is fake url.
/// It can only be used for caching and cannot be downloaded back to source.
Dfcache = 1,
/// DFSTORE is dfstore type of task,
/// dfstore task is a persistent task in backend.
Dfstore = 2,
}
impl TaskType {
/// String value of the enum field names used in the ProtoBuf definition.
@ -781,19 +558,17 @@ impl TaskType {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
TaskType::Standard => "STANDARD",
TaskType::Persistent => "PERSISTENT",
TaskType::PersistentCache => "PERSISTENT_CACHE",
TaskType::Cache => "CACHE",
TaskType::Dfdaemon => "DFDAEMON",
TaskType::Dfcache => "DFCACHE",
TaskType::Dfstore => "DFSTORE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STANDARD" => Some(Self::Standard),
"PERSISTENT" => Some(Self::Persistent),
"PERSISTENT_CACHE" => Some(Self::PersistentCache),
"CACHE" => Some(Self::Cache),
"DFDAEMON" => Some(Self::Dfdaemon),
"DFCACHE" => Some(Self::Dfcache),
"DFSTORE" => Some(Self::Dfstore),
_ => None,
}
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
// This file is @generated by prost-build.
/// Backend is error detail for Backend.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
@ -14,15 +13,6 @@ pub struct Backend {
::prost::alloc::string::String,
>,
/// Backend HTTP status code.
#[prost(int32, optional, tag = "3")]
pub status_code: ::core::option::Option<i32>,
}
/// Unknown is error detail for Unknown.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Unknown {
/// Unknown error message.
#[prost(string, optional, tag = "1")]
pub message: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, tag = "3")]
pub status_code: i32,
}

View File

@ -28,5 +28,7 @@ pub mod scheduler {
pub mod v2;
}
pub mod security;
// FILE_DESCRIPTOR_SET is the serialized FileDescriptorSet of the proto files.
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("descriptor.bin");

View File

@ -1,4 +1,3 @@
// This file is @generated by prost-build.
/// SeedPeerCluster represents cluster of seed peer.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
@ -265,12 +264,6 @@ pub struct UpdateSchedulerRequest {
/// Scheduler port.
#[prost(int32, tag = "7")]
pub port: i32,
/// Scheduler features.
#[prost(string, repeated, tag = "8")]
pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Scheduler Configuration.
#[prost(bytes = "vec", tag = "9")]
pub config: ::prost::alloc::vec::Vec<u8>,
}
/// ListSchedulersRequest represents request of ListSchedulers.
#[derive(serde::Serialize, serde::Deserialize)]
@ -298,9 +291,6 @@ pub struct ListSchedulersRequest {
/// Dfdaemon commit.
#[prost(string, tag = "7")]
pub commit: ::prost::alloc::string::String,
/// ID of the cluster to which the scheduler belongs.
#[prost(uint64, tag = "8")]
pub scheduler_cluster_id: u64,
}
/// ListSchedulersResponse represents response of ListSchedulers.
#[derive(serde::Serialize, serde::Deserialize)]
@ -380,6 +370,39 @@ pub struct ListApplicationsResponse {
#[prost(message, repeated, tag = "1")]
pub applications: ::prost::alloc::vec::Vec<Application>,
}
/// CreateGNNRequest represents to create GNN model request of TrainRequest.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateGnnRequest {
/// Protocol buffer file of model.
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
/// Recall of the model.
#[prost(double, tag = "2")]
pub recall: f64,
/// Precision of the model.
#[prost(double, tag = "3")]
pub precision: f64,
/// F1-Score of the model.
#[prost(double, tag = "4")]
pub f1_score: f64,
}
/// CreateMLPRequest represents to create MLP model request of TrainRequest.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateMlpRequest {
/// Protocol buffer file of model.
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
/// MSE of the model.
#[prost(double, tag = "2")]
pub mse: f64,
/// MAE of the model.
#[prost(double, tag = "3")]
pub mae: f64,
}
/// KeepAliveRequest represents request of KeepAlive.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
@ -457,8 +480,8 @@ pub mod manager_client {
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
@ -483,7 +506,7 @@ pub mod manager_client {
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
>>::Error: Into<StdError> + Send + Sync,
{
ManagerClient::new(InterceptedService::new(inner, interceptor))
}
@ -742,7 +765,7 @@ pub mod manager_server {
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with ManagerServer.
#[async_trait]
pub trait Manager: std::marker::Send + std::marker::Sync + 'static {
pub trait Manager: Send + Sync + 'static {
/// Get SeedPeer and SeedPeer cluster configuration.
async fn get_seed_peer(
&self,
@ -800,18 +823,20 @@ pub mod manager_server {
}
/// Manager RPC Service.
#[derive(Debug)]
pub struct ManagerServer<T> {
inner: Arc<T>,
pub struct ManagerServer<T: Manager> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ManagerServer<T> {
struct _Inner<T>(Arc<T>);
impl<T: Manager> ManagerServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
@ -861,8 +886,8 @@ pub mod manager_server {
impl<T, B> tonic::codegen::Service<http::Request<B>> for ManagerServer<T>
where
T: Manager,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
@ -874,6 +899,7 @@ pub mod manager_server {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/manager.v2.Manager/GetSeedPeer" => {
#[allow(non_camel_case_types)]
@ -893,7 +919,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::get_seed_peer(&inner, request).await
(*inner).get_seed_peer(request).await
};
Box::pin(fut)
}
@ -904,6 +930,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GetSeedPeerSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -938,7 +965,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::list_seed_peers(&inner, request).await
(*inner).list_seed_peers(request).await
};
Box::pin(fut)
}
@ -949,6 +976,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListSeedPeersSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -983,7 +1011,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::update_seed_peer(&inner, request).await
(*inner).update_seed_peer(request).await
};
Box::pin(fut)
}
@ -994,6 +1022,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UpdateSeedPeerSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -1028,7 +1057,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::delete_seed_peer(&inner, request).await
(*inner).delete_seed_peer(request).await
};
Box::pin(fut)
}
@ -1039,6 +1068,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DeleteSeedPeerSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -1073,7 +1103,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::get_scheduler(&inner, request).await
(*inner).get_scheduler(request).await
};
Box::pin(fut)
}
@ -1084,6 +1114,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GetSchedulerSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -1118,7 +1149,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::update_scheduler(&inner, request).await
(*inner).update_scheduler(request).await
};
Box::pin(fut)
}
@ -1129,6 +1160,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = UpdateSchedulerSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -1163,7 +1195,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::list_schedulers(&inner, request).await
(*inner).list_schedulers(request).await
};
Box::pin(fut)
}
@ -1174,6 +1206,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListSchedulersSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -1208,7 +1241,7 @@ pub mod manager_server {
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::list_applications(&inner, request).await
(*inner).list_applications(request).await
};
Box::pin(fut)
}
@ -1219,6 +1252,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ListApplicationsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -1254,9 +1288,7 @@ pub mod manager_server {
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Manager>::keep_alive(&inner, request).await
};
let fut = async move { (*inner).keep_alive(request).await };
Box::pin(fut)
}
}
@ -1266,6 +1298,7 @@ pub mod manager_server {
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = KeepAliveSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
@ -1287,11 +1320,8 @@ pub mod manager_server {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", tonic::Code::Unimplemented as i32)
.header(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
@ -1300,7 +1330,7 @@ pub mod manager_server {
}
}
}
impl<T> Clone for ManagerServer<T> {
impl<T: Manager> Clone for ManagerServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
@ -1312,9 +1342,17 @@ pub mod manager_server {
}
}
}
/// Generated gRPC service name
pub const SERVICE_NAME: &str = "manager.v2.Manager";
impl<T> tonic::server::NamedService for ManagerServer<T> {
const NAME: &'static str = SERVICE_NAME;
impl<T: Manager> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Manager> tonic::server::NamedService for ManagerServer<T> {
const NAME: &'static str = "manager.v2.Manager";
}
}

File diff suppressed because it is too large Load Diff

323
src/security.rs Normal file
View File

@ -0,0 +1,323 @@
/// Certificate request type.
/// Dragonfly supports peers authentication with Mutual TLS(mTLS)
/// For mTLS, all peers need to request TLS certificates for communicating
/// The server side may overwrite ant requested certificate filed based on its policies.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificateRequest {
/// ASN.1 DER form certificate request.
/// The public key in the CSR is used to generate the certificate,
/// and other fields in the generated certificate may be overwritten by the CA.
#[prost(bytes = "vec", tag = "1")]
pub csr: ::prost::alloc::vec::Vec<u8>,
/// Optional: requested certificate validity period.
#[prost(message, optional, tag = "2")]
pub validity_period: ::core::option::Option<::prost_wkt_types::Duration>,
}
/// Certificate response type.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificateResponse {
/// ASN.1 DER form certificate chain.
#[prost(bytes = "vec", repeated, tag = "1")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// Generated client implementations.
pub mod certificate_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Service for managing certificates issued by the CA.
#[derive(Debug, Clone)]
pub struct CertificateClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CertificateClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> CertificateClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> CertificateClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
CertificateClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Using provided CSR, returns a signed certificate.
pub async fn issue_certificate(
&mut self,
request: impl tonic::IntoRequest<super::CertificateRequest>,
) -> std::result::Result<
tonic::Response<super::CertificateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/security.Certificate/IssueCertificate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("security.Certificate", "IssueCertificate"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
pub mod certificate_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
/// Generated trait containing gRPC methods that should be implemented for use with CertificateServer.
#[async_trait]
pub trait Certificate: Send + Sync + 'static {
/// Using provided CSR, returns a signed certificate.
async fn issue_certificate(
&self,
request: tonic::Request<super::CertificateRequest>,
) -> std::result::Result<
tonic::Response<super::CertificateResponse>,
tonic::Status,
>;
}
/// Service for managing certificates issued by the CA.
#[derive(Debug)]
pub struct CertificateServer<T: Certificate> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Certificate> CertificateServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
/// Enable decompressing requests with the given encoding.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
/// Compress responses with the given encoding, if the client supports it.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for CertificateServer<T>
where
T: Certificate,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/security.Certificate/IssueCertificate" => {
#[allow(non_camel_case_types)]
struct IssueCertificateSvc<T: Certificate>(pub Arc<T>);
impl<
T: Certificate,
> tonic::server::UnaryService<super::CertificateRequest>
for IssueCertificateSvc<T> {
type Response = super::CertificateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CertificateRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).issue_certificate(request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = IssueCertificateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Certificate> Clone for CertificateServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: Certificate> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Certificate> tonic::server::NamedService for CertificateServer<T> {
const NAME: &'static str = "security.Certificate";
}
}