Commit Graph
1823 Commits
Author SHA1 Message Date
Paul Bellamy ee07d645b4 golint cleanup of else block 2015-05-19 10:47:57 +01:00
Paul Bellamy b71a428369 proxy should be sending error code to client, instead of exiting 2015-05-19 10:34:46 +01:00
Paul Bellamy 6911dc8d38 updating proxy with-dns description to match docs 2015-05-19 10:34:46 +01:00
Paul Bellamy 1e7c82bb58 use busybox instead of ubuntu for proxy image pulling test
busybox is smaller. gliderlabs/alpine is even smaller, but is used by
weaveexec, so we can't remove it.
2015-05-19 10:34:46 +01:00
Paul Bellamy 2f8c5d7bd9 proxy interceptors implicitly modify arguments, instead of returning them 2015-05-19 10:34:46 +01:00
Matthias Radestock 126d4f4079 some refactoring and tidying
- some inlining
- compile regexps once
- consistent error messages
- always mention container id in startContainerInterceptor errors
2015-05-19 10:34:46 +01:00
Paul Bellamy ca4b8e6f8e add proxy support for 'docker restart' 2015-05-19 10:34:46 +01:00
Paul Bellamy 2a120e5565 refactor proxy rawStream handler 2015-05-19 10:34:46 +01:00
Paul Bellamy 6fa0a9d70c moving weaveproxy docs off 'experimental-features' 2015-05-19 10:34:46 +01:00
Paul Bellamy 55d17ba3bf separate proxy package into weaveproxy and proxy 2015-05-19 10:34:46 +01:00
Paul Bellamy bedc20c7c1 extract docker-bridge-ip fetching from proxy into bash script 2015-05-19 10:34:46 +01:00
Paul Bellamy 96a69d2303 Add dns support for the proxy
In the proxy, I swapped the 'flag' library for
'code.google.com/p/getopt', which uses double-dash flags.

proxy lets 'weave attach' do dns registration on container start

proxy needs to set DNSSearch if not specified
2015-05-19 10:34:45 +01:00
Paul Bellamy 444b1482fa add weavewait
binocarlos/wait-for-weave is Apache2 licensed, so attribution/etc applies. Thus, we
re-invent the wheel here.
2015-05-19 10:34:45 +01:00
Paul Bellamy 9389001a1d [docs] Initial version of proxy docs 2015-05-19 10:34:45 +01:00
Paul Bellamy 5a6a67f632 Add integration test for the proxy, using docker-py client 2015-05-19 10:34:45 +01:00
Michael Bridgen 6c4271f15d Add launch-proxy command to cli
Use curl /weave to wait for the proxy to boot before returning.
2015-05-19 09:48:12 +01:00
Michael Bridgen 6d7de3ddff Proxy implementation
This adds a docker remote API proxy to the weaveexec image. The proxy
has hooks for (post-) container start and (pre-) container create; the
former attaches a weave interface to a container given a WEAVE_CIDR
environment entry, and the latter adjusts the entrypoint of a container
to wait for the ethwe interface.

Notes:

None of the hooks need to inspect/change large bodies. In order to avoid
a crash when handling images larger than memory we need to ensure that
the entire request body is never loaded into memory (i.e. No
ioutils.ReadAll).

When proxying a raw-stream response, we can't use http.WriteHeader. It
sets the Transfer-Encoding to chunked, which will throw off the clients.
Instead we have to hijack the socket, and write out http status code
manually.

For chunked transfer-encodings, clients (docker-py) depend on each http
chunk containing exactly one JSON object. Therefore, we cannot re-chunk
the body, and have to pass it across verbatim.

Proxy needs to pass multi-cidrs separately when calling weave. Otherwise
they get smashed together on the command line, and the call fails.

When creating the image, if no entrypoint is specified on the container,
it should use the entrypoint of the image. Code for this is based on
powerstrip-weave.

We handle WEAVE_CIDR='' by acting like it is not set. The reason being,
that because WEAVE_CIDR is inherited from images (along with env vars),
setting it to blank is equivalent to unsetting it.
2015-05-19 09:48:12 +01:00
Paul Bellamy d8e1d0798e replace test usage of ifconfig with ip link show 2015-05-19 09:48:12 +01:00
Matthias Radestock e9963945d6 cosmetic 2015-05-18 23:38:37 +01:00
Matthias Radestock 8e1ac2b300 Merge pull request #693 from bboreham/677-document-rmpeer
Illustrate the usage of 'weave rmpeer'

Closes #677.
2015-05-18 17:37:19 +01:00
Bryan Boreham 25c70cfad6 Illustrate the usage of 'weave rmpeer' 2015-05-18 17:26:24 +01:00
Matthias Radestock cf34335ec7 Merge pull request #691 from bboreham/681-ipam-docs
Expand documentation of 'weave launch' parameters for IPAM

