Commit Graph

342 Commits

Author SHA1 Message Date
Maksym Pavlenko
aa3303b697 Update sandbox protobuf to match CRI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-29 16:08:07 -07:00
Maksym Pavlenko
8823224174 Update controller's start response to incldue pid and labels
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-29 16:08:07 -07:00
Brian Goff
f5fb2c32d2 Regenerate protos with updated protoc-gen-go
This fixes CI issues

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-07-28 16:59:30 +00:00
Derek McGowan
4ac1031e0c
Add snapshotter key to snapshot events
Consumers of snapshot events require the snapshotter
field to refer to the related snapshot.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-06-20 18:25:53 -07:00
Kazuyoshi Kato
29b9379560 make protos
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-27 21:31:16 +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
9dbe000a38 make protos
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:31:53 +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
Kazuyoshi Kato
01dfb110c4 Add go_package on all proto files
Seems it is no longer optional after migratring off from
gogo/protobuf (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 17:29:15 +00:00
Kazuyoshi Kato
237ef0de9b Remove all gogoproto extensions
This commit removes the following gogoproto extensions;

- gogoproto.nullable
- gogoproto.customename
- gogoproto.unmarshaller_all
- gogoproto.stringer_all
- gogoproto.sizer_all
- gogoproto.marshaler_all
- gogoproto.goproto_unregonized_all
- gogoproto.goproto_stringer_all
- gogoproto.goproto_getters_all

None of them are supported by Google's toolchain (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 07:23:28 +00:00
Maksym Pavlenko
bd90ce043b Keep shim API backward compatible
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-19 18:46:02 -07: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
80b825ca2c Remove gogoproto.stdtime
This commit removes gogoproto.stdtime, since it is not supported by
Google's official toolchain
(see https://github.com/containerd/containerd/issues/6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 13:39:30 +00:00
Maksym Pavlenko
85a49e4ee7 [sandbox] Cleanup interfaces
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:34:50 -07:00
Maksym Pavlenko
de49745723 [sandbox] Fix CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:34:48 -07:00
Maksym Pavlenko
b7a36950f6 [Sandbox] Add Wait and PID
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:48 -07:00
Maksym Pavlenko
0d165e6544 Restore sandboxes on daemon restart
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:48 -07:00
Maksym Pavlenko
0c5e5c3579 Fix protobuf after rebase
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:48 -07:00
Maksym Pavlenko
00f7a6bf2b [sandbox] Address PR review comments
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:47 -07:00
Maksym Pavlenko
4445d0a8da [sandbox] Add protobuf definitions
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:47 -07:00
Kazuyoshi Kato
067611fdea Remove enumvalue_customname, goproto_enum_prefix and enum_customname
This commit removes gogoproto.enumvalue_customname,
gogoproto.goproto_enum_prefix and gogoproto.enum_customname.

All of them make proto-generated Go code more idiomatic, but we already
don't use these enums in our external-surfacing types and they are anyway
not supported by Google's official toolchain (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-03-21 19:48:16 +00:00
Kazuyoshi Kato
3eeeb9429a Remove gogoproto.customtype
gogoproto.customtype is used to have go-digest.Digest instead of string.
While it is convinient, protoc-gen-go doesn't support the extension
and that blocks #6564.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-03-18 23:14:44 +00:00
Michael Crosby
82bce322da
Merge pull request #6558 from kzys/no-weak-import
Do not use weak import
2022-03-01 16:40:48 -05: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
Kazuyoshi Kato
296f75bd07 Do not use weak import
According to https://github.com/protocolbuffers/protobuf/issues/9184

> Weak fields are an old and deprecated internal-only feature that we never
> open sourced.

This blocks us to upgrade protoc.

Fixes #6232.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-02-21 18:26:40 +00:00
Derek McGowan
fcb7bd6997
Remove api go submodule
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-01-18 14:48:33 -08:00
Kazuyoshi Kato
2fb739aa21 Upgrade OpenTelemetry dependencies
This commit upgrades the packages under go.opentelemetry.io/.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 22:35:57 +00:00
Derek McGowan
d055487b00
Merge pull request #6206 from mxpv/path
Allow absolute path to shim binaries
2021-11-15 18:05:48 -08:00
Daniel Canter
920b24793d go.mod: Bump ttrpc to 1.1.0
This tag contains a fix for a deadlock observed when there are multiple
simultaneous requests from the same client connection.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-11-10 10:20:14 -08:00
Maksym Pavlenko
d4f4c1380a Add runtime path in CreateTaskRequest
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-04 07:33:11 -07:00
Brian Goff
1ee2bff0e0 Update go otel 1.0.1
This fixes the issue with the usage of the deprecated attribute.Any
function that original caused build issues.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-10-06 00:42:56 +00:00
Sebastiaan van Stijn
483d2e947f
go.mod: update opentelemetry modules to v1.0.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-09-22 16:24:17 +02:00
Davanum Srinivas
43117cf919
Script to check if entries in go.mod files are in sync
- ensure that the root go.mod and the module specific go.mod have the
  same `require` and `replace` directives for different dependencies.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-27 17:52:32 -04: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
Aditi Sharma
1423e9199d Update gogo/protobuf to v1.3.2
bump version 1.3.2 for gogo/protobuf due to CVE-2021-3121 discovered
in gogo/protobuf version 1.3.1, CVE has been fixed in 1.3.2

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-01-28 12:57:50 +00:00
Maksym Pavlenko
c1b01eabc0 Add copyright header to proto files
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-01-05 10:44:07 -08:00
Kathryn Baldauf
95ba6e9f75 Add annotations to task update request api
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
2020-11-09 14:13:33 -08:00
Akihiro Suda
8e448bb279 vendor protobuf & grpc
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-26 10:57:05 +09:00
Arnaud Rebillout
773adf7ab6 Remove the executable bit for api/*.txt files
These are text files so there's no reason these files are executable,
unless I'm missing something? Maybe it's something that doesn't show on
a Windows filesystem, only on Linux or macOS, hence nobody noticed?

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2020-02-19 16:32:52 +07:00
Derek McGowan
123af61c0b
Add Cleanup to snapshot API
Cleanup is an optional method a snapshotter may implement.
Cleanup can be used to cleanup resources after a snapshot
has been removed. This function allows a snapshotter to defer
longer resource cleanup until after snapshot removals are
completed. Adding this to the API allows proxy snapshotters
to leverage this enhancement.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-01-07 14:59:20 -08:00
bpopovschi
e8c14c07c6
Added filters to snapshots API
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
2019-10-24 11:11:22 -07:00
Michael Crosby
f867401c69 Use fds and pass Payloads over diff api
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-07 18:35:55 +00:00
Michael Crosby
9f0bc2b53f Add UUID and server info to introspection
Closes #1862

This adds a new rpc to the introspection service to provide server
information with a generated UUID that is done on demand and the os and
arch of the server.

ctr output:

```bash
> sudo ctr version

Client:
  Version:  v1.2.0-802-g57821695.m
  Revision: 578216950de9c1c188708369e2a31ac6c494dfee.m

Server:
  Version:  v1.2.0-802-g57821695.m
  Revision: 578216950de9c1c188708369e2a31ac6c494dfee.m
  UUID: 92e982a9-f13e-4a2c-9032-e69b27fed454
  OS: linux
  ARCH: amd64
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-06 14:40:48 +00:00
Nitesh Konkar
594f423190 protobuf: Bump Protobuf version to 3.7.0
Bump Protobuf version to 3.7.0

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-08-01 13:48:37 +05:30
Wei Fu
8a388d6238 leases: support resource management
Add three methods for lease service so that the client can use it to
manage the resource by lease, not just gc.root label. With the following
methods, it is easy for client to maintain their own cache system.

```
 - AddResource(context.Context, Lease, Resource) error
 - RemoveResource(context.Context, Lease, Resource) error
 - ListResources(context.Context, Lease) ([]Resource, error)
```

And the resource is to be

```golang
type Resource {
  ID   string
  Type string
}
```

For the snapshots, the Type field will be formatted by
snapshots/%{type}, like snapshots/overlayfs.

fix: #3295

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-05-29 11:00:32 +08:00
Michael Crosby
4ba756edda Fix API forward events for shims
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-04-10 13:34:34 -04:00
Michael Crosby
a6f587e4c4 Use ttrpc to publish runtime v2 events
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-04-09 14:38:50 -04: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
Sebastiaan van Stijn
2d11f5e6d5
Regenerate protobufs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-03 23:41:15 +02:00
Michael Crosby
9b882c44f8
Merge pull request #3000 from stefanberger/descriptor_annotations.pr
Add missing annotations map to Descriptor for gRPC transfer
2019-03-22 14:05:44 -04:00