Commit Graph

506 Commits

Author SHA1 Message Date
Brent Salisbury 1dbc1bc4fe multi-host overlay driver quick start doc 2015-06-25 21:47:41 -07:00
aboch ece45cbf53 Merge pull request #333 from calavera/extra_conditional
Remove extra conditional.
2015-06-25 14:59:19 -07:00
Jana Radhakrishnan b3ea0cc828 Merge pull request #314 from spikecurtis/store-create-v2
Datastore handles creating objects atomically.
2015-06-25 14:43:16 -07:00
Spike Curtis e2a63dff5a 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 6885ea8036 Remove extra conditional.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-25 09:58:16 -07:00
Jana Radhakrishnan cc86aee642 Merge pull request #328 from wulonghui/wulonghui-patch-3
Update error return in bridge driver's getNetwork
2015-06-24 23:59:54 -07:00
wulonghui 7df8d3eb4c Update error return in bridge driver's getNetwork 2015-06-25 19:33:46 +08:00
Madhu Venugopal 82a1f56349 Merge pull request #330 from mrjana/sd
Do not update /etc/hosts for empty endpoints
2015-06-24 12:30:26 -07:00
Jana Radhakrishnan 6f65b9b17d Do not update /etc/hosts for empty endpoints
There is no need to update the /etc/hosts files
of containers for endpoints which are created/deleted
in a network whose interface list is empty

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-24 12:09:44 -07:00
Madhu Venugopal 1aaf1047fd Merge pull request #326 from mavenugo/wneigh
Fixing a windows compile error in docker during vendor-in
2015-06-21 03:30:56 -07:00
Madhu Venugopal 7086aa85b1 Fixing a windows compile error in docker during vendor-in
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-21 02:32:07 -07:00
Jana Radhakrishnan 83743db8ce Merge pull request #325 from mavenugo/master
removed a duplicate and incorrect unlock
2015-06-20 08:44:19 -07:00
Madhu Venugopal 2ef8276789 removed a duplicate and incorrect unlock
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-20 08:22:44 -07:00
Madhu Venugopal 852a9c48c1 Merge pull request #324 from mrjana/cnm
Add LeaveAll support
2015-06-19 20:19:35 -07:00
Jana Radhakrishnan df92dd2b9a Add LeaveAll support
Currently container can join one endpoint when it is started.
More endpoints can be attached at a later point in time. But
when that happens this attachment should only have meaning
only as long as the container is alive. The attachment should
lose it's meaning when the container goes away. Cuurently there
is no way for the container management code to tell libnetwork
to detach the container from all attached endpoints. This PR
provides an additional API `LeaveAll` which adds this
functionality,

To facilitate this and make the sanbox lifecycle consistent
some slight changes have been made to the behavior of sandbox
management code. The sandbox is no longer destroyed when the
last endpoint is detached from the container. Instead the sandbox
ie kept alive and can only be destroyed with a `LeaveAll` call.
This gives better control of sandbox lifecycle by the container
management code and the sandbox doesn't get destroyed from under
the carpet while the container is still using it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-19 18:55:26 -07:00
Jana Radhakrishnan 8f5549c695 Merge pull request #323 from mavenugo/master
leave must not use join options in the defer during failures
2015-06-19 15:06:13 -07:00
Madhu Venugopal b561d4c8c6 leave must not use join options in the defer during failures
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-19 14:48:07 -07:00
Jana Radhakrishnan 8feadc2dd9 Merge pull request #322 from mavenugo/master
Ignoring locally scoped endpoints/networks from distributed delete
2015-06-19 13:48:30 -07:00
Madhu Venugopal fe42c32355 Ignoring locally scoped endpoints/networks from distributed delete
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-19 13:34:16 -07:00
Jana Radhakrishnan 20c6d6904c Merge pull request #320 from mavenugo/master
set the kv-provider driver labels only if it is a valid config
2015-06-19 06:51:33 -07:00
Madhu Venugopal 3b9d45d214 set the kv-provider driver labels only if it is a valid config
without this fix, overlay driver returns an error and that causes the
daemon to quit.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-19 06:30:37 -07:00
Madhu Venugopal ceb30a05b9 Merge pull request #318 from mrjana/sd
Service discovery lite
2015-06-19 06:18:10 -07:00
Jana Radhakrishnan 0741d68fd7 Service discovery
Add a minimal service discover support using service names or
service names qualified with network name. This is achieved
by populating the container's /etc/hosts file record with the
appropriate entries

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-19 00:40:37 -07:00
Jana Radhakrishnan d59cc6962e Add/Delete etc hosts record support
Currently the etchosts package only provides helpers
to completely build an /etc/hosts file from scratch
or update a single hostname's IP address to a different
one. This commit adds the ability to add/delete an arbitrary
number of host record entries to/from the etc hosts file

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-19 00:40:27 -07:00
Jana Radhakrishnan afe092d5f3 Merge pull request #316 from mavenugo/epip
Fix endpoint ip data-store sync issue
2015-06-18 19:14:17 -07:00
Madhu Venugopal fb272a1f36 Fix endpoint ip data-store sync issue
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-18 19:07:00 -07:00
Madhu Venugopal 0e7322b485 Merge pull request #308 from mrjana/overlay
Overlay Driver
2015-06-18 16:08:26 -07:00
Jana Radhakrishnan a63a3e5463 Updated Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-18 15:07:22 -07:00
Jana Radhakrishnan 941bb031f4 Support driver labels
Add support for in-tree driver configuration labels
by pushing the labels which has the appropriate
prefix to the corresponding driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-18 15:07:20 -07:00
Jana Radhakrishnan d10fc56a3d Add ovrouter binary
Add support for ovrouter biinary which can
act as both an independent integration test
tool to test overlay driver without libnetwork
as well as convert overlay driver into a plugin
in the future.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-18 15:07:18 -07:00
Jana Radhakrishnan 11a79adfb6 Add neighbor support to sandbox
Add support to add/delete neighbor entries to
the sandbox. Both L3 and L2(fdb) neighbor table additions
are supported.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-18 15:07:17 -07:00
Jana Radhakrishnan d0c499082e Overlay driver
This commit brings in the first implementation of
overlay driver which makes use of vxlan tunneling
protocol to create logical networks across multiple
hosts.

