Remove cloudwatch service from devstack plugin

Change-Id: Ie18d80e8faaec984b127ab3abeeb66d6a3aa1b6c
This commit is contained in:
rabi 2017-10-24 10:23:38 +05:30
parent b360e3fcaf
commit f2b4c983d3
5 changed files with 18 additions and 41 deletions

View File

@ -5,7 +5,7 @@
# To enable, add the following to localrc
#
# ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
# ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-eng
# Dependencies:
# (none)
@ -63,10 +63,8 @@ HEAT_TRUSTEE_DOMAIN=${HEAT_TRUSTEE_DOMAIN:-default}
HEAT_BIN_DIR=$(get_python_exec_prefix)
HEAT_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-uwsgi.ini
HEAT_CFN_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-cfn-uwsgi.ini
HEAT_CW_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch-uwsgi.ini
HEAT_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api
HEAT_CFN_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api-cfn
HEAT_CW_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api-cloudwatch
# other default options
if [[ "$HEAT_STANDALONE" == "True" ]]; then
@ -119,8 +117,6 @@ function configure_heat {
HEAT_API_CFN_PORT=${HEAT_API_CFN_PORT:-8000}
HEAT_ENGINE_HOST=${HEAT_ENGINE_HOST:-$SERVICE_HOST}
HEAT_ENGINE_PORT=${HEAT_ENGINE_PORT:-8001}
HEAT_API_CW_HOST=${HEAT_API_CW_HOST:-$HOST_IP}
HEAT_API_CW_PORT=${HEAT_API_CW_PORT:-8003}
HEAT_API_PASTE_FILE=$HEAT_CONF_DIR/api-paste.ini
HEAT_POLICY_FILE=$HEAT_CONF_DIR/policy.json
@ -132,11 +128,9 @@ function configure_heat {
if [[ "$HEAT_USE_APACHE" == "True" && "$WSGI_MODE" == "uwsgi" ]]; then
iniset $HEAT_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST/heat-api-cfn
iniset $HEAT_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST/heat-api-cfn/v1/waitcondition
iniset $HEAT_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST/heat-api-cloudwatch
else
iniset $HEAT_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
iniset $HEAT_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
iniset $HEAT_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
fi
iniset $HEAT_CONF database connection `database_connection_url heat`
@ -169,7 +163,6 @@ function configure_heat {
# approximation.
iniset "$HEAT_API_UWSGI_CONF" uwsgi threads 4
write_uwsgi_config "$HEAT_CFN_API_UWSGI_CONF" "$HEAT_CFN_API_UWSGI" "/heat-api-cfn"
write_uwsgi_config "$HEAT_CW_API_UWSGI_CONF" "$HEAT_CW_API_UWSGI" "/heat-api-cloudwatch"
else
_config_heat_apache_wsgi
fi
@ -202,9 +195,6 @@ function configure_heat {
# Cloudformation API
iniset $HEAT_CONF heat_api_cfn bind_port $HEAT_API_CFN_PORT
# Cloudwatch API
iniset $HEAT_CONF heat_api_cloudwatch bind_port $HEAT_API_CW_PORT
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
iniset $HEAT_CONF clients_keystone ca_file $SSL_BUNDLE_FILE
fi
@ -318,29 +308,24 @@ function start_heat {
if [[ -f ${enabled_site_file} && "$WSGI_MODE" != "uwsgi" ]]; then
enable_apache_site heat-api
enable_apache_site heat-api-cfn
enable_apache_site heat-api-cloudwatch
restart_apache_server
tail_log heat-api /var/log/$APACHE_NAME/heat_api.log
tail_log heat-api-access /var/log/$APACHE_NAME/heat_api_access.log
tail_log heat-api-cfn /var/log/$APACHE_NAME/heat_api_cfn.log
tail_log heat-api-cfn-access /var/log/$APACHE_NAME/heat_api_cfn_access.log
tail_log heat-api-cloudwatch /var/log/$APACHE_NAME/heat_api_cloudwatch.log
tail_log heat-api-cloudwatch-access /var/log/$APACHE_NAME/heat_api_cloudwatch_access.log
else
run_process h-api "$HEAT_BIN_DIR/uwsgi --ini $HEAT_API_UWSGI_CONF" ""
run_process h-api-cfn "$HEAT_BIN_DIR/uwsgi --ini $HEAT_CFN_API_UWSGI_CONF" ""
run_process h-api-cw "$HEAT_BIN_DIR/uwsgi --ini $HEAT_CW_API_UWSGI_CONF" ""
fi
else
run_process h-api "$HEAT_BIN_DIR/heat-api --config-file=$HEAT_CONF"
run_process h-api-cfn "$HEAT_BIN_DIR/heat-api-cfn --config-file=$HEAT_CONF"
run_process h-api-cw "$HEAT_BIN_DIR/heat-api-cloudwatch --config-file=$HEAT_CONF"
fi
}
function _stop_processes {
local serv
for serv in h-api h-api-cfn h-api-cw; do
for serv in h-api h-api-cfn; do
stop_process $serv
done
}
@ -356,7 +341,6 @@ function stop_heat {
else
disable_apache_site heat-api
disable_apache_site heat-api-cfn
disable_apache_site heat-api-cloudwatch
restart_apache_server
fi
else
@ -364,16 +348,22 @@ function stop_heat {
fi
}
# TODO(ramishra): Remove after Queens
function stop_cw_service {
if $SYSTEMCTL is-enabled devstack@h-api-cw.service; then
$SYSTEMCTL stop devstack@h-api-cw.service
$SYSTEMCTL disable devstack@h-api-cw.service
fi
}
# _cleanup_heat_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
function _cleanup_heat_apache_wsgi {
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
remove_uwsgi_config "$HEAT_API_UWSGI_CONF" "$HEAT_API_UWSGI"
remove_uwsgi_config "$HEAT_CFN_API_UWSGI_CONF" "$HEAT_CFN_API_UWSGI"
remove_uwsgi_config "$HEAT_CW_API_UWSGI_CONF" "$HEAT_CW_API_UWSGI"
fi
sudo rm -f $(apache_site_config_for heat-api)
sudo rm -f $(apache_site_config_for heat-api-cfn)
sudo rm -f $(apache_site_config_for heat-api-cloudwatch)
}
# _config_heat_apache_wsgi() - Set WSGI config files of Heat
@ -383,14 +373,11 @@ function _config_heat_apache_wsgi {
heat_apache_conf=$(apache_site_config_for heat-api)
local heat_cfn_apache_conf
heat_cfn_apache_conf=$(apache_site_config_for heat-api-cfn)
local heat_cloudwatch_apache_conf
heat_cloudwatch_apache_conf=$(apache_site_config_for heat-api-cloudwatch)
local heat_ssl=""
local heat_certfile=""
local heat_keyfile=""
local heat_api_port=$HEAT_API_PORT
local heat_cfn_api_port=$HEAT_API_CFN_PORT
local heat_cw_api_port=$HEAT_API_CW_PORT
local venv_path=""
sudo cp $HEAT_FILES_DIR/heat-api.conf $heat_apache_conf
@ -419,18 +406,6 @@ function _config_heat_apache_wsgi {
s|%VIRTUALENV%|$venv_path|g
" -i $heat_cfn_apache_conf
sudo cp $HEAT_FILES_DIR/heat-api-cloudwatch.conf $heat_cloudwatch_apache_conf
sudo sed -e "
s|%PUBLICPORT%|$heat_cw_api_port|g;
s|%APACHE_NAME%|$APACHE_NAME|g;
s|%HEAT_BIN_DIR%|$HEAT_BIN_DIR|g;
s|%API_WORKERS%|$API_WORKERS|g;
s|%SSLENGINE%|$heat_ssl|g;
s|%SSLCERTFILE%|$heat_certfile|g;
s|%SSLKEYFILE%|$heat_keyfile|g;
s|%USER%|$STACK_USER|g;
s|%VIRTUALENV%|$venv_path|g
" -i $heat_cloudwatch_apache_conf
}

View File

@ -6,5 +6,3 @@
enable_service h-eng
enable_service h-api
enable_service h-api-cfn
enable_service h-api-cw

View File

@ -1,6 +1,6 @@
register_project_for_upgrade heat
register_db_to_save heat
devstack_localrc base enable_service h-api h-api-cfn h-api-cw h-eng heat tempest
devstack_localrc target enable_service h-api h-api-cfn h-api-cw h-eng heat tempest
devstack_localrc base enable_service h-api h-api-cfn h-eng heat tempest
devstack_localrc target enable_service h-api h-api-cfn h-eng heat tempest
BASE_RUN_SMOKE=False
TARGET_RUN_SMOKE=False

View File

@ -30,7 +30,11 @@ set -o xtrace
stop_heat
SERVICES_DOWN="heat-api heat-engine heat-api-cfn heat-api-cloudwatch"
# stop cloudwatch service if running
# TODO(ramishra): Remove it after Queens
stop_cw_service
SERVICES_DOWN="heat-api heat-engine heat-api-cfn"
# sanity check that services are actually down
ensure_services_stopped $SERVICES_DOWN

View File

@ -86,7 +86,7 @@ start_heat
# Don't succeed unless the services come up
# Truncating some service names to 11 characters
ensure_services_started heat-api heat-engine heat-api-cl heat-api-cf
ensure_services_started heat-api heat-engine heat-api-cf
set +o xtrace
echo "*********************************************************************"