cyborg/devstack/settings
Sean Mooney 985b15287e move setting to devstack/settings
All user settable options should be stored the
devstack/setting file so they are defiend when it is
sourced early in devstack to allow values to be shared
between plugins if required.

This change moves the cyborg settings from
devstack/lib/cyborg to devstack/settings to conform to
the standard plugin interface.

The name of the folder where devstack clones the plugin
is specified in the first argument ot the enable_plugin
function invocation in the local.conf.
This change makes updates CYBORG_DIR to respect that
and adds TODOs for other issues that will be adressed in
follow up patches.

Change-Id: I5b6879e5ddb86659b8c7eb87b8d26cee33ed4754
2020-03-02 15:02:17 +00:00

61 lines
2.4 KiB
Plaintext

enable_service cyborg cyborg-api cyborg-cond cyborg-agent
# cyborg setting
# Defaults
# --------
# NOTE(sean-k-mooney): these should be removed in the future as
# devstack plugins should not clone the repo they are packaged in.
# Cloning the repo from within the plugin will result in the plugin
# script replacing the directory it is executing form.
# Set up default repos
CYBORG_REPO=${CYBORG_REPO:-${GIT_BASE}/openstack/cyborg.git}
CYBORG_BRANCH=${CYBORG_BRANCH:-master}
# Set up default directories
# then name of the directory where cyborg is cloned is set by the first
# argument to enable_plugin so we should not assume it will be cyborg
CYBORG_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )
CYBORG_DEVSTACK_DIR=$CYBORG_DIR/devstack
CYBORG_DEVSTACK_FILES_DIR=$CYBORG_DEVSTACK_DIR/files
CYBORG_DATA_DIR=$DATA_DIR/cyborg
CYBORG_STATE_PATH=/var/lib/cyborg
CYBORG_AUTH_CACHE_DIR=${CYBORG_AUTH_CACHE_DIR:-/var/cache/cyborg}
CYBORG_CONF_DIR=${CYBORG_CONF_DIR:-/etc/cyborg}
CYBORG_CONF_FILE=$CYBORG_CONF_DIR/cyborg.conf
CYBORG_API_PASTE_INI=$CYBORG_CONF_DIR/api-paste.ini
CYBORG_POLICY_JSON=$CYBORG_CONF_DIR/policy.json
CYBORG_SERVICE_HOST=${CYBORG_SERVICE_HOST:-$SERVICE_HOST}
CYBORG_SERVICE_PORT=${CYBORG_SERVICE_PORT:-6666}
CYBORG_SERVICE_PROTOCOL=${CYBORG_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
CYBORG_ENABLED_DRIVERS=${CYBORG_ENABLED_DRIVERS:-fake_driver}
if [[ -d ${CYBORG_DIR}/bin ]]; then
CYBORG_BIN_DIR=${CYBORG_DIR}/bin
else
CYBORG_BIN_DIR=$(get_python_exec_prefix)
fi
# Toggle for deploying Cyborg-API under a wsgi server
CYBORG_USE_UWSGI=${CYBORG_USE_UWSGI:-True}
CYBORG_UWSGI=$CYBORG_BIN_DIR/cyborg-wsgi-api
CYBORG_UWSGI_CONF=$CYBORG_CONF_DIR/cyborg-api-uwsgi.ini
if [[ "$CYBORG_USE_UWSGI" == "True" ]]; then
CYBORG_API_URL="$CYBORG_SERVICE_PROTOCOL://$CYBORG_SERVICE_HOST/accelerator"
else
CYBORG_API_URL="$CYBORG_SERVICE_PROTOCOL://$CYBORG_SERVICE_HOST:$CYBORG_SERVICE_PORT"
fi
# OPAE settings
# OPAE packages are not yet upstreamed into OS repos
# We need to download them from OPAE releases page on GitHub
OPAE_INSTALL_ENABLE=$(trueorfalse True OPAE_INSTALL_ENABLE)
OPAE_VERSION=${OPAE_VERSION:-"1.1.0-2"}
OPAE_GITHUB=${OPAE_GITHUB:-"https://github.com/OPAE/opae-sdk/releases/download/$OPAE_VERSION"}
OPAE_DEVEL_PKG=${OPAE_DEVEL_PKG:-"opae-devel"}
OPAE_DEVEL=${OPAE_DEVEL:-"${OPAE_DEVEL_PKG}-$OPAE_VERSION.x86_64"}
OPAE_LIBS_PKG=${OPAE_LIBS_PKG:-"opae-libs"}
OPAE_LIBS=${OPAE_LIBS:-"${OPAE_LIBS_PKG}-$OPAE_VERSION.x86_64"}