Commit graph

611 commits

Author SHA1 Message Date
Madhu Venugopal
f77bdb6589 Merge pull request #594 from mrjana/model
Remove watch on all libnetwork objects
2015-10-06 14:46:48 -07:00
Jana Radhakrishnan
a22ce0938c Add bridge network integration tests
Add a few bridge network integration tests which
specifically deals with multiple bridge networks
and libnetwork restart and persistence

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:16:26 -07:00
Jana Radhakrishnan
a13f78369f IPAM watch removal and multistore support
Remove the need for watching for IPAM data
structures and add multi store support code and
data reorganization to simplify address space
management.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:16:06 -07:00
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
Jana Radhakrishnan
d74384b1d4 Add local store caching support
Add local scope store caching support as
well as do some refactoring to make it datastore
scope aware and manage scope specific config.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:15:31 -07:00
Madhu Venugopal
782d9a4618 ipam must honor preferedIP ahead of random allocation from subPool
Currently the default ipam implementation ignores the prefered ip if the
request is made on an existing sub-pool. The priority should be other
way around.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-05 00:40:17 -07:00
Madhu Venugopal
5f21cf3df1 Merge pull request #584 from sanimej/subnets
Support for multiple subnets in a overlay network
2015-10-04 21:09:07 -07:00
Madhu Venugopal
cc1e49cbbb Fixed a bug in AuxAddresses handling in libnetwork core
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-04 18:59:07 -07:00
Alessandro Boch
b061382c5e Default IPAM to handle local ds
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 22:47:46 -07:00
Alessandro Boch
67b1e3c5f2 Fix in bitseq.NewHandle()
- When creating the handle, write it to store if
  not present. Currently it is written to store
  only on first bit allocation.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 21:33:05 -07:00
Madhu Venugopal
b75601e84d Updating the network driver document with IPAM data
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-03 16:38:24 -07:00
Alessandro Boch
ddcfab5f81 libnetwork <-> ipam driver interaction
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-03 16:18:19 -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
Madhu Venugopal
1081687e38 Allowing local joins to happen even when serf is not initialized
With the new Discovery model, join can happen even before serf is
initliazed. It could also happen due to misconfiguration of
--cluster-advertise. The local endpoint join must succeed and later when
the serf initializes and joins the cluster, it will push the local db to
the cluster.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-02 12:20:29 -07:00
Madhu Venugopal
fac4e67c16 serfJoin doesnt happen if self notification comes later
With the recently introduced docker discovery, the self node discovery
notification can reach the overlay driver after the remote node
discovery notification.  In scenarios such as 2 node setup, it seems more
likely. In those scenarios, the serfJoin is not triggered and hence the
neighborship is not formed between the 2 nodes.

