Commit Graph

413 Commits

Author SHA1 Message Date
Madhu Venugopal
2e40befd82 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
9c3695fae8 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
2f07bc64a0 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
c653f03fe8 GetObject support
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:56 -07:00
Madhu Venugopal
09383f5077 datastore support for Endpoint
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Madhu Venugopal
b987d2627b Updating to new Swarm discovery and store APIs
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Madhu Venugopal
d7c4c8f558 Updating to latest Swarm dependancies
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Jana Radhakrishnan
40bdee8540 Merge pull request #273 from mavenugo/delete_restore
handling error condition for network and endpoint deletes
2015-06-10 19:54:44 -07:00
Madhu Venugopal
eb1feb7dac handling error condition for network and endpoint deletes
Unless it is a forbidden error, libnetwork should not fail a forced
delete of a network and endpoint if the driver throws an error.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 16:21:46 -07:00
Madhu Venugopal
350db6a108 Merge pull request #272 from estesp/gc-startup-fix
Check GC loop is active/necessary before triggering GC
2015-06-10 14:08:37 -07:00
Phil Estes
4e0ffd72f8 Check GC loop is active/necessary before triggering GC
Calling GC() without ever creating a network namespace (sandbox on
Linux) will hang as the GC loop is not running (and therefore the
channel is not being listened to).

Tested via Docker that this corrects a daemon shutdown error if the
daemon is started and stopped without any containers or networks being
created while the daemon is up.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2015-06-10 16:43:31 -04:00
Madhu Venugopal
40f7ffc94f Merge pull request #267 from aboch/cp
Minor changes in bridge.go
2015-06-09 17:30:42 -07:00
Alessandro Boch
7473e35f27 Minor changes in bridge.go
- lock network struct before accessing config in NetworkCreate
- reorganize locks so that we lock only what needed and when needed
- conflict method really belongs to networkConfig not bridgeNetwork

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-09 16:44:43 -07:00
aboch
7b481d2ec9 Merge pull request #266 from mavenugo/master
Moved services to dnet top-level and removed experimental
2015-06-08 19:14:29 -07:00
Madhu Venugopal
22832b6fb8 Merge pull request #250 from aboch/ni
Provide isolation b/w bridge networks
2015-06-08 18:58:15 -07:00
Alessandro Boch
c469e569d2 Provide isolation b/w bridge networks
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-08 17:15:57 -07:00
Madhu Venugopal
5da83aac26 Moved services to dnet top-level and removed experimental
In prep for the UI/API updates on Docker to integrate the network and
endpoints, this PR removes the experimental tag from dnet and moving it
to docker UI and API and wrap the top-level "network" and "service"
under experimental.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-08 14:23:41 -07:00
aboch
4f33e41257 Merge pull request #257 from mrjana/overlay
Refactor sandbox code to use interfaces and add bridge support to sandbox
2015-06-08 14:05:59 -07:00
Madhu Venugopal
0b134e19cb Merge pull request #265 from Microsoft/10662-compileagain
Windows: Allow compilation (again)
2015-06-08 11:27:44 -07:00
John Howard
7b876a9a72 Windows: Allow compilation (again)
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-08 11:12:56 -07:00
Jana Radhakrishnan
4aa51271fe Add support to add bridge to the sandbox.
Added support to add a bridge the same way as any other
interface into the namespace. The only difference is linux
does not support creating the bridge in one namespace and
moving it into another namespace. So for a bridge the sandbox
code also does the creation of the bridge inside the sandbox.
Also added an optional argument to interface which can now
select one of the already existing interfaces as it's master.
For this option to succeed the master interface should be of type
bridge.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-08 10:21:00 -07:00
Jana Radhakrishnan
df6ed350ae Refactor sandbox code to use interfaces
Currently sandbox code exposes bare structs
externally to the package. It is untenable
to continue this way and it becomes too
inflexible to use it to store internal state.
Changed all of them to use interfaces.
Also cleaned up a lot of boiler plate code
which needs to set into namespace.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-08 10:17:56 -07:00
Jana Radhakrishnan
0197028220 Make GenerateIfaceName generic
Currently GenerateIfaceName is defined in bridge.go
and it specifically tries to only generate an interface
name only with `veth` prefix. Make it generic so that it
can accept a prefix and length of random bytes. Also
move it to netutils since it is useful to generate various
kinds of interface names using it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-08 09:49:17 -07:00
Jana Radhakrishnan
162925415c Merge pull request #252 from aboch/rm
Add restrictions for default drivers/bridge name
2015-06-08 08:38:06 -07:00
Alessandro Boch
d8f6a585ac Add restrictions for default drivers/bridge name
- modified tests accordingly
- added extra tests for creating a couple of bridge nw and query them

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-08 08:32:08 -07:00
Madhu Venugopal
7de305a2a4 Merge pull request #262 from mrjana/cnm_integ
Add support to trigger immediate garbage collection
2015-06-05 14:21:35 -07:00
Jana Radhakrishnan
d4a5676607 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
Madhu Venugopal
147d3e5773 Merge pull request #258 from bpradipt/ppc64le-netns-fix
Update netns to include support for PowerPC LE (ppc64le) architecture
2015-06-05 11:34:51 -07:00
Jana Radhakrishnan
a87e5a0251 Merge pull request #192 from squaremo/remote_driver_docs
Document the remote driver protocol
2015-06-05 08:54:31 -07:00
Jana Radhakrishnan
70596823d2 Merge pull request #259 from kvasdopil/freebsd-compile-new
make libnetwork compile on freebsd
2015-06-05 08:47:40 -07:00
Alexey Guskov
a2b47f6cd9 make libnetwork compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-06-05 14:27:23 +03:00
Michael Bridgen
3c8e06bc05 Document the remote driver protocol
And some minor updates to the preceding text.

Signed-off-by: Michael Bridgen <mikeb@squaremobius.net>
2015-06-05 12:18:50 +01:00
Pradipta Kr. Banerjee
7155360462 Update netns to include support for PowerPC LE (ppc64le) architecture
Current version of netns used in libnetwork do not have requisite syscall
entry for PowerPC (ppc64le) arch. Consequently docker which uses libnetwork fails
to create any network enabled containers on Power systems.

This patch updates netns to latest commit 5478c060110032f972e86a1f844fdb9a2f008f2c
to add ppc64le syscall entry.

Signed-off-by: Pradipta Kr. Banerjee <bpradip@in.ibm.com>
2015-06-05 14:40:44 +05:30
aboch
0d3a8c16fc Merge pull request #256 from mavenugo/dup_endpoint
duplicate endpoint error handling
2015-06-04 16:35:52 -07:00
Madhu Venugopal
014df6077b duplicate endpoint error handling
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 14:23:42 -07:00
Jana Radhakrishnan
9da326c854 Merge pull request #211 from mavenugo/bn
WIP : default configs for new network in bridge driver
2015-06-04 11:58:14 -07:00
Madhu Venugopal
64a0d66696 Copy default configs from default Bridge to new bridge if not user configured
Also fixed a minor bug in client to choose bridge as the default driver.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 11:48:31 -07:00
Jana Radhakrishnan
d982a2dfeb Merge pull request #255 from mavenugo/dhd
Moving hostdiscovery under build tag
2015-06-04 11:33:43 -07:00
Madhu Venugopal
4e68dfb97a Merge pull request #239 from aboch/pmc
One port mapper per bridge network
2015-06-04 05:24:00 -07:00
Madhu Venugopal
29350c906c Including hostdiscovery conditionaly under a build tag
In order to vendor-in libnetwork to docker, we need to remove the swarm
dependency even though it is used as library. using this PR, a new build
flag libnetwork_discovery is introduced in order to avoid pulling in the
unused hostdiscovery functionality into docker.
We are working with the Swarm project to see if we can modularize the
discovery package to become independent so that we can include them as a
vendor-in package in docker.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 05:00:09 -07:00
Madhu Venugopal
4d06bbd2e6 Fixing a few go-vet issues
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 04:32:10 -07:00
Jana Radhakrishnan
4abd4bc1de Merge pull request #253 from aboch/ex
Change in bridge EndpointOperInfo()
2015-06-03 20:59:04 -07:00
Alessandro Boch
349def334c Change in bridge EndpointOperInfo()
- To also return the configured exposed ports, besides the
  port bindings; as now libnetwork/endpoint.go endpoint setters
  separate the exposed ports and port binding configs.
  Docker daemon will take care of aggregating the two sources
  for presentation.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-03 20:28:15 -07:00
Madhu Venugopal
0166bc708d Merge pull request #212 from mrjana/cnm_integ
Add endpoint priority during join and cleanup libnetwork test code
2015-06-03 17:59:10 -07:00
Jana Radhakrishnan
d750d298d1 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
842dbed31a Introduce UnsetGateway(IPv6) methods
Sandbox needs unset gateway methods to cleanup
gateway settings to enable smooth transition
of the sandbox between endpoints.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:48:53 -07:00
Jana Radhakrishnan
4450ba744c Cleanup libnetwork test code
- The libnetwork test code had some issues in not properly
  passing the network options. Fixed it.
- Made controller a global value so that every test uses the
  same controller instance.
- Cleaned up endpoint and network objects after every test.
- Extended the endpoint join test case to test the same container
  join two different networks using two different endpoints.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:48:38 -07:00
Jana Radhakrishnan
8af6c3b5d3 Remove only the endpoint owned interfaces
Only remove the interfaces owned by the endpoint from
the sandbox when the container leaves the endpoint.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:14:44 -07:00
aboch
5455132c59 Merge pull request #240 from Metaswitch/remote-driver-static-routes
Add static routes to the remote driver.
2015-06-03 16:51:56 -07:00
Tom Denham
54fe285107 Add static routes to the remote driver.
Signed-off-by: Tom Denham <tom.denham@metaswitch.com>
2015-06-03 16:31:21 -07:00