-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Use go 1.8 plugins for extending core functionality #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Add registration for more subsystems via plugins Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Move content service to separate package Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
1cd4f44 to
8f534f2
Compare
linux/Makefile
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why var[ariable]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better place for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/usr/lib(64)?/containerd/plugins? Apache httpd does /usr/lib(64)?/httpd/modules and Firefox does /usr/lib(64)?/mozilla/plugins.
runtime.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: context stdlib can be used because 1.6 is no longer supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can do an update in another pr changing all of the places that contexts are used
content/content.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is starting to get replicated in many places and we were avoiding exporting them in the packages. Can we either use a central pool or just have the packages create their own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with keeping it like this for now, just wanted to highlight it so we remember to figure it out later :)
design/plugins.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to extent -> to extend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: s/but there is where/but this is where/
plugin.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the provided path into containerd
plugin.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the goal of this is to protect plugins from causing a panic on load then why propagate when not an error? If the panic was initiated without an error such as panic("something is wrong"), then it wouldn't get caught. Maybe either declare an error type which has an interface{} sub-value or set the error like fmt.Errorf('plugin panic: %v", v).
services/execution/service.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need (R)Lock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, few nits on comments (and also, it doesn't pass go test :))
design/plugins.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: s/but there is where/but this is where/
design/plugins.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/this can be use/ this can be used/
plugin.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the provided path...
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
8f534f2 to
fceafeb
Compare
dmcgowan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| type PluginType int | ||
|
|
||
| const ( | ||
| RuntimePlugin PluginType = iota + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that these are just the plugin types that you've stubbed out for now and not intended to be an exhaustive list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, just a few that we currently have implemented
We, containerd, suggest user to use binary plugins or RPC-based plugins. Since go plugin has too many restrictions, I'm not sure that how many users use the go plugin to extend the core function in the production. Based on the fact that we put a lot of effort to make external plugins better, suggest to deprecate go-plugin type plugin in v2.0 and remove it in v2.1 REF: containerd#556 Signed-off-by: Wei Fu <fuweid89@gmail.com>
We, containerd, suggest user to use binary plugins or RPC-based plugins. Since go plugin has too many restrictions, I'm not sure that how many users use the go plugin to extend the core function in the production. Based on the fact that we put a lot of effort to make external plugins better, suggest to deprecate go-plugin type plugin in v2.0 and remove it in v2.1 REF: containerd#556 Signed-off-by: Wei Fu <fuweid89@gmail.com>
We, containerd, suggest user to use binary plugins or RPC-based plugins. Since go plugin has too many restrictions, I'm not sure that how many users use the go plugin to extend the core function in the production. Based on the fact that we put a lot of effort to make external plugins better, suggest to deprecate go-plugin type plugin in v2.0 and remove it in v2.1 REF: containerd#556 Signed-off-by: Wei Fu <fuweid89@gmail.com>
We, containerd, suggest user to use binary plugins or RPC-based plugins. Since go plugin has too many restrictions, I'm not sure that how many users use the go plugin to extend the core function in the production. Based on the fact that we put a lot of effort to make external plugins better, suggest to deprecate go-plugin type plugin in v2.0 and remove it in v2.1 REF: containerd#556 Signed-off-by: Wei Fu <fuweid89@gmail.com>
This adds support for dynamically loading
*.sofor containerd to extend functionality in many areas. Runtime and new grpcs services to start with.It also adds a way to have type safe configuration sections in the containerd config for plugins.
Signed-off-by: Michael Crosby crosbymichael@gmail.com