Compare commits

...
35 Commits
Author SHA1 Message Date
Bryan Boreham be3f88656b Add release v1.4.5 2016-02-29 22:28:58 +00:00
David Wragg 27367ab292 Process DiscardingFlowOp correctly in FastDatapath send()
The nil FlowOp check in collectFlowOps was not addressed with the
introduction of DiscardingFlowOp.  This meant that DiscardingFlowOps
produced in the router core would get handled by fastdp as if they were
foreign FlowOps, preventing flow creation and so leading to unwarranted
ODP misses.

To fix this, collectFlowOps cannot simply eliminate FlowOps for which
Discards() is true, because it's true for odpFlowKeyFlowOp.  So the
Discards() case has to be handled in FastDatapath send().
2016-02-29 13:27:15 -08:00
Matthias Radestock 20620f0002 Merge branch 'latest_release_doc_updates' into 1.4 2016-02-29 19:13:00 +00:00
Matthias Radestock 8d79e33ba1 remove stale ToC entry
This was missed in 8b061fd55
2016-02-29 19:12:00 +00:00
Bryan Boreham ce4857f5dc Merge pull request #2001 from weaveworks/issues/1996-try-all-pending-allocations
Try all pending allocations - LGTM.  Fixes #1996
2016-02-29 08:20:49 -08:00
Adam Harrison bceabe32a2 Try all pending allocations
We can have outstanding allocations for different ranges owned by
different peers, so we should not short circuit after the first space
request.
2016-02-25 14:56:33 +00:00
Matthias Radestock 6a9f9f66dc don't check for 'Restarting' when attaching on startup
It is overkill.
2016-02-23 13:20:22 +00:00
Adam Harrison 639e0e82c9 Merge pull request #1989 from weaveworks/1977-restarting-not-running
treat 'restarting' as 'not running'
2016-02-23 10:49:31 +00:00
Adam Harrison 4b0a6e1433 Merge pull request #1983 from weaveworks/1929-auto-detect-odp-on-relaunch
don't complain on relaunch when ODP is not supported
2016-02-23 10:46:36 +00:00
Matthias Radestock cb6db91b09 Merge branch 'latest_release_doc_updates' into 1.4 2016-02-23 10:16:08 +00:00
Matthias Radestock 6a02e2dc17 explain TCP/UDP connections, heartbeats, back-off
Fixes #1969
2016-02-23 09:54:15 +00:00
Ilya Dmitrichenko b377207faf Merge branch 'latest_release_doc_updates' into 1.4 2016-02-22 14:16:02 +00:00
Ilya Dmitrichenko 24ebb7cc7c Add missing dependency for latest gsutil 2016-02-22 14:11:36 +00:00
Ilya Dmitrichenko b5518db03c Add missing argument to tar 2016-02-22 14:02:39 +00:00
Ilya Dmitrichenko 2aa4e6a83a Use "official" gsutil installation instructions 2016-02-22 13:58:42 +00:00
Ilya Dmitrichenko 7c655cc3ba Fix false-positive docs uploads 2016-02-22 13:56:49 +00:00
Matthias Radestock 75cda01167 Merge branch 'latest_release_doc_updates' into 1.4 2016-02-22 13:55:18 +00:00
Matthias Radestock 4f0f3cf98d warn against using the plugin in combination with --net=weave
and expand the basic proxy usage docs slightly.
2016-02-22 13:53:39 +00:00
Matthias Radestock e014140134 Merge branch 'latest_release_doc_updates' into 1.4 2016-02-22 13:36:33 +00:00
Matthias Radestock c8ae128e59 for Travis, this no longer is a go project
Travis insists that one picks a project language. There is no go left
in the steps executed by travis. Instead we have Python, Ruby and
shell. Let's pick the first...

Picking Python makes travis unhappy with "Can not perform a '--user'
install. User site-packages are not visible in this
virtualenv". Dropping the '--user' flag fixes that.

(cherry picked from commit 1d8d098450)
2016-02-22 13:29:33 +00:00
Matthias Radestock 12d848162d shrink Travis usage
There is no point running builds, tests, lints on Travis, since we
already do that on Circle.

The only thing we aren't doing (and can't do) on Circle is doc
publishing, so now Travis does just that.

(cherry picked from commit 1038cbd1a3)
2016-02-22 13:29:33 +00:00
Matthias Radestock b12096bd6c tweak 2016-02-22 13:23:29 +00:00
Matthias Radestock 1430982166 Merge branch 'latest_release_doc_updates' into 1.4 2016-02-22 13:13:13 +00:00
Matthias Radestock 2a83aad1d6 warn against using plugin and proxy simultaneously
and give a complete example.

Partially addresses #1988.
2016-02-22 13:11:02 +00:00
Matthias Radestock 4a7157959a don't attempt to attach 'restarting' containers
this is an optimisation... there is no point attempting to attach a
'restarting' container - it will fail.

When the container *actually* restarts we'll get a 'Start' event, and
attach at that point.

Also, there is no point checking for 'Paused' since 'Paused' ->
'Running'.
2016-02-20 11:00:04 +00:00
Matthias Radestock e52abafc48 treat restarting containers as "not running"
thus preventing stale DNS & IPAM entries.

Fixes #1977
2016-02-20 10:59:47 +00:00
Matthias Radestock ee531b8023 don't complain on relaunch when ODP is not supported
...and WEAVE_NO_FASTDP isn't set.

Fixes #1929.
2016-02-18 22:00:08 +00:00
Matthias Radestock 5e761a62b0 Merge pull request #1985 from weaveworks/issues/1984-discovery
Add two functions required by ipamapi "contract"

Fixes #1984
2016-02-18 21:55:53 +00:00
Bryan Boreham b442567406 Add two functions required by ipamapi "contract" but not actually used 2016-02-18 15:29:10 +00:00
Matthias Radestock 17d53af2a2 improve logging of dns entry creation
- log inside the lock, so we get proper serialisation
- include the container name, so we can identify the specific entry
2016-02-16 14:04:34 +00:00
Adam Harrison 1228dbddb9 Add release v1.4.4 2016-02-09 11:20:51 +00:00
Adam Harrison c00b00d623 Merge pull request #1963 from weaveworks/issues/1959-dont-remove-network
Don't remove weave network on plugin shutdown because it bricks Docker 1.10
2016-02-09 10:53:13 +00:00
Bryan Boreham 7bbc9f1b82 Don't remove the weave network on shutdown because it bricks Docker 1.10 2016-02-09 10:02:06 +00:00
Matthias Radestock 15a92f9c92 Merge pull request #1961 from weaveworks/issues/1956-any-iface
Wait for multicast route on any interface

Fixes #1956.
2016-02-09 09:29:05 +00:00
Bryan Boreham 9386c01845 Wait for multicast route on any interface, to match weave script
which only adds a route if there isn't one already
2016-02-08 14:04:25 +00:00
16 changed files with 115 additions and 57 deletions

No files matched your search