The fix is to retain the knowledge of the neighbor and reuse it
immediately after the serfInit is done. Since we do the serfJoin just
once, there is no harm in changing the neighIP to a new value even if it
is not used.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-01 21:50:54 -07:00
Madhu Venugopal
0066225da5 Integration with Docker Discovery
* integrated hostdiscovery package with the new Docker Discovery
* Integrated hostdiscovery package with libnetwork core
* removed libnetwork_discovery tag
* Introduced driver apis for discovery events
* moved overlay driver to make use of the discovery events
* Using Docker Discovery service.
* Changed integration-tests to make use of the new discovery

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-01 12:32:55 -07:00
Madhu Venugopal
1b393486b5 Godeps update
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-30 08:16:58 -07:00
Santhosh Manohar
6e327a5afb Support for multiple subnets in a overlay network
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-09-29 06:51:01 -07:00
Srini Brahmaroutu
e8593bdb65 Docker GCCGO CI is causing compilation errors as the varibale is declared and not used.
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-09-25 22:32:43 +00:00
Madhu Venugopal
a41025e9c0 Fixed a few more issues observed during docker integration
- DisableBridgeCreation is misleading. change it to DefaultBridge
- Dont fail the init if localstore cannot be initialized
- added a convenience function to get endpoint for a container

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-25 09:40:42 -07:00
Madhu Venugopal
7305922385 Moving overlay configure out of Init and into network create
Ideally, both overlay and libnetwork core must be changed to support
kv-store connection retry. But this is a stop-gap measure to unblock the
discovery related PRs.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-24 19:10:37 -07:00
Madhu Venugopal
e4e77353c9 Setting bridgename to be network-id[:12] if bridgename option is empty
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-24 19:10:28 -07:00
Jana Radhakrishnan
51699b91aa Merge pull request #560 from mavenugo/adb
Flip the default for the flag AllowNonDefaultBridge in bridge driver
2015-09-24 18:02:12 -07:00
Madhu Venugopal
a42e5f0663 Flip the default for the flag AllowNonDefaultBridge in bridge driver
Replaced it with DisableBridgeCreation and it can be used ONLY in
a special case for docker0 bridge from docker, instead of calling it
from all other case.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-24 02:18:35 -07:00
Jana Radhakrishnan
ce44f2478d Add overlay network integration test
This commit adds a basic overlay network
connectivity integration test. By doing this
it adds the basic functions to form a crude
container to run the networking tests. The container
uses a busybox rootfs with network namespace and
/etc/hosts and /etc/resolv.conf generated by
libnetwork.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-23 22:04:15 -07:00
Jana Radhakrishnan
50ec2d3a50 Add Sandbox ID to service ls output
Currently ther `service ls` output does not show the
sandbox ID. This adds that to the output so that it can
be used in dnet program.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-23 22:04:07 -07:00
Jana Radhakrishnan
24f1845a18 Do not overwrite the /etc/hosts file on Join
Currently on every endpoint Join the /etc/hosts
file is getting overwritten. This blows the already
existing service records. Modify the `updateHostsFile`
function to build the hosts file only on the first
endpoint join and for subsequent joins just update
the existing /etc/hosts file with the additional
network specific service records.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-23 22:04:03 -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
08d9578e48 Updating tests to use controller.Stop() to cleanup states
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-22 14:07:23 -07:00
Madhu Venugopal
0c089712ec Merge pull request #555 from chenchun/fix_doc
Fix outdated docs and comments
2015-09-22 13:46:27 -07:00
Madhu Venugopal
01a0be8e33 Merge pull request #550 from sanimej/ext_conn
Serialize the endpoint join/leave at the sandbox level
2015-09-22 13:39:35 -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
dd6b8cb408 Update libkv to support boltdb timeout
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-22 10:44:58 -07:00
Chun Chen
e82989f845 Fix outdated docs and comments
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-22 23:47:44 +08: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
56e3c1e9d5 Update godep to support boltdb backend
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-21 17:56:32 +08:00
Jana Radhakrishnan
a561351a12 Merge pull request #535 from sanimej/ext_conn
Support for default gateway for containers
2015-09-19 22:15:34 -07:00
Madhu Venugopal
dd9339c166 Merge pull request #548 from mrjana/integ
Introduce multi-node integration tests
2015-09-19 10:07:29 -07:00
Madhu Venugopal
ea8f974f15 Merge pull request #549 from WeiZhang555/doc
fix bad docs format
2015-09-19 08:51:24 -07:00
Madhu Venugopal
ba09d91d0e Merge pull request #547 from mrjana/config
Push driver config during `Init`
2015-09-19 08:50:02 -07:00
Jana Radhakrishnan
d565a4df48 Push driver config during Init
Currently the driver configuration is pushed through a separate
api. This makes driver configuration possible at any arbitrary
time. This unncessarily complicates the driver implementation.
More importantly the driver does not get access to it's
configuration before it can do the handshake with libnetwork.
This make the internal drivers a little bit different to
external plugins which can get their configuration before the handshake
with libnetwork.

This PR attempts to fix that mismatch between internal drivers and
external plugins.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-19 08:43:34 -07:00
Santhosh Manohar
1cd9c4dcaa Serialize the endpoint join/leave at the sandbox level
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-09-19 07:31:51 -07:00
Zhang Wei
6b1fcf3e6a fix bad docs format
Fix some bad docs format

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-09-19 18:09:13 +08:00
Jana Radhakrishnan
f33a362b48 Introduce multi-node integration tests
- Create a wrapper script to run intergation tests
      so that setups and teardowns happen in more
      optimal manner
    - Add traps to cleanup containers on failure or
      user interrupt
    - Introduce basic multi-node integration tests
    - Removed default network, default driver tests
      as they may not be useful in the near future

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-18 22:49:28 -07:00
Jana Radhakrishnan
d7092a63f9 Merge pull request #542 from aboch/bs
Allow to set bits in a range in bitseq
2015-09-18 16:58:29 -07:00
Alessandro Boch
09fec4e411 Allow to set bits in a range in bitseq
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-09-18 14:42:36 -07:00
Santhosh Manohar
eb54ed5d42 Support for default gateway for containers
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-09-18 05:02:03 -07:00
Jana Radhakrishnan
ef732a9dce Merge pull request #546 from tomdee/endpoint_locking
Remove unwanted lock
2015-09-17 18:14:33 -07:00