Skip to content

Commit

Permalink
Swarm flavor revamp (docker-archive#376)
Browse files Browse the repository at this point in the history
Signed-off-by: David Chung <david.chung@docker.com>
  • Loading branch information
David Chung committed Feb 1, 2017
1 parent 478b0e2 commit 645e798
Show file tree
Hide file tree
Showing 28 changed files with 1,328 additions and 403 deletions.
4 changes: 4 additions & 0 deletions cmd/cli/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func managerCommand(plugins func() discovery.Plugins) *cobra.Command {

// Check the list of plugins
for _, gp := range groups {

endpoint, err := plugins().Find(gp.Plugin)
if err != nil {
return err
Expand All @@ -127,6 +128,9 @@ func managerCommand(plugins func() discovery.Plugins) *cobra.Command {
// TODO(chungers) -- we need to enforce and confirm the type of this.
// Right now we assume the RPC endpoint is indeed a group.
target, err := group_plugin.NewClient(endpoint.Address)

log.Debugln("For group", gp.Plugin, "address=", endpoint.Address, "err=", err, "spec=", spec)

if err != nil {
return err
}
Expand Down
256 changes: 217 additions & 39 deletions examples/flavor/swarm/README.md

Large diffs are not rendered by default.

51 changes: 0 additions & 51 deletions examples/flavor/swarm/e2e-plugins.json

This file was deleted.

24 changes: 10 additions & 14 deletions examples/flavor/swarm/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,39 @@ cleanup() {
}
trap cleanup EXIT

INFRAKIT_HOME=${INFRAKIT_HOME:-~/.infrakit}

# infrakit directories
plugins=~/.infrakit/plugins
plugins=$INFRAKIT_HOME/plugins
mkdir -p $plugins
rm -rf $plugins/*

configstore=~/.infrakit/configs
configstore=$INFRAKIT_HOME/configs
mkdir -p $configstore
rm -rf $configstore/*

# set the leader -- for os / file based leader detection for manager
leaderfile=~/.infrakit/leader
leaderfile=$INFRAKIT_HOME/leader
echo group > $leaderfile

# start up multiple instances of manager -- typically we want multiple SETS of plugins and managers
# but here for simplicity just start up with multiple managers and one set of plugins
infrakit-manager --name group --proxy-for-group group-stateless os --leader-file $leaderfile --store-dir $configstore &
infrakit-manager --name group1 --proxy-for-group group-stateless os --leader-file $leaderfile --store-dir $configstore &
infrakit-manager --name group2 --proxy-for-group group-stateless os --leader-file $leaderfile --store-dir $configstore &

sleep 5 # manager needs to detect leadership

# location of logfiles when plugins are started by the plugin cli
# the config json below expects LOG_DIR as an environment variable
LOG_DIR=~/.infrakit/logs
LOG_DIR=$INFRAKIT_HOME/logs
mkdir -p $LOG_DIR

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

export INFRAKIT_HOME=$INFRAKIT_HOME
export LOG_DIR=$LOG_DIR
export E2E_SWARM_DIR=$E2E_SWARM_DIR
export SWARM_MANAGER="tcp://192.168.2.200:4243"


# note -- on exit, this won't clean up the plugins started by the cli since they will be in a separate process group
infrakit plugin start --wait --config-url file:///$PWD/examples/flavor/swarm/e2e-plugins.json --os group-default instance-vagrant flavor-swarm flavor-vanilla &
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 &

starterpid=$!
echo "plugin start pid=$starterpid"
Expand Down
Loading

0 comments on commit 645e798

Please sign in to comment.