Commit Graph

594 Commits

Author SHA1 Message Date
Wei Fu
6b7e237fc7 chore: use go fix to cleanup old +build buildtag
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-12-29 14:25:14 +08:00
Maksym Pavlenko
a4d5c3e5cb Support sandboxed shims shutdown
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-14 18:22:52 -08:00
Maksym Pavlenko
e1abaeb386
Merge pull request #7764 from mxpv/config
Pass TOML configuration options for runtimes CRI is not aware of
2022-12-08 12:59:13 -08:00
Maksym Pavlenko
3bc8fc4d30 Cleanup build constraints
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-08 09:36:20 -08:00
Maksym Pavlenko
8ab1d44967 Pass runtime configuration as TOML blob
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-12-07 10:55:06 -08:00
Akihiro Suda
96a39ad53b
Merge pull request #7499 from Iceber/cleanup_shim_flag
runtime/v2/shim: clean up the use of containerdBinary
2022-11-22 22:01:23 +09:00
Kazuyoshi Kato
6596a70861 Use github.com/containerd/cgroups/v3 to remove gogo
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-11-14 21:07:48 +00:00
Maksym Pavlenko
3a9044f240 Rename darwin-kubelet to containerd
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-11-07 22:58:25 -08:00
Maksym Pavlenko
525fe21e22
Merge pull request #7604 from wzshiming/fix/close-fifo
Fix missing closed fifo
2022-11-03 20:55:28 -07:00
Shiming Zhang
c607f83c38 Fix missing closed fifo
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2022-11-04 10:13:47 +08:00
Maksym Pavlenko
2da7824683 Add sequence diagram for shim runtime v2
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-10-31 15:45:28 -07:00
Maksym Pavlenko
b7d0d12715 Cleanup sandbox interfaces
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-10-25 12:31:32 -04:00
Phil Estes
d7ea7de900
Merge pull request #7534 from mxpv/shim
Don't unmount on Darwin when deleting bundle
2022-10-17 08:27:05 -07:00
Maksym Pavlenko
fb6a40dc9d Don't unmount on Darwin when deleting bundle
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-10-14 14:35:24 -07:00
Kazuyoshi Kato
49a54e23cb Stats() shouldn't assume s.container is non-nil
Like other exported methods, Stats() shouldn't assume s.container is
non-nil.

Fixes #7468.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-10-12 22:11:49 +00:00
Iceber Gu
b7f6a68041 runtime/v2/shim: clean up the use of containerdBinary
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-10-09 18:22:48 +08:00
Daniel Canter
4333e6a6d6 Swap to net.ErrClosed checks for services
In Go 1.16 `net.ErrClosed` was exported, removing the need to check the
exact text of "use of closed network connection". The stdlib's net listeners
are all setup for this to be a reality, but on Windows containerd uses the
the go-winio projects named pipe implementation as the listener for services.
Before version 0.6.0 this project returned a different error named
`ErrPipeListenerClosed` for using a closed pipe, where this error was just
an `errors.New` with the same text as `net.ErrClosed`, so checking against
`net.ErrClosed` wasn't possible.

Starting in 0.6.0 go-winio has that error assigned to `net.ErrClosed` directly
so this *should* be alright to finally change.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-09-28 18:20:12 -07:00
Maksym Pavlenko
1d8b1bc75b Cleanup shim manager
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-08-11 21:41:32 -07:00
Maksym Pavlenko
ff65fc2d0e Make TaskList generic
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-08-10 14:02:53 -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
6acde90772
Merge pull request #7069 from fuweid/failpoint-in-runc-shimv2
test: introduce failpoint control to runc-shimv2 and cni
2022-07-26 23:12:20 -07:00
Maksym Pavlenko
500ff95f02 Make getServicesOpts a helper
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-22 19:38:45 -07:00
Wei Fu
b297775eaf runtime/v2/shim: return if error in load plugin
If there is any unskipable error during setuping shim plugins, we should
fail return error to prevent from leaky shim instance. For example,
there is error during init task plugin, the shim ttrpc server will not
contain any shim API method. The any call to the shim will receive that

  failed to create shim task: service containerd.task.v2.Task: not implemented

