Browse Source

Merge "Adds job to run inspector in non-standalone mode"

master
Zuul 1 week ago
parent
commit
514c1b536a
5 changed files with 47 additions and 2 deletions
  1. 24
    2
      devstack/plugin.sh
  2. 1
    0
      lower-constraints.txt
  3. 1
    0
      test-requirements.txt
  4. 19
    0
      zuul.d/ironic-inspector-jobs.yaml
  5. 2
    0
      zuul.d/project.yaml

+ 24
- 2
devstack/plugin.sh View File

@@ -8,15 +8,20 @@ IRONIC_INSPECTOR_DIR=$DEST/ironic-inspector
8 8
 IRONIC_INSPECTOR_DATA_DIR=$DATA_DIR/ironic-inspector
9 9
 IRONIC_INSPECTOR_BIN_DIR=$(get_python_exec_prefix)
10 10
 IRONIC_INSPECTOR_BIN_FILE=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector
11
+IRONIC_INSPECTOR_BIN_FILE_API=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector-api-wsgi
12
+IRONIC_INSPECTOR_BIN_FILE_CONDUCTOR=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector-conductor
11 13
 IRONIC_INSPECTOR_DBSYNC_BIN_FILE=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector-dbsync
12 14
 IRONIC_INSPECTOR_CONF_DIR=${IRONIC_INSPECTOR_CONF_DIR:-/etc/ironic-inspector}
13 15
 IRONIC_INSPECTOR_CONF_FILE=$IRONIC_INSPECTOR_CONF_DIR/inspector.conf
14 16
 IRONIC_INSPECTOR_CMD="$IRONIC_INSPECTOR_BIN_FILE --config-file $IRONIC_INSPECTOR_CONF_FILE"
17
+IRONIC_INSPECTOR_CMD_API="$IRONIC_INSPECTOR_BIN_FILE_API -p 5050 -- --config-file $IRONIC_INSPECTOR_CONF_FILE"
18
+IRONIC_INSPECTOR_CMD_CONDUCTOR="$IRONIC_INSPECTOR_BIN_FILE_CONDUCTOR --config-file $IRONIC_INSPECTOR_CONF_FILE"
15 19
 IRONIC_INSPECTOR_DHCP_CONF_FILE=$IRONIC_INSPECTOR_CONF_DIR/dnsmasq.conf
16 20
 IRONIC_INSPECTOR_ROOTWRAP_CONF_FILE=$IRONIC_INSPECTOR_CONF_DIR/rootwrap.conf
17 21
 IRONIC_INSPECTOR_ADMIN_USER=${IRONIC_INSPECTOR_ADMIN_USER:-ironic-inspector}
18 22
 IRONIC_INSPECTOR_AUTH_CACHE_DIR=${IRONIC_INSPECTOR_AUTH_CACHE_DIR:-/var/cache/ironic-inspector}
19 23
 IRONIC_INSPECTOR_DHCP_FILTER=${IRONIC_INSPECTOR_DHCP_FILTER:-iptables}
24
+IRONIC_INSPECTOR_STANDALONE=${IRONIC_INSPECTOR_STANDALONE:-True}
20 25
 if [[ -n ${IRONIC_INSPECTOR_MANAGE_FIREWALL} ]] ; then
21 26
     echo "IRONIC_INSPECTOR_MANAGE_FIREWALL is deprecated." >&2
22 27
     echo "Please, use IRONIC_INSPECTOR_DHCP_FILTER == noop/iptables/dnsmasq instead." >&2
@@ -118,7 +123,12 @@ function install_inspector_client {
118 123
 }
119 124
 
120 125
 function start_inspector {
121
-    run_process ironic-inspector "$IRONIC_INSPECTOR_CMD"
126
+    if [[ "$IRONIC_INSPECTOR_STANDALONE" == "True" ]]; then
127
+        run_process ironic-inspector "$IRONIC_INSPECTOR_CMD"
128
+    else
129
+        run_process ironic-inspector-api "$IRONIC_INSPECTOR_CMD_API"
130
+        run_process ironic-inspector-conductor "$IRONIC_INSPECTOR_CMD_CONDUCTOR"
131
+    fi
122 132
 }
123 133
 
124 134
 function is_inspector_dhcp_required {
@@ -134,7 +144,12 @@ function start_inspector_dhcp {
134 144
 }
135 145
 
136 146
 function stop_inspector {
137
-    stop_process ironic-inspector
147
+    if [[ "$IRONIC_INSPECTOR_STANDALONE" == "True" ]]; then
148
+        stop_process ironic-inspector
149
+    else
150
+        stop_process ironic-inspector-api
151
+        stop_process ironic-inspector-conductor
152
+    fi
138 153
 }
139 154
 
140 155
 function stop_inspector_dhcp {
@@ -265,6 +280,7 @@ function configure_inspector {
265 280
     rm -f "$IRONIC_INSPECTOR_CONF_FILE"
266 281
 
267 282
     inspector_iniset DEFAULT debug $IRONIC_INSPECTOR_DEBUG
283
+    inspector_iniset DEFAULT standalone $IRONIC_INSPECTOR_STANDALONE
268 284
     inspector_configure_auth_for ironic
269 285
     inspector_configure_auth_for service_catalog
270 286
     configure_auth_token_middleware $IRONIC_INSPECTOR_CONF_FILE $IRONIC_INSPECTOR_ADMIN_USER $IRONIC_INSPECTOR_AUTH_CACHE_DIR/api
@@ -284,6 +300,12 @@ function configure_inspector {
284 300
 
285 301
     iniset_rpc_backend ironic-inspector $IRONIC_INSPECTOR_CONF_FILE
286 302
 
303
+    if [[ "$IRONIC_INSPECTOR_STANDALONE" == "False" ]]; then
304
+      # memcached listens localhost instead of $SERVICE_HOST, which is exactly the default value,
305
+      # but set explicitly in case that changed.
306
+      inspector_iniset coordination backend_url "memcached://localhost:11211"
307
+    fi
308
+
287 309
     if is_service_enabled swift; then
288 310
         configure_inspector_swift
289 311
     fi

+ 1
- 0
lower-constraints.txt View File

@@ -89,6 +89,7 @@ pycodestyle==2.3.1
89 89
 pyflakes==0.8.1
90 90
 Pygments==2.2.0
91 91
 pyinotify==0.9.6
92
+pymemcache==1.2.9
92 93
 pyparsing==2.2.0
93 94
 pyperclip==1.6.0
94 95
 python-dateutil==2.7.0

+ 1
- 0
test-requirements.txt View File

@@ -11,6 +11,7 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
11 11
 sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
12 12
 openstackdocstheme>=1.18.1 # Apache-2.0
13 13
 os-api-ref>=1.4.0 # Apache-2.0
14
+pymemcache!=1.3.0,>=1.2.9 # Apache 2.0 License
14 15
 stestr>=1.0.0 # Apache-2.0
15 16
 reno>=2.5.0 # Apache-2.0
16 17
 fixtures>=3.0.0 # Apache-2.0/BSD

+ 19
- 0
zuul.d/ironic-inspector-jobs.yaml View File

@@ -49,6 +49,25 @@
49 49
       devstack_localrc:
50 50
         USE_PYTHON3: True
51 51
 
52
+- job:
53
+    name: ironic-inspector-non-standalone-tempest-python3
54
+    description: Execute python3 tempest tests for ironic-inspector running in non-standalone mode
55
+    parent: ironic-inspector-base
56
+    vars:
57
+      devstack_localrc:
58
+        USE_PYTHON3: True
59
+        IRONIC_INSPECTOR_STANDALONE: False
60
+      devstack_services:
61
+        s-account: True
62
+        s-container: True
63
+        s-object: True
64
+        s-proxy: True
65
+        ir-api: True
66
+        ir-cond: True
67
+        ironic-inspector-api: True
68
+        ironic-inspector-conductor: True
69
+        ironic-inspector-dhcp: True
70
+
52 71
 - job:
53 72
     name: ironic-inspector-tempest-discovery
54 73
     description: ironic-inspector-tempest-discovery

+ 2
- 0
zuul.d/project.yaml View File

@@ -13,6 +13,7 @@
13 13
         - ironic-inspector-tempest
14 14
         - ironic-inspector-tempest-discovery
15 15
         - ironic-inspector-tempest-python3
16
+        - ironic-inspector-non-standalone-tempest-python3
16 17
         - openstack-tox-functional
17 18
         - openstack-tox-functional-py36
18 19
         - bifrost-integration-tinyipa-ubuntu-xenial
@@ -25,6 +26,7 @@
25 26
         - ironic-inspector-tempest
26 27
         - ironic-inspector-tempest-discovery
27 28
         - ironic-inspector-tempest-python3
29
+        - ironic-inspector-non-standalone-tempest-python3
28 30
         - openstack-tox-functional
29 31
         - openstack-tox-functional-py36
30 32
         - bifrost-integration-tinyipa-ubuntu-xenial

Loading…
Cancel
Save