Commit Graph

21 Commits

Author SHA1 Message Date
Jana Radhakrishnan 71e14dd52a Remove always-on watch for networks and endpoints
Always on watching of networks and endpoints can
affect scalability of the cluster beyond a few nodes.
Remove pro active watching and watch only the objects
you are interested in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:15:49 -07:00
Alessandro Boch 2aaef377f3 IPAM driver
- Add IPAM cotract and remote IPAM hooks
 - Add ipam registration in controller
 - Have default IPAM follow ipamapi contract

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -07:00
Jana Radhakrishnan 3023538a56 Merge pull request #556 from mavenugo/bdb-to
libnetwork to make use of boltdb ConnectionTimeout to avoid deadlock
2015-09-22 19:20:04 -07:00
Madhu Venugopal 27397dcbdf libnetwork to make use of boltdb ConnectionTimeout to avoid deadlock
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-22 13:23:23 -07:00
Madhu Venugopal 725280d03f Providing KVObject option to skip persisting object in kvstore
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-22 08:35:38 -07:00
Chun Chen 72567c355b Various refactor and fixes for the previous two commits including:
1. Don't save localscope endpoints to localstore for now.
2. Add common function updateToStore/deleteFromStore to store KVObjects.
3. Merge `getNetworksFromGlobalStore` and `getNetworksFromLocalStore`
4. Add `n.isGlobalScoped` before `n.watchEndpoints` in `addNetwork`
5. Fix integration-tests
6. Fix test failure in drivers/remote/driver_test.go
7. Restore network to store if deleteNework failed
2015-09-22 01:29:51 +08:00
Chun Chen 8babc3d4d3 Add local datastore to persist states of LocalScope network
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-21 17:58:51 +08:00
Chun Chen d04c177a10 Fix for zookeeper backend
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-17 10:16:34 +08:00
Alessandro Boch fd43ee1323 Introduce Sandbox entity
- Maps 1 to 1 with container's networking stack
- It holds container's specific nw options which
  before were incorrectly owned by Endpoint.
- Sandbox creation no longer coupled with Endpoint Join,
  sandbox and endpoint have now separate lifecycle.
- LeaveAll naturally replaced by Sandbox.Delete
- some pkg and file renaming in order to have clear
  mapping between structure name and entity ("sandbox")
- Revisited hosts and resolv.conf handling
- Removed from JoinInfo interface capability of setting hosts and resolv.conf paths
- Changed etchosts.Build() to first write the search domains and then the nameservers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 11:19:02 -07:00
aboch f6ee03ae88 Merge pull request #333 from calavera/extra_conditional
Remove extra conditional.
2015-06-25 14:59:19 -07:00
Spike Curtis 04bd8f67ad Datastore handles creating objects atomically.
In that commit, AtomicPutCreate takes previous = nil to Atomically create keys
that don't exist.  We need a create operation that is atomic to prevent races
between multiple libnetworks creating the same object.

Previously, we just created new KVs with an index of 0 and wrote them to the
datastore.  Consul accepts this behaviour and interprets index of 0 as
non-existing, but other data backends do no.

 - Add Exists() to the KV interface.  SetIndex() should also modify a KV so
   that it exists.
 - Call SetIndex() from within the GetObject() method on DataStore interface.
   - This ensures objects have the updated values for exists and index.
 - Add SetValue() to the KV interface.  This allows implementers to define
   their own method to marshall and unmarshall (as bitseq and allocator have).
 - Update existing users of the DataStore (endpoint, network, bitseq,
   allocator, ov_network) to new interfaces.
 - Fix UTs.
2015-06-25 10:53:48 -07:00
David Calavera 1d5698936a Remove extra conditional.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-25 09:58:16 -07:00
Madhu Venugopal 49d9787749 Ignoring locally scoped endpoints/networks from distributed delete
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-19 13:34:16 -07:00
Madhu Venugopal 8b59f48537 Reading the top level element (network) from datastore on init
Currently we rely on watch to catchup after the init. But there could be
a small time window on which, we might end up in a race condition on
network creates. By reading and populating networks during init, we
avoid any such conditions, especially for default network handling.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-18 08:35:46 -07:00
Madhu Venugopal 2677a461de Distributed delete processing
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-17 17:11:20 -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 47a3f3690d datastore delete support for network and endpoints
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:19:31 -07:00
Madhu Venugopal 8dcdbbabd0 GetObject support
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:56 -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