Rename Smaug DevStack to Karbor

Smaug has been renamed to Karbor.
Adjust DevStack accordingly.

Change-Id: I521cfa3cf71391c346952c9206a09616256616e3
This commit is contained in:
xiangxinyong 2016-08-12 08:53:56 +08:00 committed by Yuval Brik
parent c8cc93fae6
commit 73cd969579
4 changed files with 101 additions and 101 deletions

View File

@ -14,7 +14,7 @@
# This script is executed in the OpenStack CI job that runs DevStack + tempest.
# It is also used by the rally job. You can find the CI job configuration here:
#
# http://git.openstack.org/cgit/openstack-infra/project-config/tree/jenkins/jobs/smaug.yaml
# http://git.openstack.org/cgit/openstack-infra/project-config/tree/jenkins/jobs/karbor.yaml
#
s=rabbit,mysql,key
@ -28,11 +28,11 @@ s+=,cinder,g-api,g-reg
s+=,c-api,c-vol,c-sch,c-bak,horizon
s+=,s-proxy,s-object,s-container,s-account
s+=,h-eng,h-api,h-api-cfn,h-api-cw
s+=,smaug,smaug-api,smaug-operationengine,smaug-protection
s+=,karbor,karbor-api,karbor-operationengine,karbor-protection
ENABLED_SERVICES=$s
export ENABLED_SERVICES
DEVSTACK_LOCAL_CONFIG+="enable_plugin smaug git://git.openstack.org/openstack/smaug"
DEVSTACK_LOCAL_CONFIG+="enable_plugin karbor git://git.openstack.org/openstack/smaug"
DEVSTACK_LOCAL_CONFIG+=$'\n'"SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5"
DEVSTACK_LOCAL_CONFIG+=$'\n'"SWIFT_REPLICAS=1"
DEVSTACK_LOCAL_CONFIG+=$'\n'"SWIFT_DATA_DIR=$DEST/data"

View File

@ -7,8 +7,8 @@ SERVICE_PASSWORD=password
SERVICE_TOKEN=password
ADMIN_PASSWORD=password
enable_plugin smaug http://git.openstack.org/openstack/smaug master
enable_plugin smaug-dashboard http://git.openstack.org/openstack/smaug-dashboard master
enable_plugin karbor http://git.openstack.org/openstack/smaug master
enable_plugin karbor-dashboard http://git.openstack.org/openstack/smaug-dashboard master
#run the services you want to use
ENABLED_SERVICES=rabbit,mysql,key
@ -18,13 +18,13 @@ ENABLED_SERVICES+=,cinder,g-api,g-reg
ENABLED_SERVICES+=,c-api,c-vol,c-sch,c-bak,horizon
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
#Add the smaug services
enable_service smaug-api
enable_service smaug-operationengine
enable_service smaug-protection
#Add the karbor services
enable_service karbor-api
enable_service karbor-operationengine
enable_service karbor-protection
#Add the smaug-dashboard services
enable_service smaug-dashboard
#Add the karbor-dashboard services
enable_service karbor-dashboard
#disable the default services you don't want to use
disable_service n-net

View File

