Skip to content
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

[Carry #1517] Support v2 plugins; re-enable scheduler plugin filter #1808

Merged
merged 4 commits into from
Dec 14, 2016

Conversation

aaronlehmann
Copy link
Collaborator

@aaronlehmann aaronlehmann commented Dec 14, 2016

This carries #1517:

Fix #1231. It was disabled in #1224, due to lazy loading by the engine.

Using the plugins API, it is possible to list installed plugins.

One issue is that we don't have a way of storing arbitrary plugins in the TaskSpec, from which to match them against the node on which PluginFilter is applied. For volumes and networks, this happens via a separate code path that allows for attaching to networks or mounting volumes. This is something we might want to build to support general plugins, and will require proto changes. This PR will work for volume and network v2 plugins.

On top of this, it adds:

  • Fixes to the plugin filter to improve safety and consistency
  • Don't fail Describe if PluginList is unimplemented
  • Support for tags in plugin names

cc @nishanttotla @aluzzardi @vieux @anusha-ragunathan @tonistiigi

nishanttotla and others added 4 commits December 14, 2016 06:05
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Be consistent between SetTask and Check on which mounts are checked
against the plugin list.

Be more defensive against nil pointer dereferences.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This endpoint may not always be implemented or supported.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@aaronlehmann aaronlehmann added this to the 1.13.0 milestone Dec 14, 2016
@codecov-io
Copy link

codecov-io commented Dec 14, 2016

Current coverage is 55.36% (diff: 44.44%)

Merging #1808 into master will increase coverage by 0.24%

@@             master      #1808   diff @@
==========================================
  Files           102        102          
  Lines         16941      16957    +16   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           9338       9388    +50   
+ Misses         6444       6410    -34   
  Partials       1159       1159          

Sunburst

Powered by Codecov. Last update 0b22e16...56bcb2f

@vieux
Copy link
Contributor

vieux commented Dec 14, 2016

SGTM, workflow looks good

for _, plgn := range v2plugins {
for _, typ := range plgn.Config.Interface.Types {
if typ.Prefix == "docker" && plgn.Enabled {
plgnTyp := typ.Capability
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a good idea to be coercing capability to type?

What if there are multi-capability plugins?

}
plgnName := plgn.Name
if plgn.Tag != "" {
plgnName += ":" + plgn.Tag
Copy link
Contributor

Choose a reason for hiding this comment

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

For all of our effort, how did Tag end up being separated in plugins? Can we please fix this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Odd, when I went through search, field was still there.

func (f *PluginFilter) pluginExistsOnNode(pluginType string, pluginName string, nodePlugins []api.PluginDescription) bool {
for _, np := range nodePlugins {
if pluginType == np.Type && pluginName == np.Name {
if pluginType != np.Type {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comparison case sensitive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants