Commit Graph

32 Commits

Author SHA1 Message Date
Iceber Gu
0bbca7f1bc Cleanup protobuild config
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-22 13:28:41 +08:00
Iceber Gu
5956cdea87 Remove third-party package cri-api
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-16 17:48:53 +08:00
Maksym Pavlenko
07c2ae12e1 Remove v1 runctypes
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-15 09:18:16 -07:00
Kazuyoshi Kato
52a7480399 Remove github.com/gogo/protobuf again
While we need to support CRI v1alpha2, the implementation doesn't have
to be tied to gogo/protobuf.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-12-15 22:54:15 +00:00
Kazuyoshi Kato
fcba486366 Remove gogo from .proto files
While gogo isn't actually used, it is still referenced from .proto files
and its corresponding Go package is imported from the auto-generated
files.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-27 20:27:55 +00:00
Kazuyoshi Kato
fd37cc75be Use protoc-gen-go instead of protoc-gen-gogoctrd
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:31:53 +00:00
Maksym Pavlenko
e2fd25f3d8 Move runtime v2 proto
Move runtime v2 protos to api/runtime package.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-19 17:59:33 -07:00
Kazuyoshi Kato
77c0539e9a Use containerd/protobuild instead of stevvooe/protobuild
The new version still supports gogo/protobuf, but can be used with newer
protobuf packages if version = 2.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-02-22 00:03:31 +00:00
Davanum Srinivas
494b940f14
Introduce a new go module - containerd/api for use in standalone clients
In containerd 1.5.x, we introduced support for go modules by adding a
go.mod file in the root directory. This go.mod lists all the things
needed across the whole code base (with the exception of
integration/client which has its own go.mod). So when projects that
need to make calls to containerd API will pull in some code from
containerd/containerd, the `go mod` commands will add all the things
listed in the root go.mod to the projects go.mod file. This causes
some problems as the list of things needed to make a simple API call
is enormous. in effect, making a API call will pull everything that a
typical server needs as well as the root go.mod is all encompassing.
In general if we had smaller things folks could use, that will make it
easier by reducing the number of things that will end up in a consumers
go.mod file.

Now coming to a specific problem, the root containerd go.mod has various
k8s.io/* modules listed. Also kubernetes depends on containerd indirectly
via both moby/moby (working with docker maintainers seperately) and via
google/cadvisor. So when the kubernetes maintainers try to use latest
1.5.x containerd, they will see the kubernetes go.mod ending up depending
on the older version of kubernetes!

So if we can expose just the minimum things needed to make a client API
call then projects like cadvisor can adopt that instead of pulling in
the entire go.mod from containerd. Looking at the existing code in
cadvisor the minimum things needed would be the api/ directory from
containerd. Please see proof of concept here:
github.com/google/cadvisor/pull/2908

To enable that, in this PR, we add a go.mod file in api/ directory. we
split the Protobuild.yaml into two, one for just the things in api/
directory and the rest in the root directory. We adjust various targets
to build things correctly using `protobuild` and also ensure that we
end up with the same generated code as before as well. To ensure we
better take care of the various go.mod/go.sum files, we update the
existing `make vendor` and also add a new `make verify-vendor` that one
can run locally as well in the CI.

Ideally, we would have a `containerd/client` either as a standalone repo
or within `containerd/containerd` as a separate go module. but we will
start here to experiment with a standalone api go module first.

Also there are various follow ups we can do, for example @thaJeztah has
identified two tasks we could do after this PR lands:

github.com/containerd/containerd/pull/5716#discussion_r668821396

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-27 07:34:59 -04:00
Michael Crosby
0f4374169e Add proto path /usr/include to Protobuild
This fixes proto compiles on alpine based systems.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-11-07 14:36:54 -05:00
Justin Terry (VM)
4b5dfaee13 Completely remove Windows v2 in-tree shim
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-08-05 16:49:56 -07:00
Michael Crosby
f055bdb0aa Remove windows v1 runtime
Closes #3094

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-23 18:54:37 +00:00
Michael Crosby
a8a805cad3 Add ttrpc server to containerd
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-04-09 13:08:23 -04:00
Justin Terry (VM)
ec3dbd155e Add io.containerd.runhcs.v1 shim proto options
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-11-05 09:08:48 -08:00
Michael Crosby
17ab11a236 Fixes for runtimev2 and checkpoint restore
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-20 12:09:29 -04:00
Michael Crosby
da1b5470cd Runtime v2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-17 10:21:29 -04:00
Evan Hazlett
821c8eaa91
runtime/linux/shim -> runtime/shim
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-06-06 14:35:06 -04:00
Evan Hazlett
cae94b930d linux -> runtime/linux
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-05-30 09:23:10 -04:00
Stephen J Day
caac3bca3e
protobuf: remove generated google/rpc files
We move from having our own generated version of the googleapis files to
an upstream version that is present in gogo. As part of this, we update
the protobuf package to 1.0 and make some corrections for slight
differences in the generated code.

The impact of this change is very low.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2018-04-05 14:36:32 -07:00
Stephen J Day
e8f52c35ce
linux/shim: reduce memory overhead by using ttrpc
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>
2017-11-22 12:21:48 -08:00
Derek McGowan
5c6e789dde
Merge pull request #1769 from stevvooe/split-events-types
api/events: split event types from events service
2017-11-16 16:29:28 -08:00
Stephen J Day
09b5ca1072
api/events: split event types from events service
To avoid importing all of grpc when consuming events, the types of
events have been split in to a separate package. This should allow a
reduction in memory usage in cases where a package is consuming events
but not using the gprc service directly.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-16 15:20:46 -08:00
Stephen J Day
c5022ad92d
protobuf: use the gogo/types package for empty
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-15 19:08:54 -08:00
Jess Valarezo
0961807715 rename runcopts to runctypes
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-10 11:43:51 -08:00
Jess Valarezo
830e0ea339 Change hcsshimopts to hcsshimtypes package
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-11 11:42:07 -07:00
Stephen J Day
363d692f35
api/services: define the introspection API
After several requests for information about platform support,
configuration introspection and feature switches, we now have a solution
that should work in all these use cases. The Introspection API hooks
into the plugin subsystem registration process. During registration,
plugins declare several pieces of information, allowing clients to
discover the cababilities and support that a containerd instance
provides, including whether or not it loaded with an error.

To allow symmetrical error reporting, the `google/rpc.Status` protobuf
definitions have been brought in from the googleapis project.
Unfortunately, we had to generate these in place to match our protobuf
system.

Once we like this design, we can add an implementation to integrate it
directly with the plugin system.

Enjoy!

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Stephen J Day
a73eb2b2ce
api: generate merged descriptors when building protobufs
When we generate protobufs, descriptors outlining all messages and
services are merged into a single file that can be used to identify
unexpected changes to the API that may affect stability. We follow a
similar process to Go's stability guarantees using the protobuf
descriptors to identify changes before they become a problem.

Please see README.md for details.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-08-04 16:50:28 -07:00
Stephen J Day
d986a187d7
api: cleanup protobuf imports
There were a few files printing warnings during the build due to
erroneous imports. These imports have now been removed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-08-04 12:57:43 -07:00
Stephen J Day
c857ba2d0b
events: autogenerate fieldpath filters
To ensure consistent fieldpath matching for events, we generate the
fieldpath matching using protobuf definitions. This is done through a
plugin called "fieldpath" that defines a `Field` method for each type
with the plugin enabled. Generated code handles top-level envelope
fields, as well as deferred serialization for matching any types.

In practice, this means that we can cheaply match events on `topic` and
`namespace`. If we want to match on attributes within the event, we can
use the `event` prefix to address these fields. For example, the
following will match all envelopes that have a field named
`container_id` that has the value `testing`:

```
ctr events "event.container_id==testing"
```

The above will decode the underlying event and check that particular
field. Accordingly, if only `topic` or `namespace` is used, the event
will not be decoded and only match on the envelope.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-08-01 14:09:38 -07:00
He Xiaoxi
856c351fac Improve the comment
Signed-off-by: He Xiaoxi <tossmilestone@gmail.com>
2017-07-22 12:39:34 +08:00
He Xiaoxi
b6dbbd337d Fix typo error in Protobuild.toml
Signed-off-by: He Xiaoxi <tossmilestone@gmail.com>
2017-07-19 20:28:33 +08:00
Stephen J Day
6c925924db
protobuild: replace protobuild command
To make the protobuild tool broadly useful, it has been broken out into
a separate project. This PR replaces the command with a configuration
file.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-14 14:10:06 -07:00