Merge plugin into weaver

This simplifies the following:

- plugin-v2 does not need to start "plugin" as a separate process, thus
  Docker is able to properly restart plugin-v2 in a case of any child
  process failing.
- No need for weaveplugin container.

plugin is enabled by default when running "weave launch". when starting
only the router, you should pass "--plugin" parameter to enable it.

The env var WEAVE_NO_PLUGIN is no more.
This commit is contained in:
Martynas Pumputis authored and Bryan Boreham committed 2017-04-12 13:05:40 +00:00
1 parent 8c917eeb17
commit 1f42a9d2f9
11 files changed
+93 -194

No files matched your search

+2 -4
View File
@@ -6,22 +6,20 @@ start_suite "Test docker restart policy"
weave_on $HOST1 launch
assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave weaveproxy weaveplugin" "always\nalways\nalways"
assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave weaveproxy" "always\nalways"
assert_raises "check_restart $HOST1 weave"
assert_raises "check_restart $HOST1 weaveproxy"
assert_raises "check_restart $HOST1 weaveplugin"
# stop + launch tests that restart policy changes result
# in the old containers being removed and new ones created
weave_on $HOST1 stop
weave_on $HOST1 launch --no-restart
assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave weaveproxy weaveplugin" "no\nno\nno"
assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave weaveproxy" "no\nno"
assert_raises "! check_restart $HOST1 weave"
assert_raises "! check_restart $HOST1 weaveproxy"
assert_raises "! check_restart $HOST1 weaveplugin"
# Relaunch to prevent the `weave stop` in `end_suite`
# timing out trying to remove the plugin network
+1 -2
View File
@@ -12,9 +12,8 @@ start_suite "--no-multicast-route operation"
$SSH $HOST1 docker network rm testmcasttrue testmcastfalse >/dev/null 2>&1 || true
# Ensure containers run either way have no multicast route
weave_on $HOST1 launch-router
weave_on $HOST1 launch-router --plugin
weave_on $HOST1 launch-proxy --no-multicast-route
weave_on $HOST1 launch-plugin # plugin defaults to multicast off except for 'net=weave'
start_container $HOST1 --no-multicast-route --name c1
proxy_start_container $HOST1 --name c2
+4 -3
View File
@@ -23,7 +23,7 @@ setup_master() {
WORK_DIR=$(mktemp -d)
mkdir -p \${WORK_DIR}/rootfs
docker create --name=$build_plugin_img weaveworks/plugin true
docker create --name=$build_plugin_img weaveworks/weave true
docker export $build_plugin_img | tar -x -C \${WORK_DIR}/rootfs
cp \${HOME}/plugin-v2/launch.sh \${WORK_DIR}/rootfs/home/weave/launch.sh
cp \${HOME}/plugin-v2/config.json \${WORK_DIR}
@@ -38,8 +38,6 @@ setup_master() {
[ -n "$COVERAGE" ] && docker plugin set $PLUGIN_NAME EXTRA_ARGS="-test.coverprofile=/home/weave/cover.prof --"
#docker plugin set $PLUGIN_NAME WEAVE_PASSWORD="foobar"
docker plugin enable $PLUGIN_NAME
ps aux | grep weave
cat /var/lib/weave/weaver.log
EOF
}
@@ -98,6 +96,9 @@ wait_for_service() {
start_suite "Test Docker plugin-v2"
#cleanup $HOST1 $HOST2
#exit 1
setup_master
#sleep 20 # registry seems to be async :(
setup_worker $($SSH $HOST1 docker swarm join-token --quiet worker)