Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit 645e798

Browse files
author
David Chung
authored
Swarm flavor revamp (#376)
Signed-off-by: David Chung <[email protected]>
1 parent 478b0e2 commit 645e798

28 files changed

+1328
-403
lines changed

cmd/cli/manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func managerCommand(plugins func() discovery.Plugins) *cobra.Command {
110110

111111
// Check the list of plugins
112112
for _, gp := range groups {
113+
113114
endpoint, err := plugins().Find(gp.Plugin)
114115
if err != nil {
115116
return err
@@ -127,6 +128,9 @@ func managerCommand(plugins func() discovery.Plugins) *cobra.Command {
127128
// TODO(chungers) -- we need to enforce and confirm the type of this.
128129
// Right now we assume the RPC endpoint is indeed a group.
129130
target, err := group_plugin.NewClient(endpoint.Address)
131+
132+
log.Debugln("For group", gp.Plugin, "address=", endpoint.Address, "err=", err, "spec=", spec)
133+
130134
if err != nil {
131135
return err
132136
}

examples/flavor/swarm/README.md

Lines changed: 217 additions & 39 deletions
Large diffs are not rendered by default.

examples/flavor/swarm/e2e-plugins.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

examples/flavor/swarm/e2e.sh

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,39 @@ cleanup() {
2323
}
2424
trap cleanup EXIT
2525

26+
INFRAKIT_HOME=${INFRAKIT_HOME:-~/.infrakit}
27+
2628
# infrakit directories
27-
plugins=~/.infrakit/plugins
29+
plugins=$INFRAKIT_HOME/plugins
2830
mkdir -p $plugins
2931
rm -rf $plugins/*
3032

31-
configstore=~/.infrakit/configs
33+
configstore=$INFRAKIT_HOME/configs
3234
mkdir -p $configstore
3335
rm -rf $configstore/*
3436

3537
# set the leader -- for os / file based leader detection for manager
36-
leaderfile=~/.infrakit/leader
38+
leaderfile=$INFRAKIT_HOME/leader
3739
echo group > $leaderfile
3840

39-
# start up multiple instances of manager -- typically we want multiple SETS of plugins and managers
40-
# but here for simplicity just start up with multiple managers and one set of plugins
41-
infrakit-manager --name group --proxy-for-group group-stateless os --leader-file $leaderfile --store-dir $configstore &
42-
infrakit-manager --name group1 --proxy-for-group group-stateless os --leader-file $leaderfile --store-dir $configstore &
43-
infrakit-manager --name group2 --proxy-for-group group-stateless os --leader-file $leaderfile --store-dir $configstore &
44-
45-
sleep 5 # manager needs to detect leadership
46-
4741
# location of logfiles when plugins are started by the plugin cli
4842
# the config json below expects LOG_DIR as an environment variable
49-
LOG_DIR=~/.infrakit/logs
43+
LOG_DIR=$INFRAKIT_HOME/logs
5044
mkdir -p $LOG_DIR
5145

5246
# see the config josn 'e2e-test-plugins.json' for reference of environment variable E2E_SWARM_DIR
53-
E2E_SWARM_DIR=~/.infrakit/e2e_swarm
47+
E2E_SWARM_DIR=$INFRAKIT_HOME/e2e_swarm
5448
mkdir -p $E2E_SWARM_DIR
5549
rm -rf $E2E_SWARM_DIR/*
5650

51+
export INFRAKIT_HOME=$INFRAKIT_HOME
5752
export LOG_DIR=$LOG_DIR
5853
export E2E_SWARM_DIR=$E2E_SWARM_DIR
5954
export SWARM_MANAGER="tcp://192.168.2.200:4243"
6055

56+
6157
# note -- on exit, this won't clean up the plugins started by the cli since they will be in a separate process group
62-
infrakit plugin start --wait --config-url file:///$PWD/examples/flavor/swarm/e2e-plugins.json --os group-default instance-vagrant flavor-swarm flavor-vanilla &
58+
infrakit plugin start --wait --config-url file:///$PWD/examples/flavor/swarm/e2e-plugins.json --os manager group-stateless instance-file instance-vagrant flavor-swarm flavor-vanilla &
6359

6460
starterpid=$!
6561
echo "plugin start pid=$starterpid"

0 commit comments

Comments
 (0)