Closes #669 and #681.
2015-05-18 17:09:26 +01:00
Bryan Boreham 4ea9cfca48 Expanded description of 'weave launch' parameters for IPAM 2015-05-18 16:49:45 +01:00
Matthias Radestock 94525f0497 Merge pull request #690 from bboreham/and_true
Fix typo '&& true' in weave script, that could cause partial population of DNS
2015-05-18 16:47:28 +01:00
Bryan Boreham 0227f7e727 '&& true' was a typo - replaced with '|| true' 2015-05-18 16:06:38 +01:00
Bryan Boreham bb4dd716c8 Document -iprange a bit more, and warn not to use its addresses elsewhere 2015-05-18 16:03:34 +01:00
Matthias Radestock d53ec858a2 Merge pull request #689 from bboreham/671-hide-errors
Silence complaints from http_call when at end of 'weave hide'

Fixes #671.
2015-05-18 15:59:45 +01:00
Bryan Boreham 286c46653c Add smoke tests for 'weave expose' and 'weave hide' when weave isn't running 2015-05-18 15:43:44 +01:00
Bryan Boreham 7cf8234d9f Silence complaints from http_call when at end of 'weave hide' 2015-05-18 14:54:46 +01:00
Matthias Radestock fd0282ee05 Merge pull request #686 from bboreham/672-ipam-run-local
Fetch an address from IPAM for 'weave --local run'

Fixes #672.
2015-05-18 14:44:46 +01:00
Bryan Boreham 5cc3036498 Extend smoke test for 'weave run --local' to include IPAM 2015-05-18 14:38:12 +01:00
Matthias Radestock 957c8a1954 Merge pull request #665 from pradeepchhetri/dockerfile
Merged two run commands into one in weavexec Dockerfile
2015-05-18 12:44:17 +01:00
Matthias Radestock 94c7e7f646 Merge pull request #567 from bboreham/pktdebug
Rename per-packet debugging flag to `-pktdebug`
2015-05-18 12:21:40 +01:00
Matthias Radestock 5f16854e1f Merge pull request #685 from bboreham/679-ipam-docs
Give 'weave ps' example with IPAM and link to docs

Closes #679.
2015-05-18 12:20:03 +01:00
Bryan Boreham 48e9c53dda Fetch an address from IPAM for 'weave --local run' 2015-05-18 12:06:06 +01:00
Bryan Boreham 0ec4417992 Rename per-packet debugging flag to -pktdebug
to allow `-debug` to mean "more verbose logging"
2015-05-18 11:52:50 +01:00
Adam Harrison eecb540141 Merge pull request #683 from rade/refactor_smoke_tests
Refactor smoke tests
2015-05-18 11:37:40 +01:00
Bryan Boreham 14c690d9f5 Give 'weave ps' example with IPAM and link to docs 2015-05-18 11:37:38 +01:00
Matthias Radestock c08bfd2205 always quote $@ 2015-05-18 11:16:12 +01:00
Adam Harrison d9eea28f17 Merge pull request #667 from rade/revise_weavedns_docs
revise weaveDNS docs
2015-05-18 10:46:09 +01:00
Matthias Radestock 06abd62af0 always spell weaveDNS lower-case, except in titles/headings 2015-05-18 10:43:07 +01:00
Matthias Radestock f732252f22 eliminate ambiguity 2015-05-18 10:36:13 +01:00
Matthias Radestock a01d33452e revise weaveDNS docs
- add ToC and anchors for all headings
- move docker bridge settings into "How it works" - it's a rarely used
  feature
- highlight a bunch of features, extracting them from obscurely titled
  sub-sections of "manual usage"
  - basic rendundancy
  - adding/removing extra DNS entries
  - service hot-swapping
  - ability to retain entries for stopped containers
  - using a different local domain
- rename remainder of "manual usage" section to "Using weaveDNS
  without `weave run`"
- remove "Unregistering" section - it was out of date and is not
  covered by the "add/remove" section
2015-05-18 10:36:13 +01:00
Matthias Radestock 6dd6d9d6f0 one ping to rule them all 2015-05-16 21:53:50 +01:00
Matthias Radestock ccd468f80c drop -debug from launch-dns
It wasn't being applied consistently in any case.
2015-05-16 21:06:08 +01:00
Matthias Radestock 4e7ddedf75 extract startup of container with dns
There is now just one mention of the aanand/docker-dnsutils image; in
config.sh.
2015-05-16 21:00:27 +01:00
Matthias Radestock 8261c7f782 extract hostname as a constant 2015-05-16 21:00:27 +01:00
Matthias Radestock c3c5b76007 use already-defined constants 2015-05-16 21:00:27 +01:00
Matthias Radestock 1c1bd817e1 extract startup of simple container
There is now just one mention of the gliderlabs/alpine image outside config.sh.
2015-05-16 21:00:07 +01:00
Matthias Radestock ab244f76f6 consistency 2015-05-16 20:37:16 +01:00