From 201f4b154013c9b61243e52b5c87ba73a2389d58 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 23 Aug 2018 13:36:42 -0500 Subject: [PATCH] Leverage the stx-update, stx-integ and stx-fault DevStack plugins sysinv needs: * stx-integ: platform-utils * stx-update: sw-patch, tsconfig * stx-fault: fm-api, fm-common Depends-On: https://review.openstack.org/614804 Depends-On: https://review.openstack.org/#/c/613973/ Depends-On: https://review.openstack.org/#/c/614244/ Change-Id: I85b49a954300907d6693df9d18eb37296d6f3f0c Signed-off-by: Dean Troyer --- .zuul.yaml | 32 +++++++++++++++++++++ devstack/lib/stx-config | 58 ++++---------------------------------- devstack/override-defaults | 1 + devstack/plugin.sh | 21 ++++---------- devstack/settings | 14 ++++++++- 5 files changed, 56 insertions(+), 70 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 118a2bfc4c..27509a7224 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -13,6 +13,8 @@ - controllerconfig-tox-py27 - controllerconfig-tox-pylint - configutilities-tox-flake8 + - stx-devstack-config: + voting: false gate: jobs: - build-openstack-api-ref @@ -108,3 +110,33 @@ vars: tox_envlist: flake8 tox_extra_args: -c configutilities/configutilities/tox.ini + +- job: + name: stx-devstack-config + parent: stx-devstack-base + timeout: 7800 + required-projects: + - openstack/stx-update + - openstack/stx-fault + - openstack/stx-integ + vars: + tox_envlist: functional + devstack_services: + horizon: false + # StarlingX services + fm-common: true + fm-api: true + # fm-rest-api: true + # fm-mgr: true + sysinv-api: true + sysinv-cond: true + mysql: false + postgresql: true + tls-proxy: false + devstack_plugins: + stx-config: git://git.starlingx.io/stx-config + stx-fault: git://git.starlingx.io/stx-fault + stx-integ: git://git.starlingx.io/stx-integ + stx-update: git://git.starlingx.io/stx-update + files: + - ^devstack/.* diff --git a/devstack/lib/stx-config b/devstack/lib/stx-config index 13d1c02868..c707e889ea 100644 --- a/devstack/lib/stx-config +++ b/devstack/lib/stx-config @@ -1,15 +1,14 @@ #!/bin/bash # # lib/stx-config -# Functions to control the configuration and operation of the **sysinv** service +# Functions to control the configuration and operation of stx-config # Dependencies: # # - ``functions`` file # - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined -# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined -# - ``SERVICE_HOST`` -# - ``KEYSTONE_TOKEN_FORMAT`` must be defined + +# - The stx-update and stx-fault plugins must be enabled # ``stack.sh`` calls the entry points in this order: # @@ -31,22 +30,8 @@ set -o xtrace SYSINV_CLIENT_NAME=cgts-client GITDIR["$SYSINV_CLIENT_NAME"]=$DEST/stx-config/sysinv/cgts-client/cgts-client GITDIR["sysinv"]=$DEST/stx-config/sysinv/sysinv/sysinv -#this is sysinv dependence , if stx-update support devstack, we need use depends -STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/openstack/stx-update.git} -STXUPDATE_DIR=$DEST/stx-update -STXUPDATE_BRANCH=${STXUPDATE_BRANCH:-master} STXCONFIG_CONTROL=$DEST/stx-config/controllerconfig/controllerconfig STXCONFIG_CONFUTILS=$DEST/stx-config/configutilities/configutilities -GITDIR["tsconfig"]=$STXUPDATE_DIR/tsconfig/tsconfig/ -TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/ -CGCS_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/ -STXFAULT_REPO=${STXFAULT_REPO:-${GIT_BASE}/openstack/stx-fault.git} -STXFAULT_DIR=$DEST/stx-fault -STXFAULT_BRANCH=${STXFAULT_BRANCH:-master} -STXUTILS_PLATFORM_DIR=$STXUTILS_DIR/middleware/util/recipes-common/platform-util -STXUTILS_BRANCH=${STXUTILS_BRANCH:-master} -GITDIR["fm-api"]=$STXFAULT_DIR/fm-api -#TSCONFIG_DIR=$STXFAULT_DIR/tsconfig SYSINV_SERVICE_PROTOCOL=${SYSINV_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} SYSINV_SERVICE_PORT=${SYSINV_SERVICE_PORT:-6385} SYSINV_SERVICE_HOST=${SYSINV_SERVICE_HOST:-$SERVICE_HOST} @@ -146,6 +131,8 @@ function create_sysinv_user_group { function init_sysinv { echo "trigger init sysinv" + # Migrations need this + sudo install -d -m 755 -o ${USER} /var/run/sysinv if [[ "$HOST_TOPOLOGY_ROLE" != "subnode" ]]; then # (Re)create sysinv database echo "recreate_database sysinv and dbsync" @@ -172,13 +159,6 @@ function install_controllerconfig { popd } -function install_fm_api { - git_clone $STXFAULT_REPO $STXFAULT_DIR $STXFAULT_BRANCH - pushd $STXFAULT_DIR/fm-api - sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed - popd -} - function install_sysinv { local req_services="key rabbit nova neutron" for srv in $req_services;do @@ -210,34 +190,6 @@ function install_sysinv { function install_sysinv_depends { install_configutilities install_controllerconfig - install_tsconfig - install_fm_api -} - -function install_tsconfig { - git_clone $STXUPDATE_REPO $STXUPDATE_DIR $STXUPDATE_BRANCH - # no setup.cfg in tsconfig, so we can not use pip install -e - # setup_dev_lib "tsconfig" - pushd $TSCONFIG_DIR/tsconfig - sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed - popd - sudo install -d -m 755 $SYSINV_BIN_DIR - sudo install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $SYSINV_BIN_DIR/tsconfig - pushd $CGCS_PATCH_DIR/cgcs-patch - sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed - popd - local cgcs_patch_sbindir=/etc/sbin/ - local cgcs_patch_sysconfdir=/etc/ - sudo install -m 755 -d ${cgcs_patch_sbindir} - sudo install -m 755 -d ${cgcs_patch_sysconfdir}/bash_completion.d - sudo install -m 755 -d ${cgcs_patch_sysconfdir}/goenabled.d - sudo install -m 755 -d ${cgcs_patch_sysconfdir}/init.d - sudo install -m 755 -d ${cgcs_patch_sysconfdir}/logrotate.d - sudo install -m 755 -d ${cgcs_patch_sysconfdir}/patching - sudo install -m 755 -d ${cgcs_patch_sysconfdir}/patching/patch-scripts - sudo install -m 755 -d ${cgcs_patch_sysconfdir}/pmon.d - sudo install -m 500 $CGCS_PATCH_DIR/bin/sw-patch-agent ${cgcs_patch_sbindir}/sw-patch-agent - #still a lots of bin need to install , but might not need for stx-config } function start_sysinv { diff --git a/devstack/override-defaults b/devstack/override-defaults index e8d84c2d28..999da1630a 100644 --- a/devstack/override-defaults +++ b/devstack/override-defaults @@ -1 +1,2 @@ +#!/bin/bash # Plug-in overrides diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 283a185644..ccc03c1e30 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -3,36 +3,27 @@ # devstack/plugin.sh # Triggers stx_config specific functions to install and configure stx_config -# Dependencies: -# -# - ``functions`` file -# - ``DATA_DIR`` must be defined - -# ``stack.sh`` calls the entry points in this order: -# echo_summary "sysinv devstack plugin.sh called: $1/$2" -source $DEST/stx-config/devstack/lib/stx-config -# check for service enabled -if is_service_enabled sysinv-api sysinv-cond; then +# check for service enabled +if is_service_enabled stx-config; then if [[ "$1" == "stack" && "$2" == "install" ]]; then - # Perform installation of sysinv source + # Perform installation of source echo_summary "Installing cgts_client" install_cgtsclient echo_summary "Installing depends" install_sysinv_depends echo_summary "Installing sysinv service" install_sysinv - elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then # Configure after the other layer 1 and 2 services have been configured - echo_summary "Configuring sysinv" + echo_summary "Configure sysinv" configure_sysinv create_sysinv_user_group create_sysinv_accounts elif [[ "$1" == "stack" && "$2" == "extra" ]]; then # Initialize and start the sysinv service - echo_summary "Initializing and start sysinv " + echo_summary "Initialize and start sysinv " init_sysinv start_sysinv elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then @@ -44,11 +35,9 @@ if is_service_enabled sysinv-api sysinv-cond; then # Shut down sysinv services echo_summary "Stop Sysinv service" stop_sysinv - : fi if [[ "$1" == "clean" ]]; then cleanup_sysinv - : fi fi diff --git a/devstack/settings b/devstack/settings index b402bf832f..74795743ff 100644 --- a/devstack/settings +++ b/devstack/settings @@ -1,8 +1,20 @@ +#!/bin/bash # Devstack settings # Defaults # -------- +STX_CONFIG_NAME=stx-config ######### Plugin Specific ########## -enable_service sysinv sysinv-api sysinv-cond +enable_service $STX_CONFIG_NAME sysinv sysinv-api sysinv-cond +#define_plugin sysinv + +# Handle STX pre-reqs +# stx-integ +enable_service platform-util +# stx-update +enable_service sw-patch tsconfig + +# Initial source of lib script +source $DEST/stx-config/devstack/lib/stx-config