Commit Graph

76 Commits

Author SHA1 Message Date
Maksym Pavlenko
33786ee4d2 Add plugin dependency between shim and shim services
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:37:00 -07:00
Brian Goff
084387e0b4 Move tracing to plugin
This just makes the implementation a little cleaner.
It also makes the trace exporter pluggable.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-09-21 21:19:46 +00:00
wssccc
8596d11886 Fix typo
Signed-off-by: Ng Yang <wssccc@qq.com>
2021-09-15 03:13:25 +00:00
Fu Wei
e1ad779107
Merge pull request #5817 from dmcgowan/shim-plugins
Add support for shim plugins
2021-09-12 18:18:20 +08:00
Akihiro Suda
d3aa7ee9f0
Run go fmt with Go 1.17
The new `go fmt` adds `//go:build` lines (https://golang.org/doc/go1.17#tools).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-22 09:31:50 +09:00
Derek McGowan
8d135d2842
Add support for shim plugins
Refactor shim v2 to load and register plugins.
Update init shim interface to not require task service implementation on
returned service, but register as plugin if it is.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-08-17 11:06:09 -07:00
Derek McGowan
0a0621bb47
Move plugin context events into separate plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-08-05 22:59:20 -07:00
wanglei01
3a0b9ec6bb Add unit test for plugin
Signed-off-by: wanglei <wllenyj@linux.alibaba.com>
2021-07-02 18:43:34 +08:00
Iceber Gu
98f5922b5e plugin: optimize the check for the last registration
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-04-30 23:32:04 +08:00
Sebastiaan van Stijn
dc92ad6520
Replace errors.Cause() with errors.Is()
Dependencies may be switching to use the new `%w` formatting
option to wrap errors; switching to use `errors.Is()` makes
sure that we are still able to unwrap the error and detect the
underlying cause.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-08 14:36:45 +02:00
Shengjing Zhu
465c11dc87 Fix build with gccgo
+ archive: don't convert syscall.Timespec to unix.Timespec
  archive/tar_unix.go:179:76: error: invalid type conversion (cannot use type syscall.Timespec as type unix.Timespec)
    179 |  timespec := []unix.Timespec{unix.Timespec(fs.StatAtime(st)), unix.Timespec(fs.StatMtime(st))}
+ gccgo has no plugin support
  https://github.com/golang/go/issues/36403
+ update github.com/containerd/continuity
  to include same fix for Timespec

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-01-07 19:28:26 +08:00
Kevin Parsons
d7e1b25384 Allow explicit configuration of TTRPC address
Previously the TTRPC address was generated as "<GRPC address>.ttrpc".
This change now allows explicit configuration of the TTRPC address, with
the default still being the old format if no value is specified.

As part of this change, a new configuration section is added for TTRPC
listener options.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-08-22 00:56:27 -07:00
Michael Crosby
9547d269a1 Add v2 server config support with plugin URIs
Closes #3210

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-10 17:54:20 +00:00
Michael Crosby
b911ae3428 Add tcp service for grpc listeners
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-04-10 11:12: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
Michael Crosby
84a24711e8 Add runc.v2 multi-shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-02-21 11:09:46 -05:00
Wei Fu
132ee9b826 fix: linter issue
megacheck, gosimple and unused has been deprecated and subsumed by
staticcheck. And staticcheck also has been upgraded. we need to update
code for the linter issue.

close: #2945

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-01-23 22:54:51 +08:00
Michael Crosby
da1b5470cd Runtime v2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-17 10:21:29 -04:00
Michael Crosby
2b565da7ec Add restart monitor
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-05-16 13:07:23 -04:00
Michael Wan
7fd6d5e2be fix words misspell
Signed-off-by: Michael Wan <zirenwan@gmail.com>
2018-04-23 00:09:42 -04:00
Lantao Liu
1128b3d664 Add service plugin and support in process integration.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-12 18:03:50 +00:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Lantao Liu
eee592c3ac Support disable plugins.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-06 23:39:44 +00:00
Stephen J Day
5cab90d270
log: remove log "module" system
After comtemplation, the complexity of the logging module system
outweighs its usefulness. This changeset removes the system and restores
lighter weight code paths. As a concession, we can always provide more
context when necessary to log messages to understand them without having
to fork the context for a certain set of calls.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2018-01-18 11:22:13 -08:00
Kir Kolyshkin
0d682e24a1 plugins: don't compile for static build
We can't really use `dlopen()` from a statically built binary, so
let's disable this functionality if `static_build` tag is used
(which is sort of a de-facto standard way of doing it).

This eliminates the following warning:

	🇩 bin/containerd
	# github.com/containerd/containerd/cmd/containerd
	/tmp/go-link-509179974/000004.o: In function `pluginOpen':
	/usr/local/go/src/plugin/plugin_dlopen.go:19: warning: Using 'dlopen' in
	statically linked applications requires at runtime the shared libraries
	from the glibc version used for linking

[v2: add static build instructions to BUILDING.md]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-11-28 21:29:09 -08:00
Derek McGowan
00596f400e
Add gc policy plugin
Add garbage collection as a background process and policy
configuration for configuring when to run garbage collection.
By default garbage collection will run when deletion occurs
and no more than 20ms out of every second.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-11-20 16:57:39 -08:00
Michael Crosby
a70b95b202 Move events exchange into subpackage
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-07 10:51:12 -05:00
Michael Crosby
1d298c89a4 Fix windows lint issues and enable ci
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-25 16:15:45 -04:00
Michael Crosby
b6e0c4f321 Fix go lint errors
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-25 15:26:44 -04:00
Michael Crosby
5fd0415985 Add comments and fix common lint issues
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-20 13:19:14 -04:00
Derek McGowan
d9db1d112d
Refactor differ into separate package
Add differ options and package with interface.
Update optional values on diff interface to use options.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:02:29 -07:00
Stephen J Day
49814646cf
plugin: allow declaring a plugin depends on all others
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Stephen J Day
8508e8252b
plugin: refactor plugin system to support initialization reporting
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Stephen J Day
d8bd6b70ce
plugin: allow querying plugin graph to be re-entrant
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Michael Crosby
451421b615 Comment more packages to pass go lint
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-02 13:54:56 -04:00
Kenfe-Mickael Laventure
642620cae3
Resurrect State directory
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-08-03 09:15:53 -07:00
Stephen J Day
a615a6fe5d
events: refactor event distribution
In the course of setting out to add filters and address some cleanup, it
was found that we had a few problems in the events subsystem that needed
addressing before moving forward.

The biggest change was to move to the more standard terminology of
publish and subscribe. We make this terminology change across the Go
interface and the GRPC API, making the behavior more familier. The
previous system was very context-oriented, which is no longer required.

With this, we've removed a large amount of dead and unneeded code. Event
transactions, context storage and the concept of `Poster` is gone. This
has been replaced in most places with a `Publisher`, which matches the
actual usage throughout the codebase, removing the need for helpers.

There are still some questions around the way events are handled in the
shim. Right now, we've preserved some of the existing bugs which may
require more extensive changes to resolve correctly.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-25 15:08:09 -07:00
Michael Crosby
6578565216 Use event service post for shim events
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-07 16:30:57 -07:00
Derek McGowan
3db8adc5d7
Update plugin load and snapshot service
Allow plugins to be mapped and returned by their ID.
Add skip plugin to allow plugins to decide whether they should
be loaded.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-06-29 16:16:26 -07:00
Michael Crosby
7c8acca29a Move runtime interfaces to runtime package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-28 10:10:59 -07:00
Michael Crosby
f36e0193a4 Implement task update
This allows tasks to have their resources updated as they are running.

Fixes #1067

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-26 16:38:49 -07:00
Michael Crosby
990536f2cc Move shim protos into linux pkg
This moves the shim's API and protos out of the containerd services
package and into the linux runtime package. This is because the shim is
an implementation detail of the linux runtime that we have and it is not
a containerd user facing api.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-23 16:21:47 -07:00
Kenfe-Mickaël Laventure
40f2627ce1 Merge pull request #1008 from crosbymichael/kill-error
Fix error on double Kill calls
2017-06-23 13:48:49 -07:00
Michael Crosby
3b9d9dfa3e Fix error on doulbe Kill calls
This returns a typed error for calls to Kill when the process has
already finished.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-23 13:28:48 -07:00
Michael Crosby
a6e77432df Create server package for containerd daemon
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-22 13:08:19 -07:00
Michael Crosby
235869eb1f Rename execution service to tasks
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-21 14:39:25 -07:00
Michael Crosby
8b2cf6e8e6 Fix Wait() on process/tasks
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-21 13:48:24 -07:00
Michael Crosby
8830866eed Remove events from Runtime
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-21 13:34:24 -07:00
Michael Crosby
94eafaab60 Update GRPC for consistency
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-21 13:34:24 -07:00
Michael Crosby
f3d9aae6e9 Merge pull request #956 from ehazlett/events-service
Events Service
2017-06-20 13:23:19 -07:00