Commit Graph

52 Commits

Author SHA1 Message Date
c651955564 Add plugin API version.
This version is across all plugin types and it versions the actual RPC
API between the daemon and the plugin.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 110e9733904682e416eb7397dd9cbf09805af29c
Component: engine
2016-10-18 09:07:16 -07:00
effa6f4094 Update plugingetter import path in docker/docker.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: a98be0344b24d71235c17a87ff425f3d602e48e8
Component: engine
2016-10-11 11:24:18 -07:00
6363780a38 Remove restartmanager from plugins
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a452d1fccb6d515545dacd4bebfa36cbf70a6535
Component: engine
2016-10-07 12:10:13 -07:00
434bea436a Remove hacked Windows OCI spec, compile fixups
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 02309170a5fb97d40260d0ee9e24b44be8c780b2
Component: engine
2016-09-27 12:07:35 -07:00
fe313a4545 Add Handle method to plugingetter.
This is necessary for IPAM and network plugins.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: b3bd7f80afea51d42d3bd2d194d36a6852a7d51f
Component: engine
2016-09-26 11:06:26 -07:00
f07146ebf8 Make graphdrivers work with pluginv2.
As part of making graphdrivers support pluginv2, a PluginGetter
interface was necessary for cleaner separation and avoiding import
cycles.

This commit creates a PluginGetter interface and makes pluginStore
implement it. Then the pluginStore object is created in the daemon
(rather than by the plugin manager) and passed to plugin init as
well as to the different subsystems (eg. graphdrivers, volumedrivers).
A side effect of this change was that some code was moved out of
experimental. This is good, since plugin support will be stable soon.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: fefea805e930a67fb6327f8e59415932861358cb
Component: engine
2016-09-20 08:49:48 -07:00
ca8908a3a8 add check plugin is not used before rm
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: b22d07f51573e39069b4e3a6d8b0580958412e72
Component: engine
2016-09-15 13:50:57 -07:00
92f94b6c20 correct some nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9279a93f6d43da4c904eeb0adb249fdfa34f7f92
Component: engine
2016-09-15 12:17:58 +08:00
7bef93723c Initial implementation of containerd Checkpoint API.
Signed-off-by: boucher <rboucher@gmail.com>
Upstream-commit: d8fef66b03c1ea8715470690efbd950033f7f628
Component: engine
2016-09-08 21:31:52 -04:00
45ddc4bfcb Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 91e197d614547f0202e6ae9b8a24d88ee131d950
Component: engine
2016-09-07 11:05:58 -07:00
2f08c46e47 Adding pluginv2 support for libnetwork (part 1)
Legacy plugins (aka pluginv1) calls in libnetwork are replaced with
calls using the new plugin model (aka pluginv2). pkg/plugins is still
used for managing the http client connections to the plugin.

This commit makes the necessary changes in docker/docker. Part 2 will
will take care of the libnetwork changes.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 17b8aba1d924e505563af400d758b89c8406961d
Component: engine
2016-09-06 14:30:55 -07:00
ec70ce176c Reorganize plugin package into sub packages.
Split plugin package into `store` and `v2/plugin`. Now the functionality
is clearly delineated:
- Manager: Manages the global state of the plugin sub-system.
- PluginStore: Manages a collection of plugins (in memory and on-disk)
- Plugin: Manages the single plugin unit.

This also facilitates splitting the global PluginManager lock into:
- PluginManager lock to protect global states.
- PluginStore lock to protect store states.
- Plugin lock to protect individual plugin states.

Importing "github.com/docker/docker/plugin/store" will provide access
to plugins and has lesser dependencies when compared to importing the
original monolithic `plugin package`.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 27a55fba28ff9c085385254cb69ecc8ea6891aa9
Component: engine
2016-08-27 11:08:08 -07:00
67ccfbdecc Merge pull request #25424 from vieux/enabled
replace active by enabled for consistency in plugins
Upstream-commit: ed0dff8f16716b4f6debfc191124e98750dd05bb
Component: engine
2016-08-26 15:22:41 -07:00
e44f33953e replace active by enabled for consistency in plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: cf4e268115911e9e4a4da94dc00b2dc370f86a47
Component: engine
2016-08-25 20:42:49 -07:00
9f32495eeb Cleanup fallback to V1 plugins logic.
handleLegacy is a flag to indicate whether daemon is supporting legacy
plugins. When the time comes to remove support for legacy plugins,
flipping this bool is all that will be needed to remove legacy plugin
support. This can be a global variable rather than be embedded in the
manager, thereby cleaning up code.

