From 42bda34ccc3f901c2a528e496726864ceb23d1a2 Mon Sep 17 00:00:00 2001 From: David Chung Date: Thu, 2 Feb 2017 17:04:21 -0800 Subject: [PATCH] Remove config files that are no longer applicable Signed-off-by: David Chung --- examples/flavor/swarm/e2e.sh | 137 ------------------ .../flavor/swarm/swarm-manager-template.json | 35 ----- .../flavor/swarm/swarm-vagrant-manager.json | 24 --- .../flavor/swarm/swarm-vagrant-manager2.json | 20 --- .../flavor/swarm/swarm-vagrant-workers.json | 20 --- .../flavor/swarm/swarm-vagrant-workers2.json | 20 --- 6 files changed, 256 deletions(-) delete mode 100755 examples/flavor/swarm/e2e.sh delete mode 100644 examples/flavor/swarm/swarm-manager-template.json delete mode 100644 examples/flavor/swarm/swarm-vagrant-manager.json delete mode 100644 examples/flavor/swarm/swarm-vagrant-manager2.json delete mode 100644 examples/flavor/swarm/swarm-vagrant-workers.json delete mode 100644 examples/flavor/swarm/swarm-vagrant-workers2.json diff --git a/examples/flavor/swarm/e2e.sh b/examples/flavor/swarm/e2e.sh deleted file mode 100755 index e9c48b94f..000000000 --- a/examples/flavor/swarm/e2e.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset - -HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "$HERE/../../.." - -export PATH=$PWD/build:$PATH - -E2E_CLEANUP=${E2E_CLEANUP:-true} - -starterpid="" # pid of the cli plugin starter -cleanup() { - if [ "$E2E_CLEANUP" = "true" ]; then - pgid=$(ps -o pgid= -p $starterpid) - echo "Stopping plugin starter utility - $starterpid , pgid=$pgid" - kill -TERM -$pgid - echo "Stopping other jobs" - kill $(jobs -p) - rm -rf tutorial - fi -} -trap cleanup EXIT - -INFRAKIT_HOME=${INFRAKIT_HOME:-~/.infrakit} - -# infrakit directories -plugins=$INFRAKIT_HOME/plugins -mkdir -p $plugins -rm -rf $plugins/* - -configstore=$INFRAKIT_HOME/configs -mkdir -p $configstore -rm -rf $configstore/* - -# set the leader -- for os / file based leader detection for manager -leaderfile=$INFRAKIT_HOME/leader -echo group > $leaderfile - -# 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_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_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 manager group-stateless instance-file instance-vagrant flavor-swarm flavor-vanilla & - -starterpid=$! -echo "plugin start pid=$starterpid" - -sleep 5 - -expect_exact_output() { - message=$1 - cmd=$2 - expected_output=$3 - - actual_output="$($2)" - echo -n "--> $message: " - if [ "$actual_output" = "$3" ] - then - echo 'PASS' - else - echo 'FAIL' - echo "Expected output: $expected_output" - echo "Actual output: $actual_output" - exit 1 - fi -} - -expect_output_lines() { - message=$1 - cmd=$2 - expected_lines=$3 - - actual_line_count=$($2 | wc -l) - echo -n "--> $message: " - if [ "$actual_line_count" -eq "$3" ] - then - echo 'PASS' - else - echo 'FAIL' - echo "Expected line count: $expected_lines" - echo "Actual line count: $actual_line_count" - exit 1 - fi -} - -expect_output_lines "7 plugins should be discoverable" "infrakit plugin ls -q" "7" -expect_output_lines "0 instances should exist" "infrakit instance describe -q --name instance-vagrant" "0" - -echo "Commiting manager" -infrakit group commit examples/flavor/swarm/swarm-vagrant-manager.json - -echo 'Waiting for group to be provisioned' -sleep 60 - -expect_exact_output "Should be watching one group" "infrakit group ls -q" "swarm-managers" -expect_output_lines "1 instances should exist in group" "infrakit group describe swarm-managers -q" "1" -expect_output_lines "1 instances should exist" "infrakit instance describe -q --name instance-vagrant" "1" - -echo "Commiting workers" -infrakit group commit examples/flavor/swarm/swarm-vagrant-workers.json - -echo 'Waiting for group to be provisioned' -sleep 120 - -expect_output_lines "Should be watching two groups" "infrakit group ls -q" "2" -expect_output_lines "2 instances should exist in group" "infrakit group describe swarm-workers -q" "2" -expect_output_lines "3 instances should exist" "infrakit instance describe -q --name instance-vagrant" "3" - -echo "Checking Docker Swarm" - -docker -H $SWARM_MANAGER node ls - - -echo "Destroying workers" -infrakit group destroy swarm-workers -expect_output_lines "1 instances should exist" "infrakit instance describe -q --name instance-vagrant" "1" - -echo "Destroying managers" -infrakit group destroy swarm-managers -expect_output_lines "0 instances should exist" "infrakit instance describe -q --name instance-vagrant" "0" - -echo 'ALL TESTS PASSED' diff --git a/examples/flavor/swarm/swarm-manager-template.json b/examples/flavor/swarm/swarm-manager-template.json deleted file mode 100644 index aee4cf82f..000000000 --- a/examples/flavor/swarm/swarm-manager-template.json +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -set -o errexit -set -o nounset -set -o xtrace - -{{/* */}} -{{ include "install-docker.sh" }} - -mkdir -p /etc/docker -cat << EOF > /etc/docker/daemon.json -{ - "labels": {{ INFRAKIT_LABELS | to_json }} -} -EOF - -{{/* Reload the engine labels */}} -kill -s HUP $(cat /var/run/docker.pid) -sleep 5 - -{{ if index INSTANCE_LOGICAL_ID ALLOCATIONS.LogicalIDs | eq 0 }} - -{{/* The first node of the special allocations will initialize the swarm. */}} -docker swarm init --advertise-addr {{ INSTANCE_LOGICAL_ID }}:4243 - -{{ else }} - - {{/* retries when trying to get the join tokens */}} - {{ SWARM_CONNECT_RETRIES 10 "30s" }} - - {{/* The rest of the nodes will join as followers in the manager group. */}} - docker swarm join {{ SWARM_MANAGER_IP }} --token {{ SWARM_JOIN_TOKENS.Manager }} - - - -{{ end }} diff --git a/examples/flavor/swarm/swarm-vagrant-manager.json b/examples/flavor/swarm/swarm-vagrant-manager.json deleted file mode 100644 index c55f05626..000000000 --- a/examples/flavor/swarm/swarm-vagrant-manager.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "ID": "swarm-managers", - "Properties": { - "Allocation": { - "LogicalIDs": ["192.168.2.200"] - }, - "Instance": { - "Plugin": "instance-vagrant", - "Properties": { - "Box": "williamyeh/ubuntu-trusty64-docker" - } - }, - "Flavor": { - "Plugin": "flavor-vanilla", - "Properties": { - "Init": [ - "docker swarm init --advertise-addr 192.168.2.200", - "echo 'DOCKER_OPTS=\"$DOCKER_OPTS -H tcp://0.0.0.0:4243\"' >> /etc/default/docker", - "service docker restart" - ] - } - } - } -} diff --git a/examples/flavor/swarm/swarm-vagrant-manager2.json b/examples/flavor/swarm/swarm-vagrant-manager2.json deleted file mode 100644 index 3dc5a5a11..000000000 --- a/examples/flavor/swarm/swarm-vagrant-manager2.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ID": "swarm-managers", - "Properties": { - "Allocation": { - "LogicalIDs": ["192.168.2.200", "192.168.2.201", "192.168.2.202"] - }, - "Instance": { - "Plugin": "instance-vagrant", - "Properties": { - "Box": "ubuntu/trusty64" - } - }, - "Flavor": { - "Plugin": "flavor-swarm/manager", - "Properties": { - "InitScriptTemplateURL" : "file:///Users/davidchung/projects/src/github.com/docker/infrakit/examples/flavor/swarm/swarm-manager-template.json" - } - } - } -} diff --git a/examples/flavor/swarm/swarm-vagrant-workers.json b/examples/flavor/swarm/swarm-vagrant-workers.json deleted file mode 100644 index 8fd84d974..000000000 --- a/examples/flavor/swarm/swarm-vagrant-workers.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ID": "swarm-workers", - "Properties": { - "Allocation": { - "Size": 2 - }, - "Instance": { - "Plugin": "instance-vagrant", - "Properties": { - "Box": "williamyeh/ubuntu-trusty64-docker" - } - }, - "Flavor": { - "Plugin": "flavor-swarm/worker", - "Properties": { - "DockerRestartCommand": "service docker restart" - } - } - } -} diff --git a/examples/flavor/swarm/swarm-vagrant-workers2.json b/examples/flavor/swarm/swarm-vagrant-workers2.json deleted file mode 100644 index 9be6d990f..000000000 --- a/examples/flavor/swarm/swarm-vagrant-workers2.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "ID": "swarm-workers", - "Properties": { - "Allocation": { - "Size": 2 - }, - "Instance": { - "Plugin": "instance-vagrant", - "Properties": { - "Box": "ubuntu/trusty64" - } - }, - "Flavor": { - "Plugin": "flavor-swarm/worker", - "Properties": { - "InitScriptTemplateURL" : "file:///Users/davidchung/projects/src/github.com/docker/infrakit/examples/flavor/swarm/swarm-worker-template.json" - } - } - } -}