Switch to devstack for installing etcd

ETCD is now a base service [1], which means it will be installed by
default in devstack. We don't need to re-install it in our devstack
plugin.

[1] https://review.openstack.org/#/c/445432/

Change-Id: I7d51c09978a1e6142efe03a32d25e6ead5479257
This commit is contained in:
Hongbin Lu 2017-06-03 11:25:47 -04:00
parent 2cba409c63
commit 4f06d6da92
2 changed files with 2 additions and 23 deletions

View File

@ -15,22 +15,8 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
ETCD_VERSION=v2.2.2
FUXI_BIN_DIR=$(get_python_exec_prefix)
function install_etcd_data_store {
if [ ! -f "$DEST/etcd/etcd-$ETCD_VERSION-linux-amd64/etcd" ]; then
echo "Installing etcd server"
mkdir $DEST/etcd
wget https://github.com/coreos/etcd/releases/download/$ETCD_VERSION/etcd-$ETCD_VERSION-linux-amd64.tar.gz -O $DEST/etcd/etcd-$ETCD_VERSION-linux-amd64.tar.gz
tar xzvf $DEST/etcd/etcd-$ETCD_VERSION-linux-amd64.tar.gz -C $DEST/etcd
fi
# Clean previous DB data
rm -rf $DEST/etcd/db.etcd
}
function check_docker {
if is_ubuntu; then
dpkg -s docker-engine > /dev/null 2>&1
@ -83,7 +69,6 @@ if is_service_enabled fuxi; then
git_clone_by_name "kuryr"
setup_dev_lib "kuryr"
fi
install_etcd_data_store
setup_develop $FUXI_HOME
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
@ -103,9 +88,6 @@ if is_service_enabled fuxi; then
create_fuxi_account
configure_fuxi
# Run etcd first
pgrep -x "etcd" >/dev/null || run_process etcd-server "$DEST/etcd/etcd-$ETCD_VERSION-linux-amd64/etcd --data-dir $DEST/etcd/db.etcd --advertise-client-urls http://0.0.0.0:$FUXI_ETCD_PORT --listen-client-urls http://0.0.0.0:$FUXI_ETCD_PORT"
# FIXME(mestery): By default, Ubuntu ships with /bin/sh pointing to
# the dash shell.
# ..
@ -133,7 +115,7 @@ if is_service_enabled fuxi; then
# After an ./unstack it will be stopped. So it is ok if it returns exit-code == 1
sudo service docker stop || true
run_process docker-engine "/usr/bin/docker daemon -H unix://$FUXI_DOCKER_ENGINE_SOCKET_FILE -H tcp://0.0.0.0:$FUXI_DOCKER_ENGINE_PORT --cluster-store etcd://localhost:$FUXI_ETCD_PORT" "" "root"
run_process docker-engine "/usr/bin/docker daemon -H unix://$FUXI_DOCKER_ENGINE_SOCKET_FILE -H tcp://0.0.0.0:$FUXI_DOCKER_ENGINE_PORT --cluster-store etcd://localhost:2379" "" "root"
# We put the stack user as owner of the socket so we do not need to
# run the Docker commands with sudo when developing.
@ -160,8 +142,6 @@ if is_service_enabled fuxi; then
if [[ "$1" == "unstack" ]]; then
stop_process fuxi-server
stop_process etcd-server
rm -rf $DEST/etcd/
stop_process docker-engine
# Stop process does not handle well Docker 1.12+ new multi process
# split and doesn't kill them all. Let's leverage Docker's own pidfile

View File

@ -15,11 +15,10 @@ FUXI_AUTH_CACHE_DIR=${FUXI_AUTH_CACHE_DIR:-/var/cache/fuxi}
FUXI_DOCKER_ENGINE_PORT=${FUXI_DOCKER_ENGINE_PORT:-2375}
FUXI_DOCKER_ENGINE_SOCKET_FILE=${FUXI_DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock}
FUXI_ETCD_PORT=${FUXI_ETCD_PORT:-4001}
FUXI_VOLUME_PROVIDERS=${FUXI_VOLUME_PROVIDERS:-cinder,manila}
GITREPO["kuryr"]=${KURYR_REPO:-${GIT_BASE}/openstack/kuryr.git}
GITBRANCH["kuryr"]=${KURYR_BRANCH:-master}
GITDIR["kuryr"]=$DEST/kuryr
enable_service fuxi etcd-server docker-engine
enable_service fuxi etcd3 docker-engine