Skip to content

Commit a8a805c

Browse files
committed
Add ttrpc server to containerd
Signed-off-by: Michael Crosby <[email protected]>
1 parent db3a863 commit a8a805c

12 files changed

Lines changed: 1569 additions & 20 deletions

File tree

Protobuild.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ plugins = ["grpc", "fieldpath"]
3535
prefixes = ["github.com/containerd/containerd/api/events"]
3636
plugins = ["fieldpath"] # disable grpc for this package
3737

38+
[[overrides]]
39+
prefixes = ["github.com/containerd/containerd/api/services/ttrpc/events/v1"]
40+
plugins = ["ttrpc", "fieldpath"]
41+
3842
[[overrides]]
3943
# enable ttrpc and disable fieldpath and grpc for the shim
4044
prefixes = ["github.com/containerd/containerd/runtime/v1/shim/v1", "github.com/containerd/containerd/runtime/v2/task"]

api/next.pb.txt

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4202,6 +4202,119 @@ file {
42024202
weak_dependency: 2
42034203
syntax: "proto3"
42044204
}
4205+
file {
4206+
name: "github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto"
4207+
package: "containerd.services.events.ttrpc.v1"
4208+
dependency: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto"
4209+
dependency: "gogoproto/gogo.proto"
4210+
dependency: "google/protobuf/any.proto"
4211+
dependency: "google/protobuf/empty.proto"
4212+
dependency: "google/protobuf/timestamp.proto"
4213+
message_type {
4214+
name: "PublishRequest"
4215+
field {
4216+
name: "topic"
4217+
number: 1
4218+
label: LABEL_OPTIONAL
4219+
type: TYPE_STRING
4220+
json_name: "topic"
4221+
}
4222+
field {
4223+
name: "event"
4224+
number: 2
4225+
label: LABEL_OPTIONAL
4226+
type: TYPE_MESSAGE
4227+
type_name: ".google.protobuf.Any"
4228+
json_name: "event"
4229+
}
4230+
}
4231+
message_type {
4232+
name: "ForwardRequest"
4233+
field {
4234+
name: "envelope"
4235+
number: 1
4236+
label: LABEL_OPTIONAL
4237+
type: TYPE_MESSAGE
4238+
type_name: ".containerd.services.events.ttrpc.v1.Envelope"
4239+
json_name: "envelope"
4240+
}
4241+
}
4242+
message_type {
4243+
name: "SubscribeRequest"
4244+
field {
4245+
name: "filters"
4246+
number: 1
4247+
label: LABEL_REPEATED
4248+
type: TYPE_STRING
4249+
json_name: "filters"
4250+
}
4251+
}
4252+
message_type {
4253+
name: "Envelope"
4254+
field {
4255+
name: "timestamp"
4256+
number: 1
4257+
label: LABEL_OPTIONAL
4258+
type: TYPE_MESSAGE
4259+
type_name: ".google.protobuf.Timestamp"
4260+
options {
4261+
65001: 0
4262+
65010: 1
4263+
}
4264+
json_name: "timestamp"
4265+
}
4266+
field {
4267+
name: "namespace"
4268+
number: 2
4269+
label: LABEL_OPTIONAL
4270+
type: TYPE_STRING
4271+
json_name: "namespace"
4272+
}
4273+
field {
4274+
name: "topic"
4275+
number: 3
4276+
label: LABEL_OPTIONAL
4277+
type: TYPE_STRING
4278+
json_name: "topic"
4279+
}
4280+
field {
4281+
name: "event"
4282+
number: 4
4283+
label: LABEL_OPTIONAL
4284+
type: TYPE_MESSAGE
4285+
type_name: ".google.protobuf.Any"
4286+
json_name: "event"
4287+
}
4288+
options {
4289+
64400: 1
4290+
}
4291+
}
4292+
service {
4293+
name: "Events"
4294+
method {
4295+
name: "Publish"
4296+
input_type: ".containerd.services.events.ttrpc.v1.PublishRequest"
4297+
output_type: ".google.protobuf.Empty"
4298+
}
4299+
method {
4300+
name: "Forward"
4301+
input_type: ".containerd.services.events.ttrpc.v1.ForwardRequest"
4302+
output_type: ".google.protobuf.Empty"
4303+
}
4304+
method {
4305+
name: "Subscribe"
4306+
input_type: ".containerd.services.events.ttrpc.v1.SubscribeRequest"
4307+
output_type: ".containerd.services.events.ttrpc.v1.Envelope"
4308+
server_streaming: true
4309+
}
4310+
}
4311+
options {
4312+
go_package: "github.com/containerd/containerd/api/services/ttrpc/events/v1;events"
4313+
}
4314+
weak_dependency: 0
4315+
weak_dependency: 1
4316+
syntax: "proto3"
4317+
}
42054318
file {
42064319
name: "github.com/containerd/containerd/api/services/version/v1/version.proto"
42074320
package: "containerd.services.version.v1"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Copyright The containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package events defines the event pushing and subscription service.
18+
package events

0 commit comments

Comments
 (0)