From 72fe47b2a226f0448c91eff3a7270b6d8117b553 Mon Sep 17 00:00:00 2001 From: Abel Feng Date: Wed, 27 Mar 2024 10:11:14 +0800 Subject: [PATCH] add task api endpoint in oci proto Signed-off-by: Abel Feng --- core/runtime/v2/runc/options/next.pb.txt | 21 +++++++++++++ core/runtime/v2/runc/options/oci.pb.go | 39 ++++++++++++++++++++++-- core/runtime/v2/runc/options/oci.proto | 6 ++++ 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/core/runtime/v2/runc/options/next.pb.txt b/core/runtime/v2/runc/options/next.pb.txt index 537c28c97..d9d1f8f7b 100755 --- a/core/runtime/v2/runc/options/next.pb.txt +++ b/core/runtime/v2/runc/options/next.pb.txt @@ -73,6 +73,27 @@ file { type: TYPE_STRING json_name: "criuWorkPath" } + field { + name: "task_api_address" + number: 12 + label: LABEL_OPTIONAL + type: TYPE_STRING + json_name: "taskApiAddress" + } + field { + name: "task_api_protocol" + number: 13 + label: LABEL_OPTIONAL + type: TYPE_STRING + json_name: "taskApiProtocol" + } + field { + name: "task_api_version" + number: 14 + label: LABEL_OPTIONAL + type: TYPE_UINT32 + json_name: "taskApiVersion" + } reserved_range { start: 8 end: 9 diff --git a/core/runtime/v2/runc/options/oci.pb.go b/core/runtime/v2/runc/options/oci.pb.go index d68515d2b..b27007d93 100644 --- a/core/runtime/v2/runc/options/oci.pb.go +++ b/core/runtime/v2/runc/options/oci.pb.go @@ -45,6 +45,12 @@ type Options struct { CriuImagePath string `protobuf:"bytes,10,opt,name=criu_image_path,json=criuImagePath,proto3" json:"criu_image_path,omitempty"` // criu work path CriuWorkPath string `protobuf:"bytes,11,opt,name=criu_work_path,json=criuWorkPath,proto3" json:"criu_work_path,omitempty"` + // task api address, can be a unix domain socket, or vsock address. + TaskApiAddress string `protobuf:"bytes,12,opt,name=task_api_address,json=taskApiAddress,proto3" json:"task_api_address,omitempty"` + // protocol for task api connection, currently ttrpc and grpc supported + TaskApiProtocol string `protobuf:"bytes,13,opt,name=task_api_protocol,json=taskApiProtocol,proto3" json:"task_api_protocol,omitempty"` + // task api version, currently supported value is 2 and 3. + TaskApiVersion uint32 `protobuf:"varint,14,opt,name=task_api_version,json=taskApiVersion,proto3" json:"task_api_version,omitempty"` } func (x *Options) Reset() { @@ -149,6 +155,27 @@ func (x *Options) GetCriuWorkPath() string { return "" } +func (x *Options) GetTaskApiAddress() string { + if x != nil { + return x.TaskApiAddress + } + return "" +} + +func (x *Options) GetTaskApiProtocol() string { + if x != nil { + return x.TaskApiProtocol + } + return "" +} + +func (x *Options) GetTaskApiVersion() uint32 { + if x != nil { + return x.TaskApiVersion + } + return 0 +} + type CheckpointOptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -325,7 +352,7 @@ var file_github_com_containerd_containerd_core_runtime_v2_runc_options_oci_proto 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x75, 0x6e, 0x63, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6f, 0x63, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x22, 0xd2, 0x02, + 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x72, 0x75, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x22, 0xd2, 0x03, 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x6f, 0x5f, 0x70, 0x69, 0x76, 0x6f, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x6f, 0x50, 0x69, 0x76, 0x6f, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x24, 0x0a, @@ -346,7 +373,15 @@ var file_github_com_containerd_containerd_core_runtime_v2_runc_options_oci_proto 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x72, 0x69, 0x75, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x63, 0x72, 0x69, 0x75, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x63, 0x72, 0x69, 0x75, 0x57, 0x6f, 0x72, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x4a, 0x04, 0x08, 0x08, + 0x63, 0x72, 0x69, 0x75, 0x57, 0x6f, 0x72, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x28, 0x0a, 0x10, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x70, 0x69, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x61, + 0x70, 0x69, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x61, + 0x73, 0x6b, 0x41, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x22, 0xbb, 0x02, 0x0a, 0x11, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x65, 0x78, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, diff --git a/core/runtime/v2/runc/options/oci.proto b/core/runtime/v2/runc/options/oci.proto index 637cd31d6..c9b5ecca8 100644 --- a/core/runtime/v2/runc/options/oci.proto +++ b/core/runtime/v2/runc/options/oci.proto @@ -29,6 +29,12 @@ message Options { string criu_image_path = 10; // criu work path string criu_work_path = 11; + // task api address, can be a unix domain socket, or vsock address. + string task_api_address = 12; + // protocol for task api connection, currently ttrpc and grpc supported + string task_api_protocol = 13; + // task api version, currently supported value is 2 and 3. + uint32 task_api_version = 14; } message CheckpointOptions {