Remove Zaqar from devstack

Zaqar's devstack code has been moved into a plugin in the Zaqar repo.
This patch removes the remaining code from devstack.

Depends-On: Iceefabb6cd528b23075a91e8039b8264eb3f33f5
Change-Id: Ifcf54fa2d4a5bf49b6757b593bb70cdeda8edb2a
This commit is contained in:
Flavio Percoco 2015-04-30 08:54:15 +02:00
parent c00e39901b
commit 624ab1e65d
7 changed files with 2 additions and 310 deletions

View File

@ -173,7 +173,7 @@ Scripts
* `lib/swift <lib/swift.html>`__
* `lib/tempest <lib/tempest.html>`__
* `lib/tls <lib/tls.html>`__
* `lib/zaqar <lib/zaqar.html>`__
* `lib/trove <lib/trove.html>`__
* `unstack.sh <unstack.sh.html>`__
* `clean.sh <clean.sh.html>`__
* `run\_tests.sh <run_tests.sh.html>`__
@ -181,7 +181,6 @@ Scripts
* `extras.d/50-ironic.sh <extras.d/50-ironic.sh.html>`__
* `extras.d/60-ceph.sh <extras.d/60-ceph.sh.html>`__
* `extras.d/70-tuskar.sh <extras.d/70-tuskar.sh.html>`__
* `extras.d/70-zaqar.sh <extras.d/70-zaqar.sh.html>`__
* `extras.d/80-tempest.sh <extras.d/80-tempest.sh.html>`__
* `inc/ini-config <inc/ini-config.html>`__
@ -239,4 +238,3 @@ Exercises
* `exercises/sec\_groups.sh <exercises/sec_groups.sh.html>`__
* `exercises/swift.sh <exercises/swift.sh.html>`__
* `exercises/volumes.sh <exercises/volumes.sh.html>`__
* `exercises/zaqar.sh <exercises/zaqar.sh.html>`__

View File

@ -1,43 +0,0 @@
#!/usr/bin/env bash
# **zaqar.sh**
# Sanity check that Zaqar started if enabled
echo "*********************************************************************"
echo "Begin DevStack Exercise: $0"
echo "*********************************************************************"
# This script exits on an error so that errors don't compound and you see
# only the first error that occurred.
set -o errexit
# Print the commands being run so that we can see the command that triggers
# an error. It is also useful for following allowing as the install occurs.
set -o xtrace
# Settings
# ========
# Keep track of the current directory
EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
# Import common functions
source $TOP_DIR/functions
# Import configuration
source $TOP_DIR/openrc
# Import exercise configuration
source $TOP_DIR/exerciserc
is_service_enabled zaqar-server || exit 55
$CURL_GET http://$SERVICE_HOST:8888/v1/ 2>/dev/null | grep -q 'queue_name' || die $LINENO "Zaqar API not functioning!"
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
echo "*********************************************************************"

View File

@ -1,29 +0,0 @@
# zaqar.sh - Devstack extras script to install Zaqar
if is_service_enabled zaqar-server; then
if [[ "$1" == "source" ]]; then
# Initial source
source $TOP_DIR/lib/zaqar
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Zaqar"
install_zaqarclient
install_zaqar
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring Zaqar"
configure_zaqar
configure_zaqarclient
if is_service_enabled key; then
create_zaqar_accounts
fi
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Initializing Zaqar"
init_zaqar
start_zaqar
fi
if [[ "$1" == "unstack" ]]; then
stop_zaqar
fi
fi

View File

@ -1,4 +0,0 @@
python-pymongo
mongodb-server
pkg-config
redis-server # NOPRIME

View File

@ -1,5 +0,0 @@
selinux-policy-targeted
mongodb
mongodb-server
pymongo
redis # NOPRIME

View File

