1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

29 commits

Author SHA1 Message Date
Madhu Venugopal
2677a461de Distributed delete processing
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-17 17:11:20 -07:00
Madhu Venugopal
03504cab65 Few changes to the UI and API implementation
1. replaced --net option for service UI with SERVICE.[NETWORK] format
2. Making using of the default network/driver backend support
3. NetworkName and NetworkType from the UI/API can be empty string
   and it will be replaced with DefaultNetwork and DefaultDriver

As per the design goals, we wanted to keep libnetwork core free of
handling defaults. Rather, the clients (docker & dnet) must handle the
defaultness of these entities.
Also, since there is no API to get these Default values from the
backend, UI will not handle the default values either. Hence, this falls
under the responsibility of the API layer to handle this specific case.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-14 21:57:18 -07:00
Madhu Venugopal
c85a58b6df Return an empty config if nil
Since the Config is a read-only entity, Confg() method returned a value
instead of the pointer. In cases the config is nil, we should return an
empty config.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-13 14:28:56 -07:00
Madhu Venugopal
9f3d1ce3ff Moved the TOML based Configuration to dnet
The configuration format for docker runtime is based on daemon flags and
hence adjusting the libnetwork configuration to accomodate it by moving
the TOML based configuration to the dnet tool.

Also changed the controller configuration via options

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-12 12:46:12 -07:00
Madhu Venugopal
9e8974cc64 Replacing isReservedNetwork with Driver capability
Currently store makes use of a static isReservedNetwork check to decide
if a network needs to be stored in the distributed store or not. But it
is better if the check is not static, but be determined based on the
capability of the driver that backs the network.

Hence introducing a new capability mechanism to the driver which it can
express its capability during registration. Making use of first such
capability : Scope. This can be expanded in the future for more such cases.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 23:59:38 -07:00
Madhu Venugopal
f88824fb8a Reworked endpoint store operation to address a few cases
* Removed network from being marshalled (it is part of the key anyways)
* Reworked the watch function to handle container-id on endpoints
* Included ContainerInfo to be marshalled which needs to be synchronized
* Resolved multiple race issues by introducing data locks

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 23:59:29 -07:00
Madhu Venugopal
dca35085f5 datastore support for Endpoint
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Madhu Venugopal
0fda541b37 Updating to new Swarm discovery and store APIs
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Jana Radhakrishnan
15ddc3717a Add support to trigger immediate garbage collection
Right now the namespace paths are cleaned up every
garbage collection period. But if the daemon is restarted
before all the namespace paths of removed containers are
garbage collected they will remain there forever. The fix
is to provide a GC() api so that garbage collection can be
triggered immediately.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-05 14:15:29 -07:00
Jana Radhakrishnan
a93d08aef5 Add container join priority option to endpoint
When an endpoint is joined by a container it may
optionally pass a priority to resolve resource
conflicts inside the sandbox when more than one
endpoint provides the same kind of resource. If the
the priority is the same for two endpoints with
conflicting resources then the endpoint network names
are used to resolve the conflict.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:48:58 -07:00
Jana Radhakrishnan
800029abb6 Remove container data return value from Join
Now that Endpoint interface has the Info method there is no
need to return container data as a return value in the Join
method. Removed the return value and fixed all the callers.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-29 20:11:02 +00:00
Madhu Venugopal
ae8643748d Libnetwork Host Discovery using Swarm Discovery pkg
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:40 -07:00
Madhu Venugopal
481568035f TOML based Configuration support for libnetwork
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:40 -07:00
Madhu Venugopal
594361552e Avoid adding local reserved networks (bridge, none, host) to the datastore
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:39 -07:00
Madhu Venugopal
87161e8935 Added Network Watch support
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:39 -07:00
Madhu Venugopal
9b952fc982 Initial kv store integration and datastore implementation
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:34 -07:00
Alessandro Boch
c70cfcb150 Provide interface to categorize errors
- Package types to define the interfaces libnetwork errors
  may implement, so that caller can categorize them.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-20 22:29:29 -07:00
Jana Radhakrishnan
9d4b69df73 Fix panic on leave of host driver endpont leave
There is a panic when two containers joining a host
network leave one after another. The problem was that
in controller.go the sandboxData was not stored as a
pointer reference. So when we got the data from the map
it was the copy of the data and refcnt increment was done
on that. Changed it to hold a reference.  Also added a test
case to test it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 17:14:00 +00:00
Madhu Venugopal
80ca3c2330 Remote Driver integration with Plugin Framework
This commit brings in Remote driver integrated with the newly introduced
Plugin framework as a Docker Package.

The Plugin framework is designed as a Package and has no runtime
dependancy on Docker platform. It stands on its own and is a good
candidate for getting the remote drivers hooked to libnetwork

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-18 13:42:19 -07:00
Alessandro Boch
1e91009978 Network and Endpoint query methods to return error on not found
- As requested by Docker committers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-15 16:18:04 -07:00
Jana Radhakrishnan
d1ce8f01a4 Merge pull request #143 from squaremo/driver_init_not_new
Make driver packages register themselves via DriverCallback
2015-05-11 22:14:51 -07:00
Alessandro Boch
d69e66c894 By ID and By Name query methods to return error
(Requested by docker reviewer on libnetwork integration PR)

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-11 16:25:36 -07:00
Michael Bridgen
614d82390c Make driver packages register themselves via DriverCallback
In the present code, each driver package provides a `New()` method
which constructs a driver of its type, which is then registered with
the controller.

However, this is not suitable for the `drivers/remote` package, since
it does not provide a (singleton) driver, but a mechanism for drivers
to be added dynamically. As a result, the implementation is oddly
dual-purpose, and a spurious `"remote"` driver is added to the
controller's list of available drivers.

Instead, it is better to provide the registration callback to each
package and let it register its own driver or drivers. That way, the
singleton driver packages can construct one and register it, and the
remote package can hook the callback up with whatever the dynamic
driver mechanism turns out to be.

NB there are some method signature changes; in particular to
controller.New, which can return an error if the built-in driver
packages fail to initialise.

Signed-off-by: Michael Bridgen <mikeb@squaremobius.net>
2015-05-11 19:00:06 +01:00
Alessandro Boch
1739626f4d NewNetwork and CreateEndpoint to validate resource name
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-10 10:59:58 -07:00
Madhu Venugopal
904a313396 Remote Driver Registration
This commits brings in a functionality for remote drivers to register
with LibNetwork. The Built-In remote driver is responsible for the
actual "remote" plugin to be made available.

Having such a mechanism makes libnetwork core not dependent on any
external plugin mechanism and also the Libnetwork NB apis are free of
Driver interface.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-06 21:45:30 -07:00
Jana Radhakrishnan
c9b54861e7 - Moved label definitions to a new package
- Added a network scope well-defined label
  to enable ipv6

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-06 17:21:19 +00:00
Jana Radhakrishnan
66eb3e1cd4 - Added support for JoinInfo so that driver can override certain
container config.
- Added JoinOption processing for extra /etc/hosts record.
- Added support for updating /etc/hosts entries of other containers.
- Added sandbox support for adding a sandbox without the OS level create.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 00:09:11 +00:00
Madhu Venugopal
cc4f27f6af Minor API modifications
* Modified NB API with self referential var-aarg for future proofing the APIs
* Modified Driver API's option parameter to be a Map of interface{}

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-01 10:49:25 -07:00
Jana Radhakrishnan
713ff79ed5 Reorganized the libnetwork code to seperate Controller, Network and Endpoint
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-30 01:25:01 +00:00