Also rename to allowV1PluginsFallback for clarity.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 031a2a5c4b58a153e6e76a573abfa6359d1c321a
Component: engine
2016-08-25 11:39:47 -07:00
87a50d0cba Merge pull request #25816 from anusha-ragunathan/vol-plugin-list
Make `docker volume list` lookup plugins installed using new model.
Upstream-commit: 0c6926070f775987de19e34e6f8da95cae156195
Component: engine
2016-08-25 19:02:25 +02:00
83016f7351 Make docker pull detect plugin content and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 9b6dcc8b9d1366d3da3c8f60f89de1a36b087b88
Component: engine
2016-08-20 12:54:35 -07:00
78f61f4f99 Make docker volume list lookup plugins installed using new model.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 59c45f7c0a5ba183f393e61e7ca7597809463410
Component: engine
2016-08-17 13:27:43 -07:00
6c683fac48 Replace old oci specs import with runtime-specs
Fixes #25804

The upstream repo changed the import paths.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 041e5a21dc0a8856448e3a9ad91e8535b8a7d00d
Component: engine
2016-08-17 09:38:34 -07:00
5c4fc1cbb0 Merge pull request #25638 from anusha-ragunathan/fix-plugin-tests
Debugging issue #25511
Upstream-commit: 6e70a976ba98c24ed4027f2b8e5890718be57344
Component: engine
2016-08-16 15:13:31 -07:00
ca823e9707 Merge pull request #25597 from vieux/check_plugin_manifest_json
check plugin manifest is correctly formatted before push
Upstream-commit: f5ef498289a2f2dd80724afbe5a53892690ced53
Component: engine
2016-08-15 19:27:50 -07:00
499e132407 check plugin manifest is correctly formatted before push
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: b47711ae92619f04e070b284f47e203c79640d9e
Component: engine
2016-08-15 17:51:30 -07:00
be73319004 When handling plugin exit, lookup plugins only during daemon shutdown.
The main intent of handling plugin exit is for graceful shutdown
of plugins during daemon shutdown. So avoid plugin lookup during
plugin exits caused by other reasons (eg. force remove)

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 57499fa62e697ea244455c5abda7ed8bc022f44c
Component: engine
2016-08-15 14:46:02 -07:00
cdfc3ebd94 Fix deadlock on plugin shutdown.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 4d009084de8cad94a180130eb57efa2a98df6d98
Component: engine
2016-08-11 19:36:32 -07:00
3c5296fd50 Debugging issue #25511
Volumes and other content created under a bind mount should be
recursively propagated using rshared, not shared. This could be
the reason for EBUSY during removal. Override options with rbind,
rshared and see if CI errors are fixed.

May fix #25511

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: e58028d078077dc566639ff52ece09ad6c481e44
Component: engine
2016-08-11 15:27:06 -07:00
cb1c855c27 Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
Upstream-commit: 64605d709f9bf5677d513d6ed78d63fffadc697d
Component: engine
2016-08-10 11:07:15 -07:00
1c502571ef add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0ead624473b6bddc232b46bc7c76ab4f9c743ff5
Component: engine
2016-08-10 08:36:09 +08:00
2921fa6d1b fix plugin restart on docker restart
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: ab12ed4a5642edb4d96b54b6152f12260093f3ea
Component: engine
2016-08-09 11:49:28 -07:00
fb8eea7ff0 Merge pull request #25096 from vieux/docker_plugin_remove_force
Add --force to docker plugin remove
Upstream-commit: 85428a1a53292684be55de9de3646e8c4745c72e
Component: engine
2016-08-05 14:45:05 +02:00
d5f439ee89 Add --force to docker plugin remove
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 0016b331dac94661678fd7676c7b6ccc9ec2d147
Component: engine
2016-08-04 15:55:45 -07:00
3ef890484a fix deadlock when more than 1 plugin is installed
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 42360d164b9f25fb4b150ef066fcf57fa39559a7
Component: engine
2016-08-03 16:22:12 -07:00
99b9e36eb0 Remove plugin root from filesystem.
`docker plugin remove` didnt actually remove plugin from disk. Fix that.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 5690730a7471726bbaf813e634a7117a562dfb8c
Component: engine
2016-08-01 10:46:50 -07:00
062b507351 Make daemon events listen for plugin lifecycle events.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 42abccb841b5bc0d420044e69165852b0054c38f
Component: engine
2016-07-26 10:51:47 -07:00
37c9afdc01 Check for plugin state before enable and disable.
This prevents unnecessary API call to containerd.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: b867f6c6e18f9d999ddec911a241941428777569
Component: engine
2016-07-25 19:24:28 -07:00
ed21a7262c Handle plugin shutdown when liveRestore is set.
When daemon has liveRestore set, daemon shutdown should not shutdown
plugins. Fixes #24759

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 4a44cf1d4c8e540b67aaa3834291a964c6ab7524
Component: engine
2016-07-22 15:26:43 -07:00
0228458e3c Add only legacy plugins to the legacy lookup map.
Legacy plugin model maintained a map of plugins. This is
not used by the new model. Using this map in the new model
causes incorrect lookup of plugins. This change uses adds
a plugin to the map only if its legacy.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 8fd779dc28a11d8727d76e9553379b0c854f7c4c
Component: engine
2016-07-18 15:43:44 -07:00
0633dc391e Remove use of exec-root in plugins due to socket pathname limits.
Unix sockets are limited to 108 bytes. As a result, we need to be
careful in not using exec-root as the parent directory for pluginID
(which is already 64 bytes), since it can result in socket path names
longer than 108 bytes. Use /tmp instead. Before this change, setting:
- dockerd --exec-root=/go/src/github.com/do passes
- dockerd --exec-root=/go/src/github.com/doc fails
After this change, there's no failure.

Also, write a volume plugins test to verify that the plugins socket
responds.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 21ecd5a93db34288c0c579d5738030716d7bef2d
Component: engine
2016-07-15 09:17:29 -07:00
1da671b499 Merge pull request #24229 from anusha-ragunathan/shutdown-plugins
Shutdown plugins during daemon shutdown.
Upstream-commit: b91e2dd9942f4c34b62de37c3862b9febd270b22
Component: engine
2016-07-11 22:14:50 -04:00
495149133d Shutdown plugins during daemon shutdown.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 863ab9ab134d0baef3c7e5d745eded891e87e734
Component: engine
2016-07-11 14:21:27 -07:00
c60ffac88e Merge pull request #24383 from anusha-ragunathan/not-plugin
Detect non-plugin content during install and error out.
Upstream-commit: 656c66dd50d5c5b1f4f40eb4f3134e84e5b80fbc
Component: engine
2016-07-07 11:18:27 +02:00
8d49a670d8 Detect non-plugin content during install and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: d32df6d934875052232bbbc49fa473bd283af6e4
Component: engine
2016-07-06 18:49:39 -07:00
9c0555f6e0 add a whitespace in plugin's logging
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 97c77b7e0dd2eef23beca1180be93733a3a95e82
Component: engine
2016-07-04 09:38:06 +08:00
e1b43ae16a add err handling, close fd
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 2281ce7e98ec983514450c33c0ef1d90262c3b4f
Component: engine
2016-06-27 23:51:54 +08:00
fed645b1f8 Merge pull request #23862 from LK4D4/fix_unused
all: fix usage of some variables
Upstream-commit: c9175a6deb70887afc757702a69bf750b9668fd4
Component: engine
2016-06-23 10:21:10 -07:00
9e92fb5474 all: fix usage of some variables
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 57e14714ee85e67f59d8c22aed23dc875cf2e58c
Component: engine
2016-06-22 10:40:32 -07:00
d62b2b14a2 Fix misspell typos
Signed-off-by: nick <nicholasrusso@icloud.com>
Upstream-commit: 7135afa79b4d99ba2a214fcc1c2decf95f850c2f
Component: engine
2016-06-19 09:53:31 -07:00
4552e85448 plugins: fix name handling for legacy plugins
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 8ba17b4823f9a1a40a405905613667d97bb24546
Component: engine
2016-06-17 12:02:05 -07:00
089ba4264f Update plugin command with defaulttag
This way, you don't have to specify the ":latest" tag for some command
and not for others

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: cb321e82db662f5190a6d83a90677a9dd9fdcd31
Component: engine
2016-06-17 10:18:18 -07:00
bc663a35ec plugins: remove automatic mounting of a state dir
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 15ff9de65801178a522c445ff9fb8964e21d12a0
Component: engine
2016-06-17 10:03:30 -07:00
f06eb442e7 Implement plugin restore after daemon restart
This ensures that:

- The in-memory plugin store is populated with all the plugins
- Plugins which were active before daemon restart are active after.
  This utilizes the liverestore feature when available, otherwise it
  manually starts the plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: dfd91873056c172ffc061d882da0cd18204b521a
Component: engine
2016-06-15 13:39:33 -04:00