Devstack scripts update for configuration and kb_engine
After some configuration changed, especially endpoint cache configuration, and with JW and JD replaced to kb-engine, the devstack scripts should be updated too. The database is re-created and sync-ed through cmd/manage.py Needs the patch https://review.openstack.org/#/c/305593/ to be merged for the devstack to work. bug: https://bugs.launchpad.net/kingbird/+bug/1569136 Change-Id: If92396b1620c06fe14b6ee8f8fd26a07f57fd276 Signed-off-by: Chaoyi Huang <joehuang@huawei.com>
This commit is contained in:
@@ -32,9 +32,8 @@ Q_ENABLE_KINGBIRD=True
|
||||
enable_plugin kingbird https://git.openstack.org/openstack/kingbird master
|
||||
|
||||
# Kingbird Services
|
||||
enable_service kb-jw
|
||||
enable_service kb-jd
|
||||
enable_service kb-api
|
||||
enable_service kb-engine
|
||||
|
||||
# Use Neutron instead of nova-network
|
||||
disable_service n-net
|
||||
@@ -49,3 +48,4 @@ disable_service c-vol
|
||||
disable_service c-bak
|
||||
disable_service c-sch
|
||||
disable_service cinder
|
||||
disable_service horizon
|
||||
|
||||
@@ -39,28 +39,42 @@ function create_kingbird_cache_dir {
|
||||
|
||||
}
|
||||
|
||||
# init common config-file configuration for kingbird services
|
||||
# in devstack
|
||||
# generally the configuration sample file will be generated by
|
||||
# tox -egen-config
|
||||
function init_common_kingbird_conf {
|
||||
local conf_file=$1
|
||||
|
||||
touch $conf_file
|
||||
iniset $conf_file DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
||||
iniset $conf_file DEFAULT verbose True
|
||||
iniset $conf_file DEFAULT use_syslog $SYSLOG
|
||||
|
||||
iniset $conf_file auth_url http://127.0.0.1:5000/v3
|
||||
iniset $conf_file identity_url http://127.0.0.1:35357/v3
|
||||
iniset $conf_file cache admin_username admin
|
||||
iniset $conf_file cache admin_password $ADMIN_PASSWORD
|
||||
iniset $conf_file cache admin_tenant admin
|
||||
|
||||
iniset $conf_file database connection `database_connection_url kingbird`
|
||||
}
|
||||
|
||||
function configure_kingbird_api {
|
||||
echo "Configuring kingbird api service"
|
||||
|
||||
if is_service_enabled kb-api ; then
|
||||
cp -p $KINGBIRD_DIR/etc/api.conf $KINGBIRD_API_CONF
|
||||
iniset $KINGBIRD_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
||||
iniset $KINGBIRD_API_CONF DEFAULT verbose True
|
||||
iniset $KINGBIRD_API_CONF DEFAULT use_syslog $SYSLOG
|
||||
|
||||
setup_colorized_logging $KINGBIRD_API_CONF DEFAULT
|
||||
|
||||
if is_service_enabled keystone; then
|
||||
|
||||
create_kingbird_cache_dir
|
||||
|
||||
# Configure auth token middleware
|
||||
configure_auth_token_middleware $KINGBIRD_API_CONF kingbird \
|
||||
configure_auth_token_middleware $KINGBIRD_CONF kingbird \
|
||||
$KINGBIRD_AUTH_CACHE_DIR
|
||||
|
||||
else
|
||||
iniset $KINGBIRD_API_CONF DEFAULT auth_strategy noauth
|
||||
iniset $KINGBIRD_CONF DEFAULT auth_strategy noauth
|
||||
fi
|
||||
|
||||
fi
|
||||
@@ -71,12 +85,9 @@ function configure_kingbird_engine {
|
||||
echo "Configuring kingbird engine service"
|
||||
|
||||
if is_service_enabled kb-engine ; then
|
||||
cp -p $KINGBIRD_DIR/etc/engine.conf $KINGBIRD_ENGINE_CONF
|
||||
iniset $KINGBIRD_ENGINE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
||||
iniset $KINGBIRD_ENGINE_CONF DEFAULT verbose True
|
||||
iniset $KINGBIRD_ENGINE_CONF DEFAULT use_syslog $SYSLOG
|
||||
|
||||
setup_colorized_logging $KINGBIRD_ENIGNE_CONF DEFAULT
|
||||
# put additional kb-engine configuration here
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -95,26 +106,29 @@ if [[ "$Q_ENABLE_KINGBIRD" == "True" ]]; then
|
||||
|
||||
sudo install -d -o $STACK_USER -m 755 $KINGBIRD_CONF_DIR
|
||||
|
||||
init_common_kingbird_conf $KINGBIRD_CONF
|
||||
|
||||
configure_kingbird_api
|
||||
configure_kingbird_engine
|
||||
|
||||
echo export PYTHONPATH=\$PYTHONPATH:$KINGBIRD_DIR >> $RC_DIR/.localrc.auto
|
||||
|
||||
recreate_database kingbird
|
||||
# python "$KINGBIRD_DIR/cmd/manage.py" "$KINGBIRD_CONF"
|
||||
python "$KINGBIRD_DIR/kingbird/cmd/manage.py" \
|
||||
"--config-file=$KINGBIRD_CONF" db_sync
|
||||
|
||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||
echo_summary "Initializing Kingbird Service"
|
||||
|
||||
if is_service_enabled kb-engine; then
|
||||
run_process kb-engine "python $KINGBIRD_ENGINE --config-file=$KINGBIRD_ENGINE_CONF"
|
||||
run_process kb-engine "python $KINGBIRD_ENGINE --config-file=$KINGBIRD_CONF"
|
||||
fi
|
||||
|
||||
if is_service_enabled kb-api; then
|
||||
|
||||
create_kingbird_accounts
|
||||
|
||||
run_process kb-api "python $KINGBIRD_API --config-file $KINGBIRD_API_CONF"
|
||||
run_process kb-api "python $KINGBIRD_API --config-file $KINGBIRD_CONF"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -5,21 +5,14 @@ KINGBIRD_BRANCH=${KINGBIRD_BRANCH:-master}
|
||||
|
||||
# common variables
|
||||
KINGBIRD_CONF_DIR=${KINGBIRD_CONF_DIR:-/etc/kingbird}
|
||||
KINGBIRD_CONF=$KINGBIRD_CONF_DIR/kingbird.conf
|
||||
|
||||
# kingbird jw service
|
||||
KINGBIRD_JW_SERVICE=$KINGBIRD_DIR/cmd/jobworker.py
|
||||
KINGBIRD_JW_CONF=$KINGBIRD_CONF_DIR/jobworker.conf
|
||||
KINGBIRD_JW_LISTEN_ADDRESS=${KINGBIRD_JW_LISTEN_ADDRESS:-0.0.0.0}
|
||||
|
||||
# kingbird jd service
|
||||
KINGBIRD_JD_SERVICE=$KINGBIRD_DIR/cmd/jobdaemon.py
|
||||
KINGBIRD_JD_CONF=$KINGBIRD_CONF_DIR/jobdaemon.conf
|
||||
KINGBIRD_JD_LISTEN_ADDRESS=${KINGBIRD_JD_LISTEN_ADDRESS:-0.0.0.0}
|
||||
# kingbird engine service
|
||||
KINGBIRD_ENGINE=$KINGBIRD_DIR/kingbird/cmd/engine.py
|
||||
KINGBIRD_ENGINE_LISTEN_ADDRESS=${KINGBIRD_JD_LISTEN_ADDRESS:-0.0.0.0}
|
||||
|
||||
# Kingbird rest api
|
||||
KINGBIRD_API=$KINGBIRD_DIR/cmd/api.py
|
||||
KINGBIRD_API_CONF=$KINGBIRD_CONF_DIR/api.conf
|
||||
|
||||
KINGBIRD_API=$KINGBIRD_DIR/kingbird/cmd/api.py
|
||||
KINGBIRD_API_LISTEN_ADDRESS=${KINGBIRD_API_LISTEN_ADDRESS:-0.0.0.0}
|
||||
KINGBIRD_API_HOST=${KINGBIRD_API_HOST:-$SERVICE_HOST}
|
||||
KINGBIRD_API_PORT=${KINGBIRD_API_PORT:-8118}
|
||||
|
||||
Reference in New Issue
Block a user