Then containerd can't use `Shutdown` to let the shim close. The shim
will be leaky. And also fail return if there is no ttrpc service.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
822cc51d84 runtime/v2: manager supports server interceptor
Currently, the runc shimv2 commandline manager doesn't support ttrpc
server's customized option, for example, the ttrpc server interceptor.
This commit is to allow the task plugin can return the
`UnaryServerInterceptor` option to the manager so that the task plugin
can do enhancement before handling the incoming request, like API-level
failpoint control.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
wllenyj
f710505f4a shim: fix debug flag not working
As we know, shim starts twice. The first time we execute the shim with the
`start` arguments, the `-debug` argument is passed to the shim
process correctly. But the second time we execute shim, the debug flag
is ignored.

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-05-11 22:09:12 +08:00
Derek McGowan
6fda809e1b
Merge pull request #6866 from ambarve/cleanup_leaked_shim
Cleanup leaked shim process
2022-05-02 16:52:31 -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
Amit Barve
46773c3417 Cleanup leaked shim process
If containerd crashes while creating a container the shim process stays alive and is never
cleaned up. Details are discussed in issue containerd/containerd#6860. This fixes the code
to cleanup such shim processes on containerd restart.

Signed-off-by: Amit Barve <ambarve@microsoft.com>
2022-04-27 11:43:23 -07:00
Kazuyoshi Kato
9dbe000a38 make protos
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:31:53 +00:00
Kazuyoshi Kato
e3db7de8f5 Remove gogo/protobuf and adjust types
This commit migrates containerd/protobuf from github.com/gogo/protobuf
to google.golang.org/protobuf and adjust types. Proto-generated structs
cannot be passed as values.

Fixes #6564.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-22 15:31:53 +00:00
Phil Estes
320ef912bc
Merge pull request #6835 from kzys/proto-upgrade-5
Prepare for google.golang.org/protobuf
2022-04-21 14:24:04 +01:00
Kazuyoshi Kato
aa1526defc Use proto.Marshal instead of calling Marshal() on objects
With google.golang.org/protobuf, proto-generated objects only have
ProtoReflect(). They don't have Marshal() anymore (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 17:14:24 +00:00
Ye Sijun
35994a475c
fix monitor restart
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2022-04-20 21:44:29 +08:00
Fu Wei
d85ac56050
Merge pull request #6830 from Junnplus/fix-monitor 2022-04-20 15:56:04 +08:00
Ye Sijun
22cd13b370
fix nil pointer panic for monitor
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2022-04-20 15:04:36 +08: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
Derek McGowan
902212651b
Merge pull request #6826 from kzys/ptypes
Consolidate gogo/protobuf dependencies under our own protobuf package
2022-04-19 10:13:56 -07:00
Fu Wei
9503d7219e
Merge pull request #6744 from Junnplus/restart-policy
Add restart policy for enhanced restart manager
2022-04-20 00:12:31 +08:00
Kazuyoshi Kato
88c0c7201e Consolidate gogo/protobuf dependencies under our own protobuf package
This would make gogo/protobuf migration easier.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 15:53:36 +00: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
Derek McGowan
be60973a30
Merge pull request #6703 from mxpv/s
Sandbox API
2022-04-18 20:55:06 -07:00
Derek McGowan
fe8da6dcaf
Move lease manager plugin to separate package
Create lease plugin type to separate lease manager from services plugin.
This allows other service plugins to depend on the lease manager.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-04-15 11:08:47 -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
fa02477ca9 [sandbox] Add sandbox shim skeleton
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:48 -07:00
Maksym Pavlenko
35195737e7 [sandbox] Register shim plugin after #6301
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:48 -07:00
Maksym Pavlenko
17a2aaded3 [sandbox] Add ctr support
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:48 -07:00
Maksym Pavlenko
982de8a5d5 Launch sandboxed containers from task service
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:47 -07:00
Maksym Pavlenko
6343fe3ea2 [sandbox] Implement sandbox controller
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-08 13:33:47 -07:00