
By replacing grpc with ttrpc, we can reduce total memory runtime requirements and binary size. With minimal code changes, the shim can now be controlled by the much lightweight protocol, reducing the total memory required per container. When reviewing this change, take particular notice of the generated shim code. Signed-off-by: Stephen J Day <stephen.day@docker.com>
68 lines
2.5 KiB
TOML
68 lines
2.5 KiB
TOML
version = "unstable"
|
|
generator = "gogoctrd"
|
|
plugins = ["grpc", "fieldpath"]
|
|
|
|
# Control protoc include paths. Below are usually some good defaults, but feel
|
|
# free to try it without them if it works for your project.
|
|
[includes]
|
|
# Include paths that will be added before all others. Typically, you want to
|
|
# treat the root of the project as an include, but this may not be necessary.
|
|
before = ["./protobuf"]
|
|
|
|
# Paths that should be treated as include roots in relation to the vendor
|
|
# directory. These will be calculated with the vendor directory nearest the
|
|
# target package.
|
|
packages = ["github.com/gogo/protobuf"]
|
|
|
|
# Paths that will be added untouched to the end of the includes. We use
|
|
# `/usr/local/include` to pickup the common install location of protobuf.
|
|
# This is the default.
|
|
after = ["/usr/local/include"]
|
|
|
|
# This section maps protobuf imports to Go packages. These will become
|
|
# `-M` directives in the call to the go protobuf generator.
|
|
[packages]
|
|
"gogoproto/gogo.proto" = "github.com/gogo/protobuf/gogoproto"
|
|
"google/protobuf/any.proto" = "github.com/gogo/protobuf/types"
|
|
"google/protobuf/empty.proto" = "github.com/gogo/protobuf/types"
|
|
"google/protobuf/descriptor.proto" = "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
|
"google/protobuf/field_mask.proto" = "github.com/gogo/protobuf/types"
|
|
"google/protobuf/timestamp.proto" = "github.com/gogo/protobuf/types"
|
|
"google/protobuf/duration.proto" = "github.com/gogo/protobuf/types"
|
|
"google/rpc/status.proto" = "github.com/containerd/containerd/protobuf/google/rpc"
|
|
|
|
[[overrides]]
|
|
prefixes = ["github.com/containerd/containerd/api/events"]
|
|
plugins = ["fieldpath"] # disable grpc for this package
|
|
|
|
[[overrides]]
|
|
# enable ttrpc and disable fieldpath and grpc for the shim
|
|
prefixes = ["github.com/containerd/containerd/linux/shim/v1"]
|
|
plugins = ["ttrpc"]
|
|
|
|
# Aggregrate the API descriptors to lock down API changes.
|
|
[[descriptors]]
|
|
prefix = "github.com/containerd/containerd/api"
|
|
target = "api/next.pb.txt"
|
|
ignore_files = [
|
|
"google/protobuf/descriptor.proto",
|
|
"gogoproto/gogo.proto"
|
|
]
|
|
|
|
# Lock down runc config
|
|
[[descriptors]]
|
|
prefix = "github.com/containerd/containerd/linux/runctypes"
|
|
target = "linux/runctypes/next.pb.txt"
|
|
ignore_files = [
|
|
"google/protobuf/descriptor.proto",
|
|
"gogoproto/gogo.proto"
|
|
]
|
|
|
|
[[descriptors]]
|
|
prefix = "github.com/containerd/containerd/windows/hcsshimtypes"
|
|
target = "windows/hcsshimtypes/next.pb.txt"
|
|
ignore_files = [
|
|
"google/protobuf/descriptor.proto",
|
|
"gogoproto/gogo.proto"
|
|
]
|