+5 -20
View File
@@ -1,28 +1,13 @@
language: go
language: python
sudo: false
go:
- 1.4
env:
- PATH="${PATH}:${HOME}/.local/bin"
addons:
apt:
packages:
- libpcap-dev
- PATH="${PATH}:${HOME}/gsutil"
install:
- go clean -i net
- go install -tags netgo std
- go get github.com/golang/lint/golint
- pip install --user --upgrade gsutil
- pip install pyopenssl
- curl --silent --location https://storage.googleapis.com/pub/gsutil.tar.gz | tar xz -C $HOME
- bin/setup-ci-secrets $encrypted_5ba036e89377_key $encrypted_5ba036e89377_iv
- make travis
- go get ./...
script:
- make tests
after_success:
- go get github.com/mattn/goveralls
- test "${TRAVIS_PULL_REQUEST}" = "false" && site/build-and-publish.sh
- 'test "${TRAVIS_PULL_REQUEST}" = "true" || site/build-and-publish.sh'
+33
View File
@@ -1,3 +1,36 @@
## Release 1.4.5
Higher performance for multicast and broadcast traffic when using
Weave's Fast Datapath
* The flow rule to deliver broadcast and multicast packets in-kernel
was not created correctly, hence every such packet caused a
context-switch to the software router #2003/#2008
Other fixes:
* Remove DNS entries for containers that are being restarted by Docker
but are not live yet #1977/#1989
* Don't let one failing allocation attempt prevent others from
succeeding; they could be in different subnets which are more
available #1996/#2001
* Don't complain on second router launch on kernels that lack support
for Fast Datapath #1929/#1983
* Fix build broken by change in libnetwork IPAM API #1984/#1985
## Release 1.4.4
Fixing a rather serious issue that slipped through our preparations
for Docker 1.10:
* Restarting Docker or rebooting your machine while the Weave Net
plugin is running causes Docker 1.10.0 to fail to start #1959/#1963
Also one other small fix:
* Avoid a hang when trying to use plugin and proxy at the same time
#1956/#1961
## Release 1.4.3
Preparing for Docker 1.10, plus some bug-fixes.
+1 -1
View File
@@ -97,7 +97,7 @@ func (c *Client) AddObserver(ob ContainerObserver) error {
func (c *Client) IsContainerNotRunning(idStr string) bool {
container, err := c.InspectContainer(idStr)
if err == nil {
return !container.State.Running
return !container.State.Running || container.State.Restarting
}
if _, notThere := err.(*docker.NoSuchContainer); notThere {
return true
+11 -17
View File
@@ -140,29 +140,23 @@ func (alloc *Allocator) cancelOpsFor(ops *[]operation, ident string) bool {
return found
}
// Try all pending operations
func (alloc *Allocator) tryPendingOps() {
// The slightly different semantics requires us to operate on 'claims' and
// 'allocates' separately:
// Claims must be tried before Allocates
for i := 0; i < len(alloc.pendingClaims); {
op := alloc.pendingClaims[i]
// Try all operations in a queue
func (alloc *Allocator) tryOps(ops *[]operation) {
for i := 0; i < len(*ops); {
op := (*ops)[i]
if !op.Try(alloc) {
i++
continue
}
alloc.pendingClaims = append(alloc.pendingClaims[:i], alloc.pendingClaims[i+1:]...)
*ops = append((*ops)[:i], (*ops)[i+1:]...)
}
}
// When the first Allocate fails, bail - no need to
// send too many begs for space.
for i := 0; i < len(alloc.pendingAllocates); {
op := alloc.pendingAllocates[i]
if !op.Try(alloc) {
break
}
alloc.pendingAllocates = append(alloc.pendingAllocates[:i], alloc.pendingAllocates[i+1:]...)
}
// Try all pending operations
func (alloc *Allocator) tryPendingOps() {
// Process existing claims before servicing new allocations
alloc.tryOps(&alloc.pendingClaims)
alloc.tryOps(&alloc.pendingAllocates)
}
func (alloc *Allocator) spaceRequestDenied(sender mesh.PeerName, r address.Range) {
+1 -1
View File
@@ -84,8 +84,8 @@ func (n *Nameserver) broadcastEntries(es ...Entry) error {
}
func (n *Nameserver) AddEntry(hostname, containerid string, origin mesh.PeerName, addr address.Address) error {
n.infof("adding entry %s -> %s", hostname, addr.String())
n.Lock()
n.infof("adding entry for %s: %s -> %s", containerid, hostname, addr.String())
entry := n.entries.add(hostname, containerid, origin, addr)
n.Unlock()
return n.broadcastEntries(entry)
+1 -1
View File
@@ -53,7 +53,7 @@ func EnsureInterfaceAndMcastRoute(ifaceName string) (*net.Interface, error) {
}
dest := net.IPv4(224, 0, 0, 0)
check := func(route netlink.Route) bool {
return route.LinkIndex == iface.Index && route.Dst != nil && route.Dst.IP.Equal(dest)
return route.Dst != nil && route.Dst.IP.Equal(dest)
}
// check for currently-existing route after subscribing, to avoid race
routes, err := netlink.RouteList(nil, netlink.FAMILY_V4)
+11
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"net"
"github.com/docker/libnetwork/discoverapi"
"github.com/docker/libnetwork/ipamapi"
"github.com/docker/libnetwork/netlabel"
godocker "github.com/fsouza/go-dockerclient"
@@ -67,3 +68,13 @@ func (i *ipam) ReleaseAddress(poolID string, address net.IP) error {
Log.Debugln("ReleaseAddress", poolID, address)
return i.weave.ReleaseIP(address.String())
}
// Functions required by ipamapi "contract" but not actually used.
func (i *ipam) DiscoverNew(discoverapi.DiscoveryType, interface{}) error {
return nil
}
func (i *ipam) DiscoverDelete(discoverapi.DiscoveryType, interface{}) error {
return nil
}
-3
View File
@@ -106,9 +106,6 @@ func run(dockerClient *docker.Client, address, meshAddress, meshNetworkName, nam
select {
case sig := <-sigChan:
Log.Debugf("Caught signal %s; shutting down", sig)
if meshNetworkName != "" {
return dockerClient.Client.RemoveNetwork(meshNetworkName)
}
return nil
case err := <-endChan:
return err
+2 -1
View File
@@ -132,7 +132,8 @@ func (proxy *Proxy) AttachExistingContainers() {
}
continue
}
if containerShouldAttach(container) && (container.State.Running || container.State.Paused) {
// The 'Running' check is purely an optimisation.
if containerShouldAttach(container) && container.State.Running {
proxy.attach(container, false)
}
}
+8 -4
View File
@@ -775,10 +775,10 @@ func (fwd *fastDatapathForwarder) Forward(key ForwardPacketKey) FlowOp {
defer fwd.lock.RUnlock()
if fwd.remoteAddr == nil {
// Returning nil would discard the packet, but also
// result in a flow rule, which we would have to
// invalidate when we learn the remote IP. So for
// now, just prevent flows.
// Returning a DiscardingFlowOp would discard the
// packet, but also result in a flow rule, which we
// would have to invalidate when we learn the remote
// IP. So for now, just prevent flows.
return vetoFlowCreationFlowOp{}
}
@@ -1086,6 +1086,10 @@ func (fastdp *FastDatapath) send(fops FlowOp, frame []byte, lock *fastDatapathLo
case vetoFlowCreationFlowOp:
createFlow = false
default:
if xfop.Discards() {
continue
}
// A foreign FlowOp (e.g. a sleeve forwarding
// FlowOp), so send the packet through the
// FlowOp interface, decoding the packet
+1 -4
View File
@@ -84,15 +84,12 @@ func (mfop *MultiFlowOp) Discards() bool {
return true
}
// Flatten out a FlowOp to eliminate any MultiFlowOps
func FlattenFlowOp(fop FlowOp) []FlowOp {
return collectFlowOps(nil, fop)
}
func collectFlowOps(into []FlowOp, fop FlowOp) []FlowOp {
if fop == nil {
return into
}
if mfop, ok := fop.(*MultiFlowOp); ok {
for _, op := range mfop.ops {
into = collectFlowOps(into, op)
+9 -1
View File
@@ -87,7 +87,12 @@ launched via the Docker
[command-line interface](https://docs.docker.com/reference/commandline/cli/)
or
[remote API](https://docs.docker.com/reference/api/docker_remote_api/)
are attached to the weave network before they begin execution.
are attached to the weave network before they begin execution. To use
the proxy, run
$ eval $(weave env)
and then start containers as usual.
Containers started in this way that subsequently restart, either by an
explicit `docker restart` command or by Docker restart policy, are
@@ -100,6 +105,9 @@ named `weave` is created by `weave launch`, which you can use like this:
$ docker run --net=weave -ti ubuntu
> NB: The plugin is an *alternative* to the proxy, hence one should
> *not* run `eval $(weave env)` beforehand.
For more details see the [plugin documentation](plugin.html).
### <a name="addressing"></a>Address allocation
+22 -2
View File
@@ -18,13 +18,33 @@ Subsequently you can start containers with, e.g.
on any of the hosts, and they can all communicate with each other.
> WARNING: It is inadvisable to attach containers to the weave network
> using both the Weave Docker Networking Plugin and
> [Weave Docker API Proxy](proxy.html) simultaneously. Such containers
> will end up with two weave network interfaces and two IP addresses,
> which is rarely desirable. To ensure the proxy is not being used,
> *do not run `eval $(weave env)`, or `docker $(weave config) ...`*.
In order to use Weave's [Service Discovery](weavedns.html), you
need to pass the additional arguments `--dns` and `-dns-search`, for
which we provide a helper in the weave script:
$ docker run --net=weave -h foo.weave.local $(weave dns-args) -tdi ubuntu
$ docker run --net=weave -h bar.weave.local $(weave dns-args) -ti ubuntu
# ping foo
Here is a complete example of using the plugin for connectivity
between two containers running on different hosts:
host1$ weave launch
host1$ docker run --net=weave -h foo.weave.local $(weave dns-args) -tdi ubuntu
host2$ weave launch $HOST1
host2$ docker run --net=weave $(weave dns-args) -ti ubuntu
root@cb73d1a8aece:/# ping -c1 -q foo
PING foo (10.32.0.1) 56(84) bytes of data.
--- foo ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.341/1.341/1.341/0.000 ms
## Under the hood
+7
View File
@@ -124,6 +124,13 @@ Proxy](proxy.html#troubleshooting).
### <a name="weave-status-connections"></a>List connections
Connections between weave peers carry control traffic over TCP and
data traffic over UDP. For a connection to be fully established, the
TCP connection and UDP data path must be able to transmit information
in both directions. Weave routers check this regularly with
heartbeats. Failed connections are automatically retried, with an
exponential back-off.
Detailed information on the local weave router's connections can be
obtained with `weave status connections`:
-1
View File
@@ -18,7 +18,6 @@ hosts.
* [Adding and removing extra DNS entries](#add-remove)
* [Resolve weaveDNS entries from host](#resolve-weavedns-entries-from-host)
* [Hot-swapping service containers](#hot-swapping)
* [Retaining DNS entries when containers stop](#retain-stopped)
* [Configuring a custom TTL](#ttl)
* [Configuring the domain search path](#domain-search-path)
* [Using a different local domain](#local-domain)
+3 -1
View File
@@ -536,7 +536,9 @@ create_bridge() {
add_iptables_rule nat POSTROUTING -j WEAVE
else
if [ -n "$LAUNCHING_ROUTER" ] ; then
if [ "$BRIDGE_TYPE" = bridge -a -z "$WEAVE_NO_FASTDP" ] ; then
if [ "$BRIDGE_TYPE" = bridge -a -z "$WEAVE_NO_FASTDP" ] &&
util_op create-datapath $DATAPATH 2>/dev/null &&
util_op delete-datapath $DATAPATH 2>/dev/null ; then
cat <<EOF >&1
WEAVE_NO_FASTDP is not set, but there is already a bridge present of
the wrong type for fast datapath. Please do 'weave reset' to remove