diff --git a/.zuul.yaml b/.zuul.yaml index 937b1619f..f9212f67c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -27,6 +27,7 @@ timeout: 7800 required-projects: - openstack/stx-fault + - openstack/stx-update vars: tox_envlist: functional devstack_services: @@ -62,6 +63,7 @@ devstack_plugins: stx-fault: git://git.starlingx.io/stx-fault stx-integ: git://git.starlingx.io/stx-integ + stx-update: git://git.starlingx.io/stx-update devstack_localrc: LIBS_FROM_GIT: keystone files: diff --git a/devstack/lib/stx-integ b/devstack/lib/stx-integ index ad1590a4a..7683341ca 100644 --- a/devstack/lib/stx-integ +++ b/devstack/lib/stx-integ @@ -1,13 +1,7 @@ #!/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 @@ -27,30 +21,11 @@ STXINTEG_DIR=${GITDIR[$STX_INTEG_NAME]} PLATFORM_UTIL_DIR=$STXINTEG_DIR/utilities/platform-util -STX_BIN_DIR=$(get_python_exec_prefix) +# STX_INST_DIR should be a non-root-writable place to install build artifacts +STX_INST_DIR=${STX_INST_DIR:-$DEST/usr} +STX_BIN_DIR=$STX_INST_DIR/bin 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 @@ -73,14 +48,40 @@ function install_integ { fi } -function sart_integ { - # Shut the service down - : +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=$STX_INST_DIR/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 stop_integ { +function start_integ { # Initialize and start the service : } +function stop_integ { + # Shut the service down + : +} + $_XTRACE_STX_INTEG diff --git a/devstack/plugin.sh b/devstack/plugin.sh index bbff62e80..538985f10 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -1,8 +1,9 @@ #!/bin/bash -# ``stack.sh`` calls the entry points in this order: -# -echo_summary "integ devstack plugin.sh called: $1/$2" +# devstack/plugin.sh +# Triggers specific functions to install and configure stx-integ + +echo_summary "stx-integ devstack plugin.sh called: $1/$2" # check for service enabled if is_service_enabled stx-integ; then @@ -18,6 +19,7 @@ if is_service_enabled stx-integ; then # Initialize and start the service echo_summary "Initialize and start stx-integ" init_integ + start_integ elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then # do sanity test echo_summary "do test-config" diff --git a/devstack/settings b/devstack/settings index 93dbe22ec..1eb7532c5 100644 --- a/devstack/settings +++ b/devstack/settings @@ -1,6 +1,13 @@ #!/bin/bash # Devstack settings +# This plugin enables StarlingX stx-integ services and follows the +# DevStack plugin contract: +# https://docs.openstack.org/devstack/latest/plugins.html#plugin-sh-contract + +# Services +# platform-util + # Defaults # -------- @@ -9,7 +16,10 @@ STX_INTEG_NAME=stx-integ ######### Plugin Specific ########## enable_service $STX_INTEG_NAME -#platform_license +# This must not use any variables to work properly in OpenStack's DevStack playbook +define_plugin stx-integ +# This works for Zuul jobs using OpenStack's DevStack roles +plugin_requires stx-integ stx-update # Initial source of lib script source $DEST/stx-integ/devstack/lib/stx-integ