Skip to content

Conversation

@crosbymichael
Copy link
Member

This adds support for dynamically loading *.so for 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.

root = "/var/lib/containerd"

[plugins.foo]
    somefield = 1

[plugins.bar]
    somefield = "different type"

Signed-off-by: Michael Crosby crosbymichael@gmail.com

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>
@crosbymichael crosbymichael force-pushed the plugins branch 2 times, most recently from 1cd4f44 to 8f534f2 Compare February 22, 2017 00:37
linux/Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why var[ariable]?

Copy link
Member Author

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?

Copy link
Member

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
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmcgowan up to you and @stevvooe . I just hacked it in because I needed to split out the service from the store.

Copy link
Member

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 :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to extent -> to extend

Copy link
Contributor

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
Copy link
Member

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
Copy link
Member

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need (R)Lock?

Copy link
Contributor

@mlaventure mlaventure left a 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 :))

Copy link
Contributor

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/

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the provided path...

@crosbymichael crosbymichael changed the title PoC. Use go 1.8 plugins for extending core functionality Use go 1.8 plugins for extending core functionality Feb 22, 2017
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Copy link
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mlaventure mlaventure merged commit 0a5544d into containerd:master Feb 22, 2017
@crosbymichael crosbymichael deleted the plugins branch February 22, 2017 21:16
type PluginType int

const (
RuntimePlugin PluginType = iota + 1
Copy link
Member

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?

Copy link
Member Author

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

fuweid added a commit to fuweid/containerd that referenced this pull request Oct 14, 2023
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>
fuweid added a commit to fuweid/containerd that referenced this pull request Oct 14, 2023
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>
fuweid added a commit to fuweid/containerd that referenced this pull request Oct 16, 2023
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>
juliusl pushed a commit to juliusl/containerd that referenced this pull request Jan 26, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants