Remove manual etcd usage. No longer needed.

This commit is contained in:
James Shubin
2016-07-05 06:58:04 -04:00
parent 78d769797f
commit 94b447a9c5
12 changed files with 8 additions and 64 deletions

View File

@@ -32,19 +32,6 @@ if [ $travis -eq 0 ]; then
fi
fi
# build etcd
git clone --recursive https://github.com/coreos/etcd/ && cd etcd
goversion=$(go version)
# if 'go version' contains string 'devel', then use git master of etcd...
if [ "${goversion#*devel}" == "$goversion" ]; then
git checkout v2.2.4 # TODO: update to newer versions as needed
fi
[ -x build ] && ./build
mkdir -p ~/bin/
cp bin/etcd ~/bin/
cd - >/dev/null
rm -rf etcd # clean up to avoid failing on upstream gofmt errors
go get ./... # get all the go dependencies
[ -e "$GOBIN/mgmt" ] && rm -f "$GOBIN/mgmt" # the `go get` version has no -X
# vet is built-in in go 1.6 - we check for go vet command

View File

@@ -27,12 +27,11 @@
:ansible_extras: {}
:cachier: false
:vms:
- :name: etcd
- :name: mgmt0
:shell:
- iptables -F
- cd /vagrant/mgmt/ && make path
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
- etcd -bind-addr "`hostname --ip-address`:2379" &
- cd && mgmt --help
:namespace: omv
:count: 0
@@ -45,8 +44,7 @@
:unsafe: false
:nested: false
:tests:
- omv up etcd
- vssh root@etcd -c pidof etcd
- omv up mgmt0
- omv destroy
:comment: simple hello world test case for mgmt
:reallyrm: false

View File

@@ -32,7 +32,6 @@
- iptables -F
- cd /vagrant/mgmt/ && make path
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
- etcd -bind-addr "`hostname --ip-address`:2379" &
- cd && mgmt run --file /vagrant/mgmt/examples/pkg1.yaml --converged-timeout=5
:namespace: omv
:count: 0

View File

@@ -33,7 +33,6 @@
- iptables -F
- cd /vagrant/mgmt/ && make path
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
- etcd -bind-addr "`hostname --ip-address`:2379" &
- cd && mgmt run --file /vagrant/mgmt/examples/pkg1.yaml --converged-timeout=5
:namespace: omv
:count: 0

View File

@@ -1,23 +0,0 @@
# NOTE: boiler plate to run etcd; source with: . etcd.sh; should NOT be +x
cleanup ()
{
echo "cleanup: $1"
killall etcd || killall -9 etcd || true # kill etcd
rm -rf /tmp/etcd/
}
trap_with_arg() {
func="$1"
shift
for sig in "$@"
do
trap "$func $sig" "$sig"
done
}
trap_with_arg cleanup INT QUIT TERM EXIT # ERR
mkdir -p /tmp/etcd/
cd /tmp/etcd/ >/dev/null # shush the cd operation
etcd & # start etcd as job # 1
sleep 1s # let etcd startup
cd - >/dev/null

View File

@@ -5,7 +5,6 @@
# * it is recommended that you run mgmt with --no-watch
# * it is recommended that you run mgmt --converged-timeout=<seconds>
# * you can run mgmt with --max-runtime=<seconds> in special scenarios
# * you can get a separate etcd going by sourcing etcd.sh: . etcd.sh
set -o errexit
set -o nounset

View File

@@ -6,12 +6,10 @@ if env | grep -q -e '^TRAVIS=true$'; then
exit
fi
. etcd.sh # start etcd as job # 1
# run till completion
timeout --kill-after=15s 10s ./mgmt run --file t2.yaml --converged-timeout=5 --no-watch &
. wait.sh # wait for everything except etcd
. wait.sh # wait for mgmt
test -e /tmp/mgmt/f1
test -e /tmp/mgmt/f2

View File

@@ -6,8 +6,6 @@ if env | grep -q -e '^TRAVIS=true$'; then
exit
fi
. etcd.sh # start etcd as job # 1
# setup
mkdir -p "${MGMT_TMPDIR}"mgmt{A..C}
@@ -16,7 +14,7 @@ timeout --kill-after=15s 10s ./mgmt run --file t3-a.yaml --converged-timeout=5 -
timeout --kill-after=15s 10s ./mgmt run --file t3-b.yaml --converged-timeout=5 --no-watch &
timeout --kill-after=15s 10s ./mgmt run --file t3-c.yaml --converged-timeout=5 --no-watch &
. wait.sh # wait for everything except etcd
. wait.sh # wait for mgmt
# A: collected
test -e "${MGMT_TMPDIR}"mgmtA/f3b

View File

@@ -1,10 +1,6 @@
#!/bin/bash -e
. etcd.sh # start etcd as job # 1
# should take slightly more than 25s, but fail if we take 35s)
timeout --kill-after=35s 30s ./mgmt run --file t4.yaml --converged-timeout=5 --no-watch &
#jobs # etcd is 1
#wait -n 2 # wait for mgmt to exit
. wait.sh # wait for everything except etcd
. wait.sh # wait for mgmt

View File

@@ -1,10 +1,6 @@
#!/bin/bash -e
. etcd.sh # start etcd as job # 1
# should take slightly more than 35s, but fail if we take 45s)
timeout --kill-after=45s 40s ./mgmt run --file t5.yaml --converged-timeout=5 --no-watch &
#jobs # etcd is 1
#wait -n 2 # wait for mgmt to exit
. wait.sh # wait for everything except etcd
. wait.sh # wait for mgmt

View File

@@ -6,8 +6,6 @@ if env | grep -q -e '^TRAVIS=true$'; then
exit
fi
. etcd.sh # start etcd as job # 1
# run till completion
timeout --kill-after=20s 15s ./mgmt run --file t6.yaml --no-watch &
sleep 1s # let it converge
@@ -30,4 +28,4 @@ test -e /tmp/mgmt/f2
killall -SIGINT mgmt # send ^C to exit mgmt
. wait.sh # wait for everything except etcd
. wait.sh # wait for mgmt

View File

@@ -1,9 +1,8 @@
# NOTE: boiler plate to wait on mgmt; source with: . wait.sh; should NOT be +x
while test "`jobs -p`" != "" && test "`jobs -p`" != "`pidof etcd`"
while test "`jobs -p`" != ""
do
for j in `jobs -p`
do
[ "$j" = "`pidof etcd`" ] && continue # don't wait for etcd
wait $j || continue # wait for mgmt job $j
done
done