Compare commits

...
25 Commits
Author SHA1 Message Date
Adam Harrison 5dfe1d28ff Add release 1.0.3 2015-09-03 15:02:57 +01:00
Adam Harrison 81134b408d Merge branch 'latest_release_doc_updates' into 1.0 2015-09-02 17:07:48 +01:00
Adam Harrison 26fdd5da03 Remove misplaced sentence 2015-09-02 17:06:23 +01:00
Matthias Radestock 8184d29d4a Merge pull request #1367 from weaveworks/1.0-python-call-changed
Fix docker api proxy smoke-tests after docker-py change
2015-08-28 20:22:22 +01:00
Matthias Radestock fef91b5339 comment 2015-08-28 18:09:23 +01:00
Matthias Radestock 24de98e188 refactor 2015-08-28 18:08:24 +01:00
Paul Bellamy 6b5f35e574 [proxy] Only replace the request body if we've modified it.
This is a temporary fix for a failure in docker-py tests:
"test_valid_no_config_specified".
2015-08-28 15:09:33 +01:00
Michael Bridgen bca31c7335 Merge pull request #1365 from weaveworks/1356_ignore_interface_deletion_errors_in_weave_reset
ignore interface deletion errors during `weave reset`
2015-08-27 15:38:16 +01:00
Bryan Boreham 7652b44c21 Ensure we have the busybox image 2015-08-27 15:14:06 +01:00
Bryan Boreham 548b4aea40 Call to docker-py changed upstream 2015-08-27 14:54:20 +01:00
Matthias Radestock 1df752cd33 ignore interface deletion errors during weave reset
These can occur when a container dies during `weave reset`.

Fixes #1356.
2015-08-27 07:54:51 +01:00
Matthias Radestock 79d1c404a7 Merge pull request #1342 from weaveworks/1336-fix-ring-fuzztest
Fix ring fuzz-test

Fixes #1336.
2015-08-20 16:25:50 +01:00
Adam Harrison 086ab9d126 Correct MaxUDPPacketSize constant 2015-08-20 15:22:10 +01:00
Bryan Boreham 135c34a45a Don't remove peer from table until after we've copied its entries out 2015-08-20 13:11:51 +01:00
Bryan Boreham ca6e54890c Fix Transfer() when removing a peer, so we actually target the other peer. 2015-08-20 13:11:51 +01:00
Matthias Radestock 1326994a6d Merge pull request #1319 from weaveworks/dns-tcp
Expose dns server on tcp as well as udp

Fixes #1333.
2015-08-19 16:34:09 +01:00
Matthias Radestock e61f9afb72 Merge pull request #1330 from weaveworks/1329_plug_gossip_sender_leak
plug GossipSender leak

Fixes #1329.
2015-08-19 11:26:25 +01:00
Matthias Radestock 0b764a2a27 plug GossipSender leak
GossipChannel.sendDown is the (only) place which creates
GossipSenders. It has two call sites, Send and SendDown, only the
former of which performed a gc of existing senders. Therefore, in
configurations with

- a lot of connection churn, and
- SendDown invocations for these connections, and
- few or no Send invocations

we can leak GossipSenders.

The most likely scenario for this to occur is a peer that, while
having no other connections, is making/accepting connections which get
torn down post handshake, e.g. because IPAM detected a clash.

Fixes #1329.
2015-08-19 10:22:11 +01:00
Matthias Radestock dc91ce9ec6 Merge branch 'latest_release_doc_updates' into 1.0 2015-08-18 13:33:15 +01:00
Matthias Radestock 36a857f343 remove "Contact information" link on docs home page
It's broken, and we have a link in the footer anyway.

