Remove libs and libs usage from murano and murano hooks
- Remove devstack libs - Remove libs usage in congress hooks Change-Id: Ieeb76dcbe0ab953dba156413af0906bcd8cb6b45 Closes-Bug: #1508165
This commit is contained in:
parent
d3e4524a42
commit
f215c047ed
@ -1,45 +0,0 @@
|
|||||||
1. Follow Devstack documentation to setup a host for Devstack. Then clone
|
|
||||||
Devstack source code.
|
|
||||||
|
|
||||||
2. Copy Murano integration scripts to Devstack either by setting environment
|
|
||||||
variable or providing complete path to devstack directory. Below one is using
|
|
||||||
environment variable::
|
|
||||||
|
|
||||||
export DEVSTACK_DIR=<complete path to devstack directory(clonned)>
|
|
||||||
cp files/apts/murano ${DEVSTACK_DIR}/files/debs
|
|
||||||
cp files/rpms/murano ${DEVSTACK_DIR}/files/rpms
|
|
||||||
cp lib/murano ${DEVSTACK_DIR}/lib
|
|
||||||
cp lib/murano-dashboard ${DEVSTACK_DIR}/lib
|
|
||||||
cp extras.d/70-murano.sh ${DEVSTACK_DIR}/extras.d
|
|
||||||
|
|
||||||
3. Create a ``localrc`` file as input to devstack.
|
|
||||||
|
|
||||||
4. The Murano, Neutron and Heat services are not enabled by default, so they must be
|
|
||||||
enabled in ``localrc`` before running ``stack.sh``. This example ``localrc``
|
|
||||||
file shows all of the settings required for Murano::
|
|
||||||
|
|
||||||
# Enable Neutron
|
|
||||||
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron
|
|
||||||
|
|
||||||
# Enable Heat
|
|
||||||
enable_service heat h-api h-api-cfn h-api-cw h-eng
|
|
||||||
|
|
||||||
# Enable Murano
|
|
||||||
enable_service murano murano-api murano-engine
|
|
||||||
|
|
||||||
5. (Optional) To import Murano packages when DevStack is up, define an ordered
|
|
||||||
list of packages FQDNs in ``localrc``. Make sure to list all package
|
|
||||||
dependencies. These packages will by default be imported from the murano-apps
|
|
||||||
git repository.
|
|
||||||
|
|
||||||
Example::
|
|
||||||
|
|
||||||
MURANO_APPS=io.murano.apps.apache.Tomcat,io.murano.apps.Guacamole
|
|
||||||
|
|
||||||
You can also use the variables ``MURANO_APPS_REPO`` and ``MURANO_APPS_BRANCH``
|
|
||||||
to configure the git repository which will be used as the source for the
|
|
||||||
imported packages.
|
|
||||||
|
|
||||||
6. Deploy your OpenStack Cloud with Murano::
|
|
||||||
|
|
||||||
./stack.sh
|
|
@ -1,56 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# murano.sh - DevStack extras script to install Murano
|
|
||||||
|
|
||||||
if is_service_enabled murano; then
|
|
||||||
if [[ "$1" == "source" ]]; then
|
|
||||||
# Initial source
|
|
||||||
source $TOP_DIR/lib/murano
|
|
||||||
if is_service_enabled horizon; then
|
|
||||||
source $TOP_DIR/lib/murano-dashboard
|
|
||||||
fi
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
|
|
||||||
echo_summary "Configuring Murano pre-requisites"
|
|
||||||
if is_service_enabled n-net; then
|
|
||||||
disable_service n-net
|
|
||||||
enable_service q-svc q-agt q-dhcp q-l3 q-meta q-metering
|
|
||||||
fi
|
|
||||||
enable_service heat h-api h-api-cfn h-api-cw h-eng
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
|
|
||||||
echo_summary "Installing Murano"
|
|
||||||
install_murano
|
|
||||||
if is_service_enabled horizon; then
|
|
||||||
install_murano_dashboard
|
|
||||||
fi
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
|
||||||
echo_summary "Configuring Murano"
|
|
||||||
configure_murano
|
|
||||||
create_murano_accounts
|
|
||||||
if is_service_enabled horizon; then
|
|
||||||
configure_murano_dashboard
|
|
||||||
fi
|
|
||||||
if is_service_enabled murano-cfapi; then
|
|
||||||
configure_service_broker
|
|
||||||
fi
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
|
||||||
echo_summary "Initializing Murano"
|
|
||||||
init_murano
|
|
||||||
if is_service_enabled horizon; then
|
|
||||||
init_murano_dashboard
|
|
||||||
fi
|
|
||||||
start_murano
|
|
||||||
if is_service_enabled murano-cfapi; then
|
|
||||||
start_service_broker
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" == "unstack" ]]; then
|
|
||||||
stop_murano
|
|
||||||
if is_service_enabled murano-cfapi; then
|
|
||||||
stop_service_broker
|
|
||||||
fi
|
|
||||||
cleanup_murano
|
|
||||||
if is_service_enabled horizon; then
|
|
||||||
cleanup_murano_dashboard
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
@ -1,2 +0,0 @@
|
|||||||
python-mysqldb
|
|
||||||
zip
|
|
@ -1 +0,0 @@
|
|||||||
zip
|
|
@ -1,326 +0,0 @@
|
|||||||
# lib/murano
|
|
||||||
|
|
||||||
# Dependencies:
|
|
||||||
# ``functions`` file
|
|
||||||
# ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
|
|
||||||
|
|
||||||
# ``stack.sh`` calls the entry points in this order:
|
|
||||||
#
|
|
||||||
# install_murano
|
|
||||||
# configure_murano
|
|
||||||
# start_murano
|
|
||||||
# stop_murano
|
|
||||||
|
|
||||||
|
|
||||||
# Save trace setting
|
|
||||||
XTRACE=$(set +o | grep xtrace)
|
|
||||||
set -o xtrace
|
|
||||||
|
|
||||||
|
|
||||||
# Defaults
|
|
||||||
# --------
|
|
||||||
|
|
||||||
# Set up default repos
|
|
||||||
MURANO_REPO=${MURANO_REPO:-${GIT_BASE}/openstack/murano.git}
|
|
||||||
MURANO_BRANCH=${MURANO_BRANCH:-master}
|
|
||||||
|
|
||||||
GITREPO["python-muranoclient"]=${MURANO_PYTHONCLIENT_REPO:-${GIT_BASE}/openstack/python-muranoclient.git}
|
|
||||||
GITBRANCH["python-muranoclient"]=${MURANO_PYTHONCLIENT_BRANCH:-master}
|
|
||||||
GITDIR["python-muranoclient"]=$DEST/python-muranoclient
|
|
||||||
|
|
||||||
# Set up default directories
|
|
||||||
MURANO_DIR=$DEST/murano
|
|
||||||
MURANO_CONF_DIR=${MURANO_CONF_DIR:-/etc/murano}
|
|
||||||
MURANO_CONF_FILE=${MURANO_CONF_DIR}/murano.conf
|
|
||||||
MURANO_POLICY_FILE=${MURANO_CONF_DIR}/policy.json
|
|
||||||
MURANO_DEBUG=${MURANO_DEBUG:-True}
|
|
||||||
MURANO_ENABLE_MODEL_POLICY_ENFORCEMENT=${MURANO_ENABLE_MODEL_POLICY_ENFORCEMENT:-False}
|
|
||||||
|
|
||||||
MURANO_SERVICE_HOST=${MURANO_SERVICE_HOST:-$SERVICE_HOST}
|
|
||||||
MURANO_SERVICE_PORT=${MURANO_SERVICE_PORT:-8082}
|
|
||||||
MURANO_SERVICE_PROTOCOL=${MURANO_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
|
||||||
|
|
||||||
MURANO_ADMIN_USER=${MURANO_ADMIN_USER:-murano}
|
|
||||||
|
|
||||||
MURANO_KEYSTONE_SIGNING_DIR=${MURANO_KEYSTONE_SIGNING_DIR:-/tmp/keystone-signing-muranoapi}
|
|
||||||
|
|
||||||
MURANO_DEFAULT_ROUTER=${MURANO_DEFAULT_ROUTER:-''}
|
|
||||||
MURANO_EXTERNAL_NETWORK=${MURANO_EXTERNAL_NETWORK:-''}
|
|
||||||
MURANO_DEFAULT_DNS=${MURANO_DEFAULT_DNS:-''}
|
|
||||||
|
|
||||||
MURANO_APPS=${MURANO_APPS:-''}
|
|
||||||
MURANO_APPS_DIR=$DEST/murano-apps
|
|
||||||
MURANO_APPS_REPO=${MURANO_APPS_REPO:-${GIT_BASE}/openstack/murano-apps.git}
|
|
||||||
MURANO_APPS_BRANCH=${MURANO_APPS_BRANCH:-master}
|
|
||||||
|
|
||||||
# MURANO_RABBIT_VHOST allows to specify a separate virtual host for Murano services.
|
|
||||||
# This is not required if all OpenStack services are deployed by devstack scripts
|
|
||||||
# on a single node. In this case '/' virtual host (which is the default) is enough.
|
|
||||||
# The problem arise when Murano installed in 'devbox' mode, allowing two or more
|
|
||||||
# devboxes to use one common OpenStack host. In this case it's better devboxes
|
|
||||||
# use separated virtual hosts, to avoid conflicts between Murano services.
|
|
||||||
# This couldn't be done using exitsting variables, so that's why this variable was added.
|
|
||||||
MURANO_RABBIT_VHOST=${MURANO_RABBIT_VHOST:-''}
|
|
||||||
|
|
||||||
# Support entry points installation of console scripts
|
|
||||||
if [[ -d $MURANO_DIR/bin ]]; then
|
|
||||||
MURANO_BIN_DIR=$MURANO_DIR/bin
|
|
||||||
else
|
|
||||||
MURANO_BIN_DIR=$(get_python_exec_prefix)
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# create_murano_accounts() - Set up common required murano accounts
|
|
||||||
#
|
|
||||||
# Tenant User Roles
|
|
||||||
# ------------------------------
|
|
||||||
# service murano admin
|
|
||||||
function create_murano_accounts() {
|
|
||||||
if ! is_service_enabled key; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
create_service_user "murano"
|
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
|
||||||
get_or_create_service "murano" "application-catalog" "Application Catalog Service"
|
|
||||||
get_or_create_endpoint "application-catalog" \
|
|
||||||
"$REGION_NAME" \
|
|
||||||
"$MURANO_SERVICE_PROTOCOL://$MURANO_SERVICE_HOST:$MURANO_SERVICE_PORT" \
|
|
||||||
"$MURANO_SERVICE_PROTOCOL://$MURANO_SERVICE_HOST:$MURANO_SERVICE_PORT" \
|
|
||||||
"$MURANO_SERVICE_PROTOCOL://$MURANO_SERVICE_HOST:$MURANO_SERVICE_PORT"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function mkdir_chown_stack {
|
|
||||||
if [[ ! -d "$1" ]]; then
|
|
||||||
sudo mkdir -p "$1"
|
|
||||||
fi
|
|
||||||
sudo chown $STACK_USER "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function configure_murano_rpc_backend() {
|
|
||||||
# Configure the rpc service.
|
|
||||||
iniset_rpc_backend muranoapi $MURANO_CONF_FILE DEFAULT
|
|
||||||
|
|
||||||
# TODO(ruhe): get rid of this ugly workaround.
|
|
||||||
inicomment $MURANO_CONF_FILE DEFAULT rpc_backend
|
|
||||||
|
|
||||||
iniset $MURANO_CONF_FILE rabbitmq host $RABBIT_HOST
|
|
||||||
iniset $MURANO_CONF_FILE rabbitmq login $RABBIT_USERID
|
|
||||||
iniset $MURANO_CONF_FILE rabbitmq password $RABBIT_PASSWORD
|
|
||||||
|
|
||||||
# Set non-default rabbit virtual host if required.
|
|
||||||
if [[ -n "$MURANO_RABBIT_VHOST" ]]; then
|
|
||||||
iniset $MURANO_CONF_FILE DEFAULT rabbit_virtual_host $MURANO_RABBIT_VHOST
|
|
||||||
iniset $MURANO_CONF_FILE rabbitmq virtual_host $MURANO_RABBIT_VHOST
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function configure_murano_networking {
|
|
||||||
# Use keyword 'public' if Murano external network was not set.
|
|
||||||
# If it was set but the network is not exist then
|
|
||||||
# first available external network will be selected.
|
|
||||||
local ext_net=${MURANO_EXTERNAL_NETWORK:-'public'}
|
|
||||||
local ext_net_id=$(neutron net-external-list \
|
|
||||||
| grep " $ext_net " | get_field 2)
|
|
||||||
|
|
||||||
# Try to select first available external network
|
|
||||||
if [[ -n "$ext_net_id" ]]; then
|
|
||||||
ext_net_id=$(neutron net-external-list -f csv -c id \
|
|
||||||
| tail -n +2 | tail -n 1)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configure networking options for Murano
|
|
||||||
if [[ -n "$ext_net" ]] && [[ -n "$ext_net_id" ]]; then
|
|
||||||
iniset $MURANO_CONF_FILE networking external_network $ext_net_id
|
|
||||||
iniset $MURANO_CONF_FILE networking create_router 'true'
|
|
||||||
else
|
|
||||||
iniset $MURANO_CONF_FILE networking create_router 'false'
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "$MURANO_DEFAULT_ROUTER" ]]; then
|
|
||||||
iniset $MURANO_CONF_FILE networking router_name $MURANO_DEFAULT_ROUTER
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "$MURANO_DEFAULT_DNS" ]]; then
|
|
||||||
iniset $MURANO_CONF_FILE networking default_dns $MURANO_DEFAULT_DNS
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Entry points
|
|
||||||
# ------------
|
|
||||||
|
|
||||||
# configure_murano() - Set config files, create data dirs, etc
|
|
||||||
function configure_murano {
|
|
||||||
mkdir_chown_stack "$MURANO_CONF_DIR"
|
|
||||||
|
|
||||||
# Generate Murano configuration file and configure common parameters.
|
|
||||||
oslo-config-generator --namespace keystonemiddleware.auth_token \
|
|
||||||
--namespace murano \
|
|
||||||
--namespace oslo.db \
|
|
||||||
--namespace oslo.messaging \
|
|
||||||
> $MURANO_CONF_FILE
|
|
||||||
cp $MURANO_DIR/etc/murano/murano-paste.ini $MURANO_CONF_DIR
|
|
||||||
cp $MURANO_DIR/etc/murano/policy.json $MURANO_POLICY_FILE
|
|
||||||
|
|
||||||
cleanup_murano
|
|
||||||
|
|
||||||
iniset $MURANO_CONF_FILE DEFAULT debug $MURANO_DEBUG
|
|
||||||
iniset $MURANO_CONF_FILE DEFAULT use_syslog $SYSLOG
|
|
||||||
|
|
||||||
# Murano Policy Enforcement Configuration
|
|
||||||
if [[ -n "$MURANO_ENABLE_MODEL_POLICY_ENFORCEMENT" ]]; then
|
|
||||||
iniset $MURANO_CONF_FILE engine enable_model_policy_enforcer $MURANO_ENABLE_MODEL_POLICY_ENFORCEMENT
|
|
||||||
fi
|
|
||||||
|
|
||||||
# configure_service_broker() - set service broker specific options to config
|
|
||||||
function configure_service_broker {
|
|
||||||
#Add needed options to murano.conf
|
|
||||||
iniset $MURANO_CONF_FILE cfapi tenant "admin"
|
|
||||||
iniset $MURANO_CONF_FILE cfapi bind_host $HOST_IP
|
|
||||||
iniset $MURANO_CONF_FILE cfapi bind_port "8083"
|
|
||||||
iniset $MURANO_CONF_FILE cfapi auth_url "http://${KEYSTONE_AUTH_HOST}:5000/v2.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Murano Api Configuration
|
|
||||||
#-------------------------
|
|
||||||
|
|
||||||
# Setup keystone_authtoken section
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken auth_uri "http://${KEYSTONE_AUTH_HOST}:5000/v2.0"
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken auth_host $KEYSTONE_AUTH_HOST
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken auth_port $KEYSTONE_AUTH_PORT
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken cafile $KEYSTONE_SSL_CA
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken admin_user $MURANO_ADMIN_USER
|
|
||||||
iniset $MURANO_CONF_FILE keystone_authtoken admin_password $SERVICE_PASSWORD
|
|
||||||
|
|
||||||
configure_murano_rpc_backend
|
|
||||||
|
|
||||||
# Configure notifications for status information during provisioning
|
|
||||||
iniset $MURANO_CONF_FILE DEFAULT notification_driver messagingv2
|
|
||||||
|
|
||||||
# configure the database.
|
|
||||||
iniset $MURANO_CONF_FILE database connection `database_connection_url murano`
|
|
||||||
|
|
||||||
# Configure keystone auth url
|
|
||||||
iniset $MURANO_CONF_FILE keystone auth_url "http://${KEYSTONE_AUTH_HOST}:5000/v2.0"
|
|
||||||
|
|
||||||
# Configure Murano API URL
|
|
||||||
iniset $MURANO_CONF_FILE murano url "http://127.0.0.1:8082"
|
|
||||||
}
|
|
||||||
|
|
||||||
# install_murano_apps() - Install Murano apps from repository murano-apps, if required
|
|
||||||
function install_murano_apps() {
|
|
||||||
if [[ -z $MURANO_APPS ]]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# clone murano-apps only if app installation is required
|
|
||||||
git_clone $MURANO_APPS_REPO $MURANO_APPS_DIR $MURANO_APPS_BRANCH
|
|
||||||
|
|
||||||
# install Murano apps defined in the comma-separated list $MURANO_APPS
|
|
||||||
for murano_app in ${MURANO_APPS//,/ }; do
|
|
||||||
find $MURANO_APPS_DIR -type d -name "package" | while read package; do
|
|
||||||
full_name=$(grep "FullName" "$package/manifest.yaml" | awk -F ':' '{print $2}' | tr -d ' ')
|
|
||||||
if [[ $full_name = $murano_app ]]; then
|
|
||||||
pushd $package
|
|
||||||
zip -r app.zip .
|
|
||||||
murano --os-username $OS_USERNAME \
|
|
||||||
--os-password $OS_PASSWORD \
|
|
||||||
--os-tenant-name $OS_PROJECT_NAME \
|
|
||||||
--os-auth-url http://$KEYSTONE_AUTH_HOST:5000/v2.0 \
|
|
||||||
--murano-url http://127.0.0.1:8082 \
|
|
||||||
package-import \
|
|
||||||
--is-public \
|
|
||||||
--exists-action u \
|
|
||||||
app.zip
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# init_murano() - Initialize databases, etc.
|
|
||||||
function init_murano() {
|
|
||||||
configure_murano_networking
|
|
||||||
|
|
||||||
# (re)create Murano database
|
|
||||||
recreate_database murano utf8
|
|
||||||
|
|
||||||
$MURANO_BIN_DIR/murano-db-manage --config-file $MURANO_CONF_FILE upgrade
|
|
||||||
$MURANO_BIN_DIR/murano-manage --config-file $MURANO_CONF_FILE import-package $MURANO_DIR/meta/io.murano
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# install_murano() - Collect source and prepare
|
|
||||||
function install_murano() {
|
|
||||||
install_murano_pythonclient
|
|
||||||
|
|
||||||
git_clone $MURANO_REPO $MURANO_DIR $MURANO_BRANCH
|
|
||||||
|
|
||||||
setup_develop $MURANO_DIR
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function install_murano_pythonclient() {
|
|
||||||
# For using non-released client from git branch, need to add
|
|
||||||
# LIBS_FROM_GIT=python-muranoclient parameter to localrc.
|
|
||||||
# Otherwise, murano will install python-muranoclient from requirements.
|
|
||||||
if use_library_from_git "python-muranoclient"; then
|
|
||||||
git_clone_by_name "python-muranoclient"
|
|
||||||
setup_dev_lib "python-muranoclient"
|
|
||||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-muranoclient"]}/tools/,/etc/bash_completion.d/}murano.bash_completion
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# start_murano() - Start running processes, including screen
|
|
||||||
function start_murano() {
|
|
||||||
screen_it murano-api "cd $MURANO_DIR && $MURANO_BIN_DIR/murano-api --config-file $MURANO_CONF_DIR/murano.conf"
|
|
||||||
screen_it murano-engine "cd $MURANO_DIR && $MURANO_BIN_DIR/murano-engine --config-file $MURANO_CONF_DIR/murano.conf"
|
|
||||||
|
|
||||||
# Give Murano some time to Start
|
|
||||||
sleep 3
|
|
||||||
|
|
||||||
# Install Murano apps, if needed
|
|
||||||
install_murano_apps
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# stop_murano() - Stop running processes
|
|
||||||
function stop_murano() {
|
|
||||||
# Kill the Murano screen windows
|
|
||||||
screen -S $SCREEN_NAME -p murano-api -X kill
|
|
||||||
screen -S $SCREEN_NAME -p murano-engine -X kill
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# start_service_broker() - start murano CF service broker
|
|
||||||
function start_service_broker() {
|
|
||||||
screen_it murano-cfapi "cd $MURANO_DIR && $MURANO_BIN_DIR/murano-cfapi --config-file $MURANO_CONF_DIR/murano.conf"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# stop_service_broker() - stop murano CF service broker
|
|
||||||
function stop_service_broker() {
|
|
||||||
# Kill the Murano screen windows
|
|
||||||
screen -S $SCREEN_NAME -p murano-cfapi -X kill
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function cleanup_murano() {
|
|
||||||
|
|
||||||
# Cleanup keystone signing dir
|
|
||||||
sudo rm -rf $MURANO_KEYSTONE_SIGNING_DIR
|
|
||||||
}
|
|
||||||
|
|
||||||
# Restore xtrace
|
|
||||||
$XTRACE
|
|
||||||
|
|
||||||
# Local variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# End:
|
|
@ -1,141 +0,0 @@
|
|||||||
# lib/murano-dashboard
|
|
||||||
|
|
||||||
# Dependencies:
|
|
||||||
#
|
|
||||||
# - ``functions`` file
|
|
||||||
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
|
|
||||||
# - ``SERVICE_HOST``
|
|
||||||
|
|
||||||
# ``stack.sh`` calls the entry points in this order:
|
|
||||||
#
|
|
||||||
# - install_murano_dashboard
|
|
||||||
# - configure_murano_dashboard
|
|
||||||
# - cleanup_murano_dashboard
|
|
||||||
|
|
||||||
# Save trace setting
|
|
||||||
XTRACE=$(set +o | grep xtrace)
|
|
||||||
set -o xtrace
|
|
||||||
|
|
||||||
source $TOP_DIR/lib/horizon
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Defaults
|
|
||||||
# --------
|
|
||||||
|
|
||||||
HORIZON_CONFIG=${HORIZON_CONFIG:-$HORIZON_DIR/openstack_dashboard/settings.py}
|
|
||||||
HORIZON_LOCAL_CONFIG=${HORIZON_LOCAL_CONFIG:-$HORIZON_DIR/openstack_dashboard/local/local_settings.py}
|
|
||||||
|
|
||||||
# Set up default repos
|
|
||||||
MURANO_DASHBOARD_REPO=${MURANO_DASHBOARD_REPO:-${GIT_BASE}/openstack/murano-dashboard.git}
|
|
||||||
MURANO_DASHBOARD_BRANCH=${MURANO_DASHBOARD_BRANCH:-master}
|
|
||||||
|
|
||||||
# Set up default directories
|
|
||||||
MURANO_DASHBOARD_DIR=$DEST/murano-dashboard
|
|
||||||
MURANO_PYTHONCLIENT_DIR=$DEST/python-muranoclient
|
|
||||||
|
|
||||||
MURANO_DASHBOARD_CACHE_DIR=${MURANO_DASHBOARD_CACHE_DIR:-/tmp/murano}
|
|
||||||
|
|
||||||
MURANO_REPOSITORY_URL=${MURANO_REPOSITORY_URL:-'http://apps.openstack.org/api/v1/murano_repo/liberty/'}
|
|
||||||
|
|
||||||
# Functions
|
|
||||||
# ---------
|
|
||||||
|
|
||||||
function remove_config_block() {
|
|
||||||
local config_file="$1"
|
|
||||||
local label="$2"
|
|
||||||
|
|
||||||
if [[ -f "$config_file" ]] && [[ -n "$label" ]]; then
|
|
||||||
sed -e "/^#${label}_BEGIN/,/^#${label}_END/ d" -i "$config_file"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Entry points
|
|
||||||
# ------------
|
|
||||||
|
|
||||||
# configure_murano_dashboard() - Set config files, create data dirs, etc
|
|
||||||
function configure_murano_dashboard() {
|
|
||||||
remove_config_block "$HORIZON_CONFIG" "MURANO_CONFIG_SECTION"
|
|
||||||
|
|
||||||
configure_local_settings_py
|
|
||||||
|
|
||||||
restart_apache_server
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function configure_local_settings_py() {
|
|
||||||
local horizon_config_part=$(mktemp)
|
|
||||||
|
|
||||||
mkdir_chown_stack "$MURANO_DASHBOARD_CACHE_DIR"
|
|
||||||
|
|
||||||
# Write changes for dashboard config to a separate file
|
|
||||||
cat << EOF >> "$horizon_config_part"
|
|
||||||
|
|
||||||
#MURANO_CONFIG_SECTION_BEGIN
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
METADATA_CACHE_DIR = '$MURANO_DASHBOARD_CACHE_DIR'
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': os.path.join('$MURANO_DASHBOARD_DIR', 'openstack-dashboard.sqlite')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SESSION_ENGINE = 'django.contrib.sessions.backends.db'
|
|
||||||
MURANO_REPO_URL = '$MURANO_REPOSITORY_URL'
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#MURANO_CONFIG_SECTION_END
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat "$horizon_config_part" >> "$HORIZON_LOCAL_CONFIG"
|
|
||||||
|
|
||||||
if [[ -f "$HORIZON_LOCAL_CONFIG" ]]; then
|
|
||||||
sed -e "s/\(^\s*OPENSTACK_HOST\s*=\).*$/\1 '$HOST_IP'/" -i "$HORIZON_LOCAL_CONFIG"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install Murano as plugin for Horizon
|
|
||||||
ln -s $MURANO_DASHBOARD_DIR/muranodashboard/local/_50_murano.py $HORIZON_DIR/openstack_dashboard/local/enabled/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# init_murano_dashboard() - Initialize databases, etc.
|
|
||||||
function init_murano_dashboard() {
|
|
||||||
# clean up from previous (possibly aborted) runs
|
|
||||||
# create required data files
|
|
||||||
|
|
||||||
local horizon_manage_py="$HORIZON_DIR/manage.py"
|
|
||||||
|
|
||||||
python "$horizon_manage_py" collectstatic --noinput
|
|
||||||
python "$horizon_manage_py" compress --force
|
|
||||||
python "$horizon_manage_py" migrate --noinput
|
|
||||||
|
|
||||||
restart_apache_server
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# install_murano_dashboard() - Collect source and prepare
|
|
||||||
function install_murano_dashboard() {
|
|
||||||
echo_summary "Install Murano Dashboard"
|
|
||||||
|
|
||||||
git_clone $MURANO_DASHBOARD_REPO $MURANO_DASHBOARD_DIR $MURANO_DASHBOARD_BRANCH
|
|
||||||
|
|
||||||
setup_develop $MURANO_DASHBOARD_DIR
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# cleanup_murano_dashboard() - Remove residual data files, anything left over from previous
|
|
||||||
# runs that a clean run would need to clean up
|
|
||||||
function cleanup_murano_dashboard() {
|
|
||||||
echo_summary "Cleanup Murano Dashboard"
|
|
||||||
remove_config_block "$HORIZON_CONFIG" "MURANO_CONFIG_SECTION"
|
|
||||||
rm $HORIZON_DIR/openstack_dashboard/local/enabled/_50_murano.py
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Restore xtrace
|
|
||||||
$XTRACE
|
|
||||||
|
|
||||||
# Local variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# End:
|
|
@ -3,6 +3,4 @@
|
|||||||
# Install Congress devstack integration
|
# Install Congress devstack integration
|
||||||
source ./pre_test_hook_common.sh
|
source ./pre_test_hook_common.sh
|
||||||
CONGRESS_BASE=/opt/stack/new/congress/contrib/devstack
|
CONGRESS_BASE=/opt/stack/new/congress/contrib/devstack
|
||||||
cp $CONGRESS_BASE/lib/* $DEVSTACK_BASE/lib
|
|
||||||
cp $CONGRESS_BASE/extras.d/* $DEVSTACK_BASE/extras.d
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user