@ -1,147 +1,147 @@
# Devstack extras script to install Smaug
# Devstack extras script to install Karbor
# Test if any smaug services are enabled
# is_smaug_enabled
function is_smaug_enabled {
echo "Checking if Smaug is Enabled"
[[ ,${ENABLED_SERVICES} =~ ,"smaug-" ]] && Q_ENABLE_SMAUG="False"
Q_ENABLE_SMAUG="True"
# Test if any karbor services are enabled
# is_karbor_enabled
function is_karbor_enabled {
echo "Checking if Karbor is Enabled"
[[ ,${ENABLED_SERVICES} =~ ,"karbor-" ]] && Q_ENABLE_KARBOR="False"
Q_ENABLE_KARBOR="True"
}
function _create_smaug_conf_dir {
function _create_karbor_conf_dir {
# Put config files in ``SMAUG_CONF_DIR`` for everyone to find
# Put config files in ``KARBOR_CONF_DIR`` for everyone to find
sudo install -d -o $STACK_USER $SMAUG_CONF_DIR
sudo install -d -o $STACK_USER $KARBOR_CONF_DIR
}
# create_smaug_accounts() - Set up common required smaug accounts
# create_karbor_accounts() - Set up common required karbor accounts
# Tenant User Roles
# ------------------------------------------------------------------
# service smaug service
function create_smaug_accounts {
# service karbor service
function create_karbor_accounts {
if is_service_enabled smaug-api; then
if is_service_enabled karbor-api; then
create_service_user "smaug" "admin"
create_service_user "karbor" "admin"
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
get_or_create_service "smaug" "data-protect" "Application Data Protection Service"
get_or_create_service "karbor" "data-protect" "Application Data Protection Service"
get_or_create_endpoint "data-protect" "$REGION_NAME" \
"$SMAUG_API_PROTOCOL://$SMAUG_API_HOST:$SMAUG_API_PORT/v1/\$(tenant_id)s" \
"$SMAUG_API_PROTOCOL://$SMAUG_API_HOST:$SMAUG_API_PORT/v1/\$(tenant_id)s" \
"$SMAUG_API_PROTOCOL://$SMAUG_API_HOST:$SMAUG_API_PORT/v1/\$(tenant_id)s"
"$KARBOR_API_PROTOCOL://$KARBOR_API_HOST:$KARBOR_API_PORT/v1/\$(tenant_id)s" \
"$KARBOR_API_PROTOCOL://$KARBOR_API_HOST:$KARBOR_API_PORT/v1/\$(tenant_id)s" \
"$KARBOR_API_PROTOCOL://$KARBOR_API_HOST:$KARBOR_API_PORT/v1/\$(tenant_id)s"
fi
fi
}
function configure_smaug_api {
if is_service_enabled smaug-api ; then
echo "Configuring Smaug API"
function configure_karbor_api {
if is_service_enabled karbor-api ; then
echo "Configuring Karbor API"
cp $SMAUG_DIR/etc/smaug.conf $SMAUG_API_CONF
cp $SMAUG_DIR/etc/api-paste.ini $SMAUG_CONF_DIR
cp $SMAUG_DIR/etc/policy.json $SMAUG_CONF_DIR
cp -R $SMAUG_DIR/etc/providers.d $SMAUG_CONF_DIR
cp $KARBOR_DIR/etc/karbor.conf $KARBOR_API_CONF
cp $KARBOR_DIR/etc/api-paste.ini $KARBOR_CONF_DIR
cp $KARBOR_DIR/etc/policy.json $KARBOR_CONF_DIR
cp -R $KARBOR_DIR/etc/providers.d $KARBOR_CONF_DIR
iniset $SMAUG_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
iniset $SMAUG_API_CONF DEFAULT use_syslog $SYSLOG
echo "Configuring Smaug API Database"
iniset $SMAUG_API_CONF database connection `database_connection_url smaug`
iniset_rpc_backend smaug $SMAUG_API_CONF
iniset $KARBOR_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
iniset $KARBOR_API_CONF DEFAULT use_syslog $SYSLOG
echo "Configuring Karbor API Database"
iniset $KARBOR_API_CONF database connection `database_connection_url karbor`
iniset_rpc_backend karbor $KARBOR_API_CONF
setup_colorized_logging $SMAUG_API_CONF DEFAULT
echo "Configuring Smaug API colorized"
setup_colorized_logging $KARBOR_API_CONF DEFAULT
echo "Configuring Karbor API colorized"
if is_service_enabled keystone; then
echo "Configuring Smaug keystone Auth"
create_smaug_cache_dir
echo "Configuring Karbor keystone Auth"
create_karbor_cache_dir
# Configure auth token middleware
configure_auth_token_middleware $SMAUG_API_CONF smaug \
$SMAUG_AUTH_CACHE_DIR
configure_auth_token_middleware $KARBOR_API_CONF karbor \
$KARBOR_AUTH_CACHE_DIR
# Configure for trustee
iniset $SMAUG_API_CONF trustee auth_type password
iniset $SMAUG_API_CONF trustee auth_url $KEYSTONE_AUTH_URI
iniset $SMAUG_API_CONF trustee username smaug
iniset $SMAUG_API_CONF trustee password $SERVICE_PASSWORD
iniset $SMAUG_API_CONF trustee user_domain_id default
iniset $KARBOR_API_CONF trustee auth_type password
iniset $KARBOR_API_CONF trustee auth_url $KEYSTONE_AUTH_URI
iniset $KARBOR_API_CONF trustee username karbor
iniset $KARBOR_API_CONF trustee password $SERVICE_PASSWORD
iniset $KARBOR_API_CONF trustee user_domain_id default
# Configure for clients_keystone
iniset $SMAUG_API_CONF clients_keystone auth_uri $KEYSTONE_AUTH_URI
iniset $KARBOR_API_CONF clients_keystone auth_uri $KEYSTONE_AUTH_URI
else
iniset $SMAUG_API_CONF DEFAULT auth_strategy noauth
iniset $KARBOR_API_CONF DEFAULT auth_strategy noauth
fi
fi
}
function create_smaug_cache_dir {
function create_karbor_cache_dir {
# Delete existing dir
sudo rm -rf $SMAUG_AUTH_CACHE_DIR
sudo mkdir -p $SMAUG_AUTH_CACHE_DIR
sudo chown `whoami` $SMAUG_AUTH_CACHE_DIR
sudo rm -rf $KARBOR_AUTH_CACHE_DIR
sudo mkdir -p $KARBOR_AUTH_CACHE_DIR
sudo chown `whoami` $KARBOR_AUTH_CACHE_DIR
}
is_smaug_enabled
is_karbor_enabled
if [[ "$Q_ENABLE_SMAUG" == "True" ]]; then
if [[ "$Q_ENABLE_KARBOR" == "True" ]]; then
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
echo summary "Smaug pre-install"
echo summary "Karbor pre-install"
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Smaug"
echo_summary "Installing Karbor"
setup_package $SMAUG_DIR -e
_create_smaug_conf_dir
setup_package $KARBOR_DIR -e
_create_karbor_conf_dir
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring Smaug"
echo_summary "Configuring Karbor"
configure_smaug_api
configure_karbor_api
echo export PYTHONPATH=\$PYTHONPATH:$SMAUG_DIR >> $RC_DIR/.localrc.auto
echo export PYTHONPATH=\$PYTHONPATH:$KARBOR_DIR >> $RC_DIR/.localrc.auto
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Creating Smaug entities for auth service"
create_smaug_accounts
echo_summary "Creating Karbor entities for auth service"
create_karbor_accounts
echo_summary "Initializing Smaug Service"
SMAUG_BIN_DIR=$(get_python_exec_prefix)
echo_summary "Initializing Karbor Service"
KARBOR_BIN_DIR=$(get_python_exec_prefix)
if is_service_enabled $DATABASE_BACKENDS; then
# (re)create smaug database
recreate_database smaug utf8
# (re)create karbor database
recreate_database karbor utf8
# Migrate smaug database
$SMAUG_BIN_DIR/smaug-manage db sync
# Migrate karbor database
$KARBOR_BIN_DIR/karbor-manage db sync
fi
if is_service_enabled smaug-api; then
run_process smaug-api "$SMAUG_BIN_DIR/smaug-api --config-file $SMAUG_API_CONF"
if is_service_enabled karbor-api; then
run_process karbor-api "$KARBOR_BIN_DIR/karbor-api --config-file $KARBOR_API_CONF"
fi
if is_service_enabled smaug-operationengine; then
run_process smaug-operationengine "$SMAUG_BIN_DIR/smaug-operationengine --config-file $SMAUG_API_CONF"
if is_service_enabled karbor-operationengine; then
run_process karbor-operationengine "$KARBOR_BIN_DIR/karbor-operationengine --config-file $KARBOR_API_CONF"
fi
if is_service_enabled smaug-protection; then
run_process smaug-protection "$SMAUG_BIN_DIR/smaug-protection --config-file $SMAUG_API_CONF"
if is_service_enabled karbor-protection; then
run_process karbor-protection "$KARBOR_BIN_DIR/karbor-protection --config-file $KARBOR_API_CONF"
fi
fi
if [[ "$1" == "unstack" ]]; then
if is_service_enabled smaug-api; then
stop_process smaug-api
if is_service_enabled karbor-api; then
stop_process karbor-api
fi
if is_service_enabled smaug-operationengine; then
stop_process smaug-operationengine
if is_service_enabled karbor-operationengine; then
stop_process karbor-operationengine
fi
if is_service_enabled smaug-protection; then
stop_process smaug-protection
if is_service_enabled karbor-protection; then
stop_process karbor-protection
fi
fi
fi

View File

@ -1,20 +1,20 @@
# Git information
SMAUG_REPO=${SMAUG_REPO:-https://git.openstack.org/cgit/openstack/smaug/}
SMAUG_DIR=$DEST/smaug
SMAUG_BRANCH=${SMAUG_BRANCH:-master}
KARBOR_REPO=${KARBOR_REPO:-https://git.openstack.org/cgit/openstack/smaug/}
KARBOR_DIR=$DEST/karbor
KARBOR_BRANCH=${KARBOR_BRANCH:-master}
# common variables
SMAUG_CONF_DIR=${SMAUG_CONF_DIR:-/etc/smaug}
KARBOR_CONF_DIR=${KARBOR_CONF_DIR:-/etc/karbor}
# smaug rest api
SMAUG_API=$SMAUG_DIR/smaug/cmd/api.py
SMAUG_API_CONF=$SMAUG_CONF_DIR/smaug.conf
# karbor rest api
KARBOR_API=$KARBOR_DIR/karbor/cmd/api.py
KARBOR_API_CONF=$KARBOR_CONF_DIR/karbor.conf
SMAUG_API_LISTEN_ADDRESS=${SMAUG_API_LISTEN_ADDRESS:-0.0.0.0}
SMAUG_API_HOST=${SMAUG_API_HOST:-$SERVICE_HOST}
SMAUG_API_PORT=${SMAUG_API_PORT:-8799}
SMAUG_API_PROTOCOL=${SMAUG_API_PROTOCOL:-$SERVICE_PROTOCOL}
KARBOR_API_LISTEN_ADDRESS=${KARBOR_API_LISTEN_ADDRESS:-0.0.0.0}
KARBOR_API_HOST=${KARBOR_API_HOST:-$SERVICE_HOST}
KARBOR_API_PORT=${KARBOR_API_PORT:-8799}
KARBOR_API_PROTOCOL=${KARBOR_API_PROTOCOL:-$SERVICE_PROTOCOL}
SMAUG_AUTH_CACHE_DIR=${SMAUG_AUTH_CACHE_DIR:-/var/cache/smaug}
KARBOR_AUTH_CACHE_DIR=${KARBOR_AUTH_CACHE_DIR:-/var/cache/karbor}
export PYTHONPATH=$PYTHONPATH:$SMAUG_DIR
export PYTHONPATH=$PYTHONPATH:$KARBOR_DIR