Merge "Add DevStack plugin"

This commit is contained in:
Zuul 2018-11-08 18:20:02 +00:00 committed by Gerrit Code Review
commit ed45cf8e51
6 changed files with 191 additions and 0 deletions

View File

@ -7,6 +7,8 @@
- build-openstack-releasenotes
- openstack-tox-pep8
- openstack-tox-linters
- stx-devstack-integ:
voting: false
gate:
jobs:
- build-openstack-releasenotes
@ -16,3 +18,49 @@
jobs:
- publish-stx-tox
- publish-stx-releasenotes
- job:
name: stx-devstack-integ
parent: stx-devstack-base
timeout: 7800
required-projects:
- openstack/stx-fault
vars:
tox_envlist: functional
devstack_services:
# Cinder services
c-api: false
c-bak: false
c-sch: false
c-vol: false
cinder: false
# Glance services
g-api: false
g-reg: false
# Nova services
n-api: false
n-api-meta: false
n-cauth: false
n-cond: false
n-cpu: false
n-novnc: false
n-obj: false
n-sch: false
placement-api: false
# Neutron services
q-agt: true
q-dhcp: false
q-l3: false
q-meta: false
q-metering: false
q-svc: false
horizon: false
# StarlingX services
platform-util: true
devstack_plugins:
stx-fault: git://git.starlingx.io/stx-fault
stx-integ: git://git.starlingx.io/stx-integ
devstack_localrc:
LIBS_FROM_GIT: keystone
files:
- ^devstack/.*

86
devstack/lib/stx-integ Normal file
View File

@ -0,0 +1,86 @@
#!/bin/bash
#
# lib/stx-integ
# Functions to control the configuration and operation of stx-integ
# Dependencies:
#
# - ``functions`` file
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
# ``plugin.sh`` calls the entry points in this order:
#
# - install_integ
# - configure_integ
# - init_integ
# - start_integ
# - stop_integ
# - cleanup_integ
_XTRACE_STX_INTEG=$(set +o | grep xtrace)
set -o xtrace
# Defaults
# --------
STXINTEG_DIR=${GITDIR[$STX_INTEG_NAME]}
PLATFORM_UTIL_DIR=$STXINTEG_DIR/utilities/platform-util
STX_BIN_DIR=$(get_python_exec_prefix)
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
function install_platform_util {
pushd $PLATFORM_UTIL_DIR/platform-util
sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
popd
local stx_integ_sbindir=/usr/local/sbin/
local systemddir=/etc/systemd
sudo install -m 755 -d ${stx_integ_sbindir}
sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-mtce ${stx_integ_sbindir}
sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-processes ${stx_integ_sbindir}
sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-haproxy ${stx_integ_sbindir}
sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/cgcs_tc_setup.sh ${STX_BIN_DIR}
sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/remotelogging_tc_setup.sh ${STX_BIN_DIR}
sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/connectivity_test ${STX_BIN_DIR}
# sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/opt-platform.mount ${systemddir}/system
# sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/opt-platform.service ${systemddir}/system
# sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/memcached.service ${systemddir}/system
}
function cleanup_integ {
# Cleanup the service
stop_integ
}
function configure_integ {
# Configure the service
:
}
function init_integ {
# Initialize and start the service
:
}
function install_integ {
# Install the service
if is_service_enabled platform-util; then
install_platform_util
fi
}
function sart_integ {
# Shut the service down
:
}
function stop_integ {
# Initialize and start the service
:
}
$_XTRACE_STX_INTEG

View File

@ -0,0 +1 @@
# Plug-in overrides

36
devstack/plugin.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# ``stack.sh`` calls the entry points in this order:
#
echo_summary "integ devstack plugin.sh called: $1/$2"
# check for service enabled
if is_service_enabled stx-integ; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then
# Perform installation of source
echo_summary "Install stx-integ"
install_integ
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# Configure after the other layer 1 and 2 services have been configured
echo_summary "Configure stx-integ"
configure_integ
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# Initialize and start the service
echo_summary "Initialize and start stx-integ"
init_integ
elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
# do sanity test
echo_summary "do test-config"
fi
if [[ "$1" == "unstack" ]]; then
# Shut down services
echo_summary "Stop stx-integ services"
stop_integ
fi
if [[ "$1" == "clean" ]]; then
echo_summary "Clean stx-update"
cleanup_integ
fi
fi

15
devstack/settings Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# Devstack settings
# Defaults
# --------
STX_INTEG_NAME=stx-integ
######### Plugin Specific ##########
enable_service $STX_INTEG_NAME
#platform_license
# Initial source of lib script
source $DEST/stx-integ/devstack/lib/stx-integ

View File

@ -138,3 +138,8 @@ basepython = python3
envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt
commands = reno new {posargs}
[testenv:functional]
basepython = python3
whitelist_externals = cat
commands = cat /etc/group