@ -550,7 +550,7 @@ function configure_tempest {
# this tempest service list needs to be all the services that
# tempest supports, otherwise we can have an erroneous set of
# defaults (something defaulting true in Tempest, but not listed here).
TEMPEST_SERVICES="key,glance,nova,neutron,cinder,swift,heat,ceilometer,horizon,sahara,ironic,trove,zaqar"
TEMPEST_SERVICES="key,glance,nova,neutron,cinder,swift,heat,ceilometer,horizon,sahara,ironic,trove"
for service in ${TEMPEST_SERVICES//,/ }; do
if is_service_enabled $service ; then
iniset $TEMPEST_CONFIG service_available $service "True"

225
lib/zaqar
View File

@ -1,225 +0,0 @@
#!/bin/bash
#
# lib/zaqar
# Install and start **Zaqar** service
# To enable a minimal set of Zaqar services, add the following to localrc:
#
# enable_service zaqar-server
#
# Dependencies:
# - functions
# - OS_AUTH_URL for auth in api
# - DEST set to the destination directory
# - SERVICE_PASSWORD, SERVICE_TENANT_NAME for auth in api
# - STACK_USER service user
# stack.sh
# ---------
# install_zaqar
# configure_zaqar
# init_zaqar
# start_zaqar
# stop_zaqar
# cleanup_zaqar
# cleanup_zaqar_mongodb
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
# Set up default directories
ZAQAR_DIR=$DEST/zaqar
ZAQARCLIENT_DIR=$DEST/python-zaqarclient
ZAQAR_CONF_DIR=/etc/zaqar
ZAQAR_CONF=$ZAQAR_CONF_DIR/zaqar.conf
ZAQAR_AUTH_CACHE_DIR=${ZAQAR_AUTH_CACHE_DIR:-/var/cache/zaqar}
# Support potential entry-points console scripts
ZAQAR_BIN_DIR=$(get_python_exec_prefix)
# Set up database backend
ZAQAR_BACKEND=${ZAQAR_BACKEND:-mongodb}
# Set Zaqar repository
ZAQAR_REPO=${ZAQAR_REPO:-${GIT_BASE}/openstack/zaqar.git}
ZAQAR_BRANCH=${ZAQAR_BRANCH:-master}
# Set client library repository
ZAQARCLIENT_REPO=${ZAQARCLIENT_REPO:-${GIT_BASE}/openstack/python-zaqarclient.git}
ZAQARCLIENT_BRANCH=${ZAQARCLIENT_BRANCH:-master}
# Set Zaqar Connection Info
ZAQAR_SERVICE_HOST=${ZAQAR_SERVICE_HOST:-$SERVICE_HOST}
ZAQAR_SERVICE_PORT=${ZAQAR_SERVICE_PORT:-8888}
ZAQAR_SERVICE_PROTOCOL=${ZAQAR_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
# Functions
# ---------
# Test if any Zaqar services are enabled
# is_zaqar_enabled
function is_zaqar_enabled {
[[ ,${ENABLED_SERVICES} =~ ,"zaqar-" ]] && return 0
return 1
}
# cleanup_zaqar() - Cleans up general things from previous
# runs and storage specific left overs.
function cleanup_zaqar {
if [ "$ZAQAR_BACKEND" = 'mongodb' ] ; then
cleanup_zaqar_mongodb
fi
}
# cleanup_zaqar_mongodb() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_zaqar_mongodb {
if ! timeout $SERVICE_TIMEOUT sh -c "while ! mongo zaqar --eval 'db.dropDatabase();'; do sleep 1; done"; then
die $LINENO "Mongo DB did not start"
else
full_version=$(mongo zaqar --eval 'db.dropDatabase();')
mongo_version=`echo $full_version | cut -d' ' -f4`
required_mongo_version='2.2'
if [[ $mongo_version < $required_mongo_version ]]; then
die $LINENO "Zaqar needs Mongo DB version >= 2.2 to run."
fi
fi
}
# configure_zaqarclient() - Set config files, create data dirs, etc
function configure_zaqarclient {
setup_develop $ZAQARCLIENT_DIR
}
# configure_zaqar() - Set config files, create data dirs, etc
function configure_zaqar {
setup_develop $ZAQAR_DIR
sudo install -d -o $STACK_USER -m 755 $ZAQAR_CONF_DIR
iniset $ZAQAR_CONF DEFAULT debug True
iniset $ZAQAR_CONF DEFAULT verbose True
iniset $ZAQAR_CONF DEFAULT admin_mode True
iniset $ZAQAR_CONF DEFAULT use_syslog $SYSLOG
iniset $ZAQAR_CONF 'drivers:transport:wsgi' bind $ZAQAR_SERVICE_HOST
configure_auth_token_middleware $ZAQAR_CONF zaqar $ZAQAR_AUTH_CACHE_DIR
if [ "$ZAQAR_BACKEND" = 'mysql' ] || [ "$ZAQAR_BACKEND" = 'postgresql' ] ; then
iniset $ZAQAR_CONF drivers storage sqlalchemy
iniset $ZAQAR_CONF 'drivers:storage:sqlalchemy' uri `database_connection_url zaqar`
elif [ "$ZAQAR_BACKEND" = 'mongodb' ] ; then
iniset $ZAQAR_CONF drivers storage mongodb
iniset $ZAQAR_CONF 'drivers:storage:mongodb' uri mongodb://localhost:27017/zaqar
configure_mongodb
elif [ "$ZAQAR_BACKEND" = 'redis' ] ; then
iniset $ZAQAR_CONF drivers storage redis
iniset $ZAQAR_CONF 'drivers:storage:redis' uri redis://localhost:6379
configure_redis
fi
iniset $ZAQAR_CONF DEFAULT notification_driver messaging
iniset $ZAQAR_CONF DEFAULT control_exchange zaqar
iniset_rpc_backend zaqar $ZAQAR_CONF
cleanup_zaqar
}
function configure_redis {
if is_ubuntu; then
install_package redis-server
pip_install_gr redis
elif is_fedora; then
install_package redis
pip_install_gr redis
else
exit_distro_not_supported "redis installation"
fi
}
function configure_mongodb {
# Set nssize to 2GB. This increases the number of namespaces supported
# # per database.
if is_ubuntu; then
sudo sed -i -e "
s|[^ \t]*#[ \t]*\(nssize[ \t]*=.*\$\)|\1|
s|^\(nssize[ \t]*=[ \t]*\).*\$|\1 2047|
" /etc/mongodb.conf
restart_service mongodb
elif is_fedora; then
sudo sed -i '/--nssize/!s/OPTIONS=\"/OPTIONS=\"--nssize 2047 /' /etc/sysconfig/mongod
restart_service mongod
fi
}
# init_zaqar() - Initialize etc.
function init_zaqar {
# Create cache dir
sudo install -d -o $STACK_USER $ZAQAR_AUTH_CACHE_DIR
rm -f $ZAQAR_AUTH_CACHE_DIR/*
}
# install_zaqar() - Collect source and prepare
function install_zaqar {
git_clone $ZAQAR_REPO $ZAQAR_DIR $ZAQAR_BRANCH
setup_develop $ZAQAR_DIR
}
# install_zaqarclient() - Collect source and prepare
function install_zaqarclient {
git_clone $ZAQARCLIENT_REPO $ZAQARCLIENT_DIR $ZAQARCLIENT_BRANCH
setup_develop $ZAQARCLIENT_DIR
}
# start_zaqar() - Start running processes, including screen
function start_zaqar {
if [[ "$USE_SCREEN" = "False" ]]; then
run_process zaqar-server "zaqar-server --config-file $ZAQAR_CONF --daemon"
else
run_process zaqar-server "zaqar-server --config-file $ZAQAR_CONF"
fi
echo "Waiting for Zaqar to start..."
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $ZAQAR_SERVICE_PROTOCOL://$ZAQAR_SERVICE_HOST:$ZAQAR_SERVICE_PORT/v1/health; do sleep 1; done"; then
die $LINENO "Zaqar did not start"
fi
}
# stop_zaqar() - Stop running processes
function stop_zaqar {
local serv
# Kill the zaqar screen windows
for serv in zaqar-server; do
screen -S $SCREEN_NAME -p $serv -X kill
done
}
function create_zaqar_accounts {
create_service_user "zaqar"
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
get_or_create_service "zaqar" "messaging" "Zaqar Service"
get_or_create_endpoint "messaging" \
"$REGION_NAME" \
"$ZAQAR_SERVICE_PROTOCOL://$ZAQAR_SERVICE_HOST:$ZAQAR_SERVICE_PORT" \
"$ZAQAR_SERVICE_PROTOCOL://$ZAQAR_SERVICE_HOST:$ZAQAR_SERVICE_PORT" \
"$ZAQAR_SERVICE_PROTOCOL://$ZAQAR_SERVICE_HOST:$ZAQAR_SERVICE_PORT"
fi
}
# Restore xtrace
$XTRACE
# Local variables:
# mode: shell-script
# End: