Browse Source

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 <dtroyer@gmail.com>
Dean Troyer 8 months ago
parent
commit
201f4b1540
5 changed files with 56 additions and 70 deletions
  1. 32
    0
      .zuul.yaml
  2. 5
    53
      devstack/lib/stx-config
  3. 1
    0
      devstack/override-defaults
  4. 5
    16
      devstack/plugin.sh
  5. 13
    1
      devstack/settings

+ 32
- 0
.zuul.yaml View File

@@ -13,6 +13,8 @@
13 13
         - controllerconfig-tox-py27
14 14
         - controllerconfig-tox-pylint
15 15
         - configutilities-tox-flake8
16
+        - stx-devstack-config:
17
+            voting: false
16 18
     gate:
17 19
       jobs:
18 20
         - build-openstack-api-ref
@@ -108,3 +110,33 @@
108 110
     vars:
109 111
       tox_envlist: flake8
110 112
       tox_extra_args: -c configutilities/configutilities/tox.ini
113
+
114
+- job:
115
+    name: stx-devstack-config
116
+    parent: stx-devstack-base
117
+    timeout: 7800
118
+    required-projects:
119
+      - openstack/stx-update
120
+      - openstack/stx-fault
121
+      - openstack/stx-integ
122
+    vars:
123
+      tox_envlist: functional
124
+      devstack_services:
125
+        horizon: false
126
+        # StarlingX services
127
+        fm-common: true
128
+        fm-api: true
129
+        # fm-rest-api: true
130
+        # fm-mgr: true
131
+        sysinv-api: true
132
+        sysinv-cond: true
133
+        mysql: false
134
+        postgresql: true
135
+        tls-proxy: false
136
+      devstack_plugins:
137
+        stx-config: git://git.starlingx.io/stx-config
138
+        stx-fault: git://git.starlingx.io/stx-fault
139
+        stx-integ: git://git.starlingx.io/stx-integ
140
+        stx-update: git://git.starlingx.io/stx-update
141
+    files:
142
+      - ^devstack/.*

+ 5
- 53
devstack/lib/stx-config View File

@@ -1,15 +1,14 @@
1 1
 #!/bin/bash
2 2
 #
3 3
 # lib/stx-config
4
-# Functions to control the configuration and operation of the **sysinv** service
4
+# Functions to control the configuration and operation of stx-config
5 5
 
6 6
 # Dependencies:
7 7
 #
8 8
 # - ``functions`` file
9 9
 # - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
10
-# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
11
-# - ``SERVICE_HOST``
12
-# - ``KEYSTONE_TOKEN_FORMAT`` must be defined
10
+
11
+# - The stx-update and stx-fault plugins must be enabled
13 12
 
14 13
 # ``stack.sh`` calls the entry points in this order:
15 14
 #
@@ -31,22 +30,8 @@ set -o xtrace
31 30
 SYSINV_CLIENT_NAME=cgts-client
32 31
 GITDIR["$SYSINV_CLIENT_NAME"]=$DEST/stx-config/sysinv/cgts-client/cgts-client
33 32
 GITDIR["sysinv"]=$DEST/stx-config/sysinv/sysinv/sysinv
34
-#this is sysinv dependence , if stx-update support devstack, we need use depends
35
-STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/openstack/stx-update.git}
36
-STXUPDATE_DIR=$DEST/stx-update
37
-STXUPDATE_BRANCH=${STXUPDATE_BRANCH:-master}
38 33
 STXCONFIG_CONTROL=$DEST/stx-config/controllerconfig/controllerconfig
39 34
 STXCONFIG_CONFUTILS=$DEST/stx-config/configutilities/configutilities
40
-GITDIR["tsconfig"]=$STXUPDATE_DIR/tsconfig/tsconfig/
41
-TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/
42
-CGCS_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/
43
-STXFAULT_REPO=${STXFAULT_REPO:-${GIT_BASE}/openstack/stx-fault.git}
44
-STXFAULT_DIR=$DEST/stx-fault
45
-STXFAULT_BRANCH=${STXFAULT_BRANCH:-master}
46
-STXUTILS_PLATFORM_DIR=$STXUTILS_DIR/middleware/util/recipes-common/platform-util
47
-STXUTILS_BRANCH=${STXUTILS_BRANCH:-master}
48
-GITDIR["fm-api"]=$STXFAULT_DIR/fm-api
49
-#TSCONFIG_DIR=$STXFAULT_DIR/tsconfig
50 35
 SYSINV_SERVICE_PROTOCOL=${SYSINV_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
51 36
 SYSINV_SERVICE_PORT=${SYSINV_SERVICE_PORT:-6385}
52 37
 SYSINV_SERVICE_HOST=${SYSINV_SERVICE_HOST:-$SERVICE_HOST}
@@ -146,6 +131,8 @@ function create_sysinv_user_group {
146 131
 
147 132
 function init_sysinv {
148 133
     echo "trigger init sysinv"
134
+    # Migrations need this
135
+    sudo install -d -m 755 -o ${USER} /var/run/sysinv
149 136
     if [[ "$HOST_TOPOLOGY_ROLE" != "subnode" ]]; then
150 137
         # (Re)create  sysinv database
151 138
         echo "recreate_database sysinv and dbsync"
@@ -172,13 +159,6 @@ function install_controllerconfig {
172 159
     popd
173 160
 }
174 161
 
175
-function install_fm_api {
176
-    git_clone $STXFAULT_REPO $STXFAULT_DIR $STXFAULT_BRANCH
177
-    pushd $STXFAULT_DIR/fm-api
178
-    sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
179
-    popd
180
-}
181
-
182 162
 function install_sysinv {
183 163
     local req_services="key rabbit nova neutron"
184 164
     for srv in $req_services;do
@@ -210,34 +190,6 @@ function install_sysinv {
210 190
 function install_sysinv_depends {
211 191
     install_configutilities
212 192
     install_controllerconfig
213
-    install_tsconfig
214
-    install_fm_api
215
-}
216
-
217
-function install_tsconfig {
218
-    git_clone $STXUPDATE_REPO $STXUPDATE_DIR $STXUPDATE_BRANCH
219
-    # no setup.cfg in tsconfig, so we can not use pip install -e
220
-    # setup_dev_lib "tsconfig"
221
-    pushd $TSCONFIG_DIR/tsconfig
222
-    sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
223
-    popd
224
-    sudo install -d -m 755 $SYSINV_BIN_DIR
225
-    sudo install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $SYSINV_BIN_DIR/tsconfig
226
-    pushd $CGCS_PATCH_DIR/cgcs-patch
227
-    sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
228
-    popd
229
-    local cgcs_patch_sbindir=/etc/sbin/
230
-    local cgcs_patch_sysconfdir=/etc/
231
-    sudo install -m 755 -d ${cgcs_patch_sbindir}
232
-    sudo install -m 755 -d ${cgcs_patch_sysconfdir}/bash_completion.d
233
-    sudo install -m 755 -d ${cgcs_patch_sysconfdir}/goenabled.d
234
-    sudo install -m 755 -d ${cgcs_patch_sysconfdir}/init.d
235
-    sudo install -m 755 -d ${cgcs_patch_sysconfdir}/logrotate.d
236
-    sudo install -m 755 -d ${cgcs_patch_sysconfdir}/patching
237
-    sudo install -m 755 -d ${cgcs_patch_sysconfdir}/patching/patch-scripts
238
-    sudo install -m 755 -d ${cgcs_patch_sysconfdir}/pmon.d
239
-    sudo install -m 500 $CGCS_PATCH_DIR/bin/sw-patch-agent ${cgcs_patch_sbindir}/sw-patch-agent
240
-    #still a lots of bin need to install , but might not need for stx-config
241 193
 }
242 194
 
243 195
 function start_sysinv {

+ 1
- 0
devstack/override-defaults View File

@@ -1 +1,2 @@
1
+#!/bin/bash
1 2
 # Plug-in overrides

+ 5
- 16
devstack/plugin.sh View File

@@ -3,36 +3,27 @@
3 3
 # devstack/plugin.sh
4 4
 # Triggers stx_config specific functions to install and configure stx_config
5 5
 
6
-# Dependencies:
7
-#
8
-# - ``functions`` file
9
-# - ``DATA_DIR`` must be defined
10
-
11
-# ``stack.sh`` calls the entry points in this order:
12
-#
13 6
 echo_summary "sysinv devstack plugin.sh called: $1/$2"
14
-source $DEST/stx-config/devstack/lib/stx-config
15
-# check for service enabled
16 7
 
17
-if is_service_enabled sysinv-api sysinv-cond; then
8
+# check for service enabled
9
+if is_service_enabled stx-config; then
18 10
     if [[ "$1" == "stack" && "$2" == "install" ]]; then
19
-        # Perform installation of sysinv source
11
+        # Perform installation of source
20 12
         echo_summary "Installing cgts_client"
21 13
         install_cgtsclient
22 14
         echo_summary "Installing depends"
23 15
         install_sysinv_depends
24 16
         echo_summary "Installing sysinv service"
25 17
         install_sysinv
26
-
27 18
     elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
28 19
         # Configure after the other layer 1 and 2 services have been configured
29
-        echo_summary "Configuring sysinv"
20
+        echo_summary "Configure sysinv"
30 21
         configure_sysinv
31 22
         create_sysinv_user_group
32 23
         create_sysinv_accounts
33 24
     elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
34 25
         # Initialize and start the sysinv service
35
-        echo_summary "Initializing and start sysinv "
26
+        echo_summary "Initialize and start sysinv "
36 27
         init_sysinv
37 28
         start_sysinv
38 29
     elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
@@ -44,11 +35,9 @@ if is_service_enabled sysinv-api sysinv-cond; then
44 35
         # Shut down sysinv services
45 36
         echo_summary "Stop Sysinv service"
46 37
         stop_sysinv
47
-        :
48 38
     fi
49 39
 
50 40
     if [[ "$1" == "clean" ]]; then
51 41
         cleanup_sysinv
52
-        :
53 42
     fi
54 43
 fi

+ 13
- 1
devstack/settings View File

@@ -1,8 +1,20 @@
1
+#!/bin/bash
1 2
 # Devstack settings
2 3
 
3 4
 # Defaults
4 5
 # --------
5 6
 
7
+STX_CONFIG_NAME=stx-config
6 8
 
7 9
 ######### Plugin Specific ##########
8
-enable_service sysinv sysinv-api sysinv-cond
10
+enable_service $STX_CONFIG_NAME sysinv sysinv-api sysinv-cond
11
+#define_plugin sysinv
12
+
13
+# Handle STX pre-reqs
14
+# stx-integ
15
+enable_service platform-util
16
+# stx-update
17
+enable_service sw-patch tsconfig
18
+
19
+# Initial source of lib script
20
+source $DEST/stx-config/devstack/lib/stx-config

Loading…
Cancel
Save