This is very much alpha code and should be used for
demo and testing purposes only.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-18 15:06:24 -07:00
Jana Radhakrishnan 1c279368bd Merge pull request #310 from mavenugo/bootup
Reading the top level element (network) from datastore on init
2015-06-18 12:33:17 -07:00
Jana Radhakrishnan e88263dbf2 Merge pull request #309 from aboch/bis
Fix datastore value handling in bitseq
2015-06-18 12:17:01 -07:00
Alessandro Boch 0fd6fe8d28 Fix datastore value handling in bitseq
- and do not discard errors

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-18 12:07:04 -07:00
Madhu Venugopal aeae6b501d 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
aboch 51baf26458 Merge pull request #307 from mavenugo/delp
Distributed delete processing
2015-06-17 17:42:16 -07:00
Jana Radhakrishnan ce01ecbef9 Merge pull request #290 from aboch/ia
ipam and idm for multi host
2015-06-17 17:27:12 -07:00
Alessandro Boch 9e9c43e948 Add datastore to IPAM for configuration
- IPAM to use datastore for the subnets configurations

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 17:17:19 -07:00
Madhu Venugopal 288e689b51 Distributed delete processing
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-17 17:11:20 -07:00
Alessandro Boch bca6ec2e64 Rework push reservation w/ datastore
- At Handle creation, first check if an instance of the
  the respective object is already present in the datastore.
- Handle sequence must be saved only if commit
  to datastore is succesfull
- Caller (ipam) needs to manage the retry

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:49:21 -07:00
Alessandro Boch 0020b76d39 Change subnet key schema in ipam
- to addrSpace/subnet/childSubnet

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:49:21 -07:00
Madhu Venugopal c87a2f4567 Datastore additions to bitmask management
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-17 16:49:19 -07:00
Madhu Venugopal 9f69b0aa0d Added a new RetryError to indicate the caller to possibly retry
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-17 16:46:08 -07:00
Alessandro Boch 62b7668b58 Make bitseq.Handle thread-safe
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:46:08 -07:00
Alessandro Boch b512536cb3 Add numerical ids manager
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:46:05 -07:00
Alessandro Boch eb66d4456e bitseq to provide handle
- Handle contains sequence and identifier.
  This way datastore integration can be done
  at bitseq level.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:37:59 -07:00
Alessandro Boch f01ec8c471 Reorganize libnetwork ipam datastructures
- In order to facilitate usage of datastore
- This makes it slower. Efficiency will be
  revisited later after datastore integration
  is done.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:37:59 -07:00
Alessandro Boch 0a4887a1ba Add locking to libnetwork ipam
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:37:59 -07:00
Alessandro Boch 2c26fdf8df Add serialize/deserialize for sequence list
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 16:37:59 -07:00