Skip to content

Commit

Permalink
Add ttrpc server to containerd
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crosby <[email protected]>
  • Loading branch information
crosbymichael committed Apr 9, 2019
1 parent db3a863 commit a8a805c
Show file tree
Hide file tree
Showing 12 changed files with 1,569 additions and 20 deletions.
4 changes: 4 additions & 0 deletions Protobuild.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ plugins = ["grpc", "fieldpath"]
prefixes = ["github.com/containerd/containerd/api/events"]
plugins = ["fieldpath"] # disable grpc for this package

[[overrides]]
prefixes = ["github.com/containerd/containerd/api/services/ttrpc/events/v1"]
plugins = ["ttrpc", "fieldpath"]

[[overrides]]
# enable ttrpc and disable fieldpath and grpc for the shim
prefixes = ["github.com/containerd/containerd/runtime/v1/shim/v1", "github.com/containerd/containerd/runtime/v2/task"]
Expand Down
113 changes: 113 additions & 0 deletions api/next.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4202,6 +4202,119 @@ file {
weak_dependency: 2
syntax: "proto3"
}
file {
name: "github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto"
package: "containerd.services.events.ttrpc.v1"
dependency: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto"
dependency: "gogoproto/gogo.proto"
dependency: "google/protobuf/any.proto"
dependency: "google/protobuf/empty.proto"
dependency: "google/protobuf/timestamp.proto"
message_type {
name: "PublishRequest"
field {
name: "topic"
number: 1
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "topic"
}
field {
name: "event"
number: 2
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".google.protobuf.Any"
json_name: "event"
}
}
message_type {
name: "ForwardRequest"
field {
name: "envelope"
number: 1
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".containerd.services.events.ttrpc.v1.Envelope"
json_name: "envelope"
}
}
message_type {
name: "SubscribeRequest"
field {
name: "filters"
number: 1
label: LABEL_REPEATED
type: TYPE_STRING
json_name: "filters"
}
}
message_type {
name: "Envelope"
field {
name: "timestamp"
number: 1
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".google.protobuf.Timestamp"
options {
65001: 0
65010: 1
}
json_name: "timestamp"
}
field {
name: "namespace"
number: 2
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "namespace"
}
field {
name: "topic"
number: 3
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "topic"
}
field {
name: "event"
number: 4
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".google.protobuf.Any"
json_name: "event"
}
options {
64400: 1
}
}
service {
name: "Events"
method {
name: "Publish"
input_type: ".containerd.services.events.ttrpc.v1.PublishRequest"
output_type: ".google.protobuf.Empty"
}
method {
name: "Forward"
input_type: ".containerd.services.events.ttrpc.v1.ForwardRequest"
output_type: ".google.protobuf.Empty"
}
method {
name: "Subscribe"
input_type: ".containerd.services.events.ttrpc.v1.SubscribeRequest"
output_type: ".containerd.services.events.ttrpc.v1.Envelope"
server_streaming: true
}
}
options {
go_package: "github.com/containerd/containerd/api/services/ttrpc/events/v1;events"
}
weak_dependency: 0
weak_dependency: 1
syntax: "proto3"
}
file {
name: "github.com/containerd/containerd/api/services/version/v1/version.proto"
package: "containerd.services.version.v1"
Expand Down
18 changes: 18 additions & 0 deletions api/services/ttrpc/events/v1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright The containerd 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 events defines the event pushing and subscription service.
package events
Loading

0 comments on commit a8a805c

Please sign in to comment.