Fixes #1260.
2015-08-18 13:31:28 +01:00
Ilya Dmitrichenko 147a537b82 We are not using gcloud, but it cause a conflict
https://s3.amazonaws.com/archive.travis-ci.org/jobs/76062893/log.txt
2015-08-18 09:47:37 +01:00
Ilya Dmitrichenko a4844b8ee7 We are not using gcloud, but it cause a conflict
https://s3.amazonaws.com/archive.travis-ci.org/jobs/76062893/log.txt
2015-08-18 09:46:09 +01:00
Paul Bellamy b4e13215c7 expose dns server on tcp as well as udp
issue was discovered when testing scope with master vs 1.0 branches.
2015-08-18 09:35:53 +01:00
Matthias Radestock aa19028583 Merge branch 'latest_release_doc_updates' into 1.0 2015-08-18 08:50:19 +01:00
Matthias Radestock a6e2296e0a Merge branch '1.0' into latest_release_doc_updates 2015-08-18 08:49:31 +01:00
11 changed files with 70 additions and 52 deletions

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ install:
- go clean -i net
- go install -tags netgo std
- go get github.com/golang/lint/golint
- pip install --user --upgrade gcloud gsutil
- pip install --user --upgrade gsutil
- bin/setup-ci-secrets $encrypted_5ba036e89377_key $encrypted_5ba036e89377_iv
- make travis
+11
View File
@@ -1,3 +1,14 @@
## Release 1.0.3
This release contains a weaveDNS feature enhancement as well as minor fixes for
improved stability and robustness.
More details in the
[change log](https://github.com/weaveworks/weave/issues?q=milestone%3A1.0.3).
The release is fully compatible with other 1.0.x versions, so existing
clusters can be upgraded incrementally.
## Release 1.0.2
This release fixes a number of bugs, including some security
+8 -8
View File
@@ -588,7 +588,7 @@ func TestFuzzRing(t *testing.T) {
}
func TestFuzzRingHard(t *testing.T) {
//common.InitDefaultLogging(true)
//common.SetLogLevel("debug")
var (
numPeers = 100
iterations = 3000
@@ -635,13 +635,8 @@ func TestFuzzRingHard(t *testing.T) {
return
}
// Pick one peer to remove, and a different one to transfer to
peerIndex, peername, _ := randomPeer(-1)
// Remove peer from our state
peers = append(peers[:peerIndex], peers[peerIndex+1:]...)
rings = append(rings[:peerIndex], rings[peerIndex+1:]...)
theRanges = make(map[int][]address.Range)
// Transfer the space for this peer on another peer, but not this one
_, otherPeername, otherRing := randomPeer(peerIndex)
// We need to be in a ~converged ring to rmpeer
@@ -650,7 +645,12 @@ func TestFuzzRingHard(t *testing.T) {
}
common.Debug.Printf("%s: transferring from peer %s", otherPeername, peername)
otherRing.Transfer(peername, peername)
otherRing.Transfer(peername, otherPeername)
// Remove peer from our state
peers = append(peers[:peerIndex], peers[peerIndex+1:]...)
rings = append(rings[:peerIndex], rings[peerIndex+1:]...)
theRanges = make(map[int][]address.Range)
// And now tell everyone about the transfer - rmpeer is
// not partition safe
+7 -6
View File
@@ -45,6 +45,7 @@ func (i *createContainerInterceptor) InterceptRequest(r *http.Request) error {
return err
}
r.Body.Close()
r.Body = ioutil.NopCloser(bytes.NewReader(body))
container := createContainerRequestBody{}
if err := json.Unmarshal(body, &container); err != nil {
@@ -68,14 +69,14 @@ func (i *createContainerInterceptor) InterceptRequest(r *http.Request) error {
if err := i.setWeaveDNS(&container, r); err != nil {
return err
}
}
newBody, err := json.Marshal(container)
if err != nil {
return err
newBody, err := json.Marshal(container)
if err != nil {
return err
}
r.Body = ioutil.NopCloser(bytes.NewReader(newBody))
r.ContentLength = int64(len(newBody))
}
r.Body = ioutil.NopCloser(bytes.NewReader(newBody))
r.ContentLength = int64(len(newBody))
return nil
}
+11 -9
View File
@@ -1,6 +1,7 @@
package proxy
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
@@ -18,6 +19,7 @@ func (i *createExecInterceptor) InterceptRequest(r *http.Request) error {
return err
}
r.Body.Close()
r.Body = ioutil.NopCloser(bytes.NewReader(body))
options := docker.CreateExecOptions{}
if err := json.Unmarshal(body, &options); err != nil {
@@ -29,21 +31,21 @@ func (i *createExecInterceptor) InterceptRequest(r *http.Request) error {
return err
}
_, hasWeaveWait := container.Volumes["/w"]
if _, hasWeaveWait := container.Volumes["/w"]; !hasWeaveWait {
return nil
}
cidrs, err := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig)
if err != nil {
Info.Printf("Ignoring container %s due to %s", container.ID, err)
} else if hasWeaveWait {
Info.Printf("Exec in container %s with WEAVE_CIDR \"%s\"", container.ID, strings.Join(cidrs, " "))
cmd := append(weaveWaitEntrypoint, "-s")
options.Cmd = append(cmd, options.Cmd...)
return nil
}
if err := marshalRequestBody(r, options); err != nil {
return err
}
Info.Printf("Exec in container %s with WEAVE_CIDR \"%s\"", container.ID, strings.Join(cidrs, " "))
cmd := append(weaveWaitEntrypoint, "-s")
options.Cmd = append(cmd, options.Cmd...)
return nil
return marshalRequestBody(r, options)
}
func (i *createExecInterceptor) InterceptResponse(r *http.Response) error {
+1 -1
View File
@@ -11,7 +11,7 @@ const (
Port = 6783
HTTPPort = Port + 1
DefaultPMTU = 65535
MaxUDPPacketSize = 65536
MaxUDPPacketSize = 65535
ChannelSize = 16
FragTestSize = 60001
PMTUDiscoverySize = 60000
+26 -20
View File
@@ -113,17 +113,32 @@ func (c *GossipChannel) Send(srcName PeerName, data GossipData) {
connections := c.ourself.Connections()
c.Lock()
defer c.Unlock()
// GC - randomly (courtesy of go's map iterator) pick some
// existing entries and stop&remove them if the associated
// connection is no longer active. We stop as soon as we
// encounter a valid entry; the idea being that when there is
// little or no garbage then this executes close to O(1)[1],
// whereas when there is lots of garbage we remove it quickly.
//
// [1] TODO Unfortunately, due to the desire to avoid nested
// locks, instead of simply invoking Peer.ConnectionTo(name)
// below, we have that Peer.Connections() invocation above. That
// is O(n_our_connections) at best.
c.gcSenders(connections)
for conn := range selectedConnections {
c.sendDown(conn, data)
}
}
func (c *GossipChannel) SendDown(conn Connection, data GossipData) {
connections := c.ourself.Connections()
c.Lock()
defer c.Unlock()
c.gcSenders(connections)
c.sendDown(conn, data)
}
// GC - randomly (courtesy of go's map iterator) pick some existing
// senders and stop&remove them if the associated connection is no
// longer active. We stop as soon as we encounter a valid entry; the
// idea being that when there is little or no garbage then this
// executes close to O(1)[1], whereas when there is lots of garbage we
// remove it quickly.
//
// [1] TODO Unfortunately, due to the desire to avoid nested locks,
// instead of simply invoking LocalPeer.ConnectionTo(name), we pass in
// the result of LocalPeer.Connections(). That is O(n_our_connections)
// at best.
func (c *GossipChannel) gcSenders(connections ConnectionSet) {
for conn, sender := range c.senders {
if _, found := connections[conn]; !found {
delete(c.senders, conn)
@@ -132,15 +147,6 @@ func (c *GossipChannel) Send(srcName PeerName, data GossipData) {
break
}
}
for conn := range selectedConnections {
c.sendDown(conn, data)
}
}
func (c *GossipChannel) SendDown(conn Connection, data GossipData) {
c.Lock()
c.sendDown(conn, data)
c.Unlock()
}
func (c *GossipChannel) sendDown(conn Connection, data GossipData) {
-1
View File
@@ -11,4 +11,3 @@ layout: default
* [Troubleshooting](troubleshooting.html)
* [Building](building.html)
* [How it works](how-it-works.html)
* [Contact information](https://github.com/weaveworks/weave#contact-us)
-3
View File
@@ -161,9 +161,6 @@ The inverse operation can be carried out using the `dns-remove` command:
$ weave dns-remove 10.2.1.27 $C
```
When queried about a name with multiple IPs, weaveDNS returns a random
result from the set of IPs available.
## <a name="hot-swapping"></a>Hot-swapping service containers
If you would like to deploy a new version of a service, keep the old
+3 -1
View File
@@ -5,6 +5,8 @@
start_suite "Run docker-py test suite against the proxy"
docker_on $HOST1 pull joffrey/docker-py >/dev/null
# workaround for https://github.com/docker/docker-py/issues/745
docker_on $HOST1 pull busybox >/dev/null
weave_on $HOST1 launch-proxy --no-default-ipam
@@ -13,7 +15,7 @@ if docker_on $HOST1 run \
-e DOCKER_HOST=tcp://172.17.42.1:12375 \
-v /tmp:/tmp \
-v /var/run/docker.sock:/var/run/docker.sock \
joffrey/docker-py python tests/integration_test.py ; then
joffrey/docker-py py.test tests/integration_test.py ; then
assert_raises "true"
else
assert_raises "false"
+2 -2
View File
@@ -1079,7 +1079,7 @@ case "$COMMAND" in
# additional parameters, such as resource limits, to docker
# when launching the weave container.
DNS_CONTAINER=$(docker run --privileged -d --name=$DNS_CONTAINER_NAME \
-p $DOCKER_BRIDGE_IP:53:53/udp \
-p $DOCKER_BRIDGE_IP:53:53/udp -p $DOCKER_BRIDGE_IP:53:53/tcp \
-e WEAVE_CIDR=none \
-v /var/run/docker.sock:/var/run/docker.sock \
$WEAVEDNS_DOCKER_ARGS $DNS_IMAGE -iface $CONTAINER_IFNAME -httpiface "$DNS_HTTP_IFNAME" "$@")
@@ -1300,7 +1300,7 @@ case "$COMMAND" in
conntrack -D -p udp --dport $PORT >/dev/null 2>&1 || true
destroy_bridge
for LOCAL_IFNAME in $(ip link show | grep v${CONTAINER_IFNAME}pl | cut -d ' ' -f 2 | tr -d ':') ; do
ip link del $LOCAL_IFNAME
ip link del $LOCAL_IFNAME >/dev/null 2>&1 || true
done
;;
rmpeer)