Commit Graph

20 Commits

Author SHA1 Message Date
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
Tom Denham 65acaaf0b5 Allow drivers to supply static routes for interfaces
Signed-off-by: Tom Denham <tom.denham@metaswitch.com>
2015-05-25 19:25:30 -07:00
Jana Radhakrishnan 89045ca381 Modify driver Join api to only allow dst prefix
Currently the driver api allows the driver to specify the
full interface name for the interface inside the container.
This is not appropriate since the driver does not have the full
view of the sandbox to correcly allocate an unambiguous interface
name. Instead with this PR the driver will be allowed to specify
a prefix for the name and libnetwork and sandbox layers will
disambiguate it with an appropriate suffix.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-21 20:17:44 +00: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 b323d571b5 Driver api refactor
Refactored the driver api so that is aligns well with the design
of endpoint lifecycle becoming decoupled from the container lifecycle.
Introduced go interfaces to obtain address information during CreateEndpoint.
Go interfaces are also used to get data from driver during join.
This sort of deisgn hides the libnetwork specific type details from drivers.

Another adjustment is to provide a list of interfaces during CreateEndpoint. The
goal of this is many-fold:
     * To indicate to the driver that IP address has been assigned by some other
       entity (like a user wanting to use their own static IP for an endpoint/container)
       and asking the driver to honor this. Driver may reject this configuration
       and return an error but it may not try to allocate an IP address and override
       the passed one.
     * To indicate to the driver that IP address has already been allocated once
       for this endpoint by an instance of the same driver in some docker host
       in the cluster and this is merely a notification about that endpoint and the
       allocated resources.
     * In case the list of interfaces is empty the driver is required to allocate and
       assign IP addresses for this endpoint.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-18 22:36: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
Madhu Venugopal 27d34d67ab Fixed some convoluted texts in remote.md and fixed a remote driver bug
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-07 11:55:46 -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 55099e9656 - Removed sandbox override option from the driver.
- Reworked the host network mode support by introducing
  a new JoinOption.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-05 04:26:23 +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
Alessandro Boch 56741e7d60 Provide API to retrieve Endpoint operational data
- from the driver

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-04 14:54:48 -07:00
Madhu Venugopal 9db6a1b8e4 Join / Leave Driver API
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-01 13:38:26 -07: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 e2d8531a40 - Added support for Join/Leave methods to Endpoint.
- Removed sandbox key argument for CreateEndpoint.
- Refactored bridge driver code to remove sandbox key.
- Fixed bridge driver code for gaps in ipv6 behavior
  observed during docker integration.
- Updated test code, readme code, README.md according
  api change.
- Fixed some sandbox issues while testing docker ipv6
  integration.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-29 14:49:32 +00:00
Alessandro Boch 1fae5573d2 Refactor NetworkController interface
- To reflect work flow. NewDriver() => ConfigureDriver()
  and no NetworkDriver returned.
  libnetwork clients would refer to a driver/network type, then
  internally controller will retrieve the correspondent driver
  instance, but this is not a concern of the clients.
- Remove NetworkDriver interface
- Removed stale blank dependency on bridge in libnetwork_test.go

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-23 18:46:01 -07:00
Alessandro Boch 7d24e974cf Refactor driverapi, sandbox pkgs
- Move SanboxInfo and Interface structures in sandbox package
  (changed it to Info as per golint)
- Move UUID to new internal pkg types
- Updated .gitignore to ignore IDE project files

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-21 09:44:39 -07:00
Alessandro Boch 95958d7610 Enhance Endpoint interface
- Added new getter methods
- Modified signature of Network.CreateEndpoint()

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-04-20 03:21:01 -07:00
Jana Radhakrishnan e797f80ad4 Added driver specific config support
- Added api enhancement to pass driver specific config
  - Refactored simple bridge driver code for driver specific config
  - Added an undocumented option to add non-default bridges without
    manual pre-provisioning to help libnetwork testing
  - Reenabled libnetwork test to do api testing
  - Updated README.md

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-15 18:32:07 +00:00
Jana Radhakrishnan 0a25032277 Converted IP address and gateway values to be proper types
rather than strings in the sandbox and driverapi protocol

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-14 01:36:58 +00:00
Jana Radhakrishnan 68ae284db5 Libnetwork refactor for container network model
- Added controller, network, endpoint and sandbox interfaces
    - Created netutils package for miscallaneous network utilities
    - Created driverapi package to break cyclic dependency b/w driver and libnetwork
    - Made libnetwork multithread safe
    - Made bridge driver multithread safe
    - Fixed README.md

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-04-13 21:40:50 +00:00