From 9b92204ef1c0871889b0f861d33d38c14388347e Mon Sep 17 00:00:00 2001 From: Kaifeng Wang Date: Wed, 7 Aug 2019 13:39:57 +0800 Subject: [PATCH] Adds job to run inspector in non-standalone mode The job uses memcached for coordination backend, etcd3gw still has issue on retrieving members. Story: 2001842 Task: 30376 Change-Id: I76c359d6835e435968cbfb1a3f4318e73f0203ec --- devstack/plugin.sh | 26 ++++++++++++++++++++++++-- lower-constraints.txt | 1 + test-requirements.txt | 1 + zuul.d/ironic-inspector-jobs.yaml | 19 +++++++++++++++++++ zuul.d/project.yaml | 2 ++ 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 7e49d0a91..da6b56831 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -8,15 +8,20 @@ IRONIC_INSPECTOR_DIR=$DEST/ironic-inspector IRONIC_INSPECTOR_DATA_DIR=$DATA_DIR/ironic-inspector IRONIC_INSPECTOR_BIN_DIR=$(get_python_exec_prefix) IRONIC_INSPECTOR_BIN_FILE=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector +IRONIC_INSPECTOR_BIN_FILE_API=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector-api-wsgi +IRONIC_INSPECTOR_BIN_FILE_CONDUCTOR=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector-conductor IRONIC_INSPECTOR_DBSYNC_BIN_FILE=$IRONIC_INSPECTOR_BIN_DIR/ironic-inspector-dbsync IRONIC_INSPECTOR_CONF_DIR=${IRONIC_INSPECTOR_CONF_DIR:-/etc/ironic-inspector} IRONIC_INSPECTOR_CONF_FILE=$IRONIC_INSPECTOR_CONF_DIR/inspector.conf IRONIC_INSPECTOR_CMD="$IRONIC_INSPECTOR_BIN_FILE --config-file $IRONIC_INSPECTOR_CONF_FILE" +IRONIC_INSPECTOR_CMD_API="$IRONIC_INSPECTOR_BIN_FILE_API -p 5050 -- --config-file $IRONIC_INSPECTOR_CONF_FILE" +IRONIC_INSPECTOR_CMD_CONDUCTOR="$IRONIC_INSPECTOR_BIN_FILE_CONDUCTOR --config-file $IRONIC_INSPECTOR_CONF_FILE" IRONIC_INSPECTOR_DHCP_CONF_FILE=$IRONIC_INSPECTOR_CONF_DIR/dnsmasq.conf IRONIC_INSPECTOR_ROOTWRAP_CONF_FILE=$IRONIC_INSPECTOR_CONF_DIR/rootwrap.conf IRONIC_INSPECTOR_ADMIN_USER=${IRONIC_INSPECTOR_ADMIN_USER:-ironic-inspector} IRONIC_INSPECTOR_AUTH_CACHE_DIR=${IRONIC_INSPECTOR_AUTH_CACHE_DIR:-/var/cache/ironic-inspector} IRONIC_INSPECTOR_DHCP_FILTER=${IRONIC_INSPECTOR_DHCP_FILTER:-iptables} +IRONIC_INSPECTOR_STANDALONE=${IRONIC_INSPECTOR_STANDALONE:-True} if [[ -n ${IRONIC_INSPECTOR_MANAGE_FIREWALL} ]] ; then echo "IRONIC_INSPECTOR_MANAGE_FIREWALL is deprecated." >&2 echo "Please, use IRONIC_INSPECTOR_DHCP_FILTER == noop/iptables/dnsmasq instead." >&2 @@ -118,7 +123,12 @@ function install_inspector_client { } function start_inspector { - run_process ironic-inspector "$IRONIC_INSPECTOR_CMD" + if [[ "$IRONIC_INSPECTOR_STANDALONE" == "True" ]]; then + run_process ironic-inspector "$IRONIC_INSPECTOR_CMD" + else + run_process ironic-inspector-api "$IRONIC_INSPECTOR_CMD_API" + run_process ironic-inspector-conductor "$IRONIC_INSPECTOR_CMD_CONDUCTOR" + fi } function is_inspector_dhcp_required { @@ -134,7 +144,12 @@ function start_inspector_dhcp { } function stop_inspector { - stop_process ironic-inspector + if [[ "$IRONIC_INSPECTOR_STANDALONE" == "True" ]]; then + stop_process ironic-inspector + else + stop_process ironic-inspector-api + stop_process ironic-inspector-conductor + fi } function stop_inspector_dhcp { @@ -265,6 +280,7 @@ function configure_inspector { rm -f "$IRONIC_INSPECTOR_CONF_FILE" inspector_iniset DEFAULT debug $IRONIC_INSPECTOR_DEBUG + inspector_iniset DEFAULT standalone $IRONIC_INSPECTOR_STANDALONE inspector_configure_auth_for ironic inspector_configure_auth_for service_catalog configure_auth_token_middleware $IRONIC_INSPECTOR_CONF_FILE $IRONIC_INSPECTOR_ADMIN_USER $IRONIC_INSPECTOR_AUTH_CACHE_DIR/api @@ -280,6 +296,12 @@ function configure_inspector { iniset_rpc_backend ironic-inspector $IRONIC_INSPECTOR_CONF_FILE + if [[ "$IRONIC_INSPECTOR_STANDALONE" == "False" ]]; then + # memcached listens localhost instead of $SERVICE_HOST, which is exactly the default value, + # but set explicitly in case that changed. + inspector_iniset coordination backend_url "memcached://localhost:11211" + fi + if is_service_enabled swift; then configure_inspector_swift fi diff --git a/lower-constraints.txt b/lower-constraints.txt index 144e333d5..b2d980eb4 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -89,6 +89,7 @@ pycodestyle==2.3.1 pyflakes==0.8.1 Pygments==2.2.0 pyinotify==0.9.6 +pymemcache==1.2.9 pyparsing==2.2.0 pyperclip==1.6.0 python-dateutil==2.7.0 diff --git a/test-requirements.txt b/test-requirements.txt index 4af9b6252..edc1c2284 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,6 +11,7 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD openstackdocstheme>=1.18.1 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0 +pymemcache!=1.3.0,>=1.2.9 # Apache 2.0 License stestr>=1.0.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/zuul.d/ironic-inspector-jobs.yaml b/zuul.d/ironic-inspector-jobs.yaml index dbcfe1933..4f4236777 100644 --- a/zuul.d/ironic-inspector-jobs.yaml +++ b/zuul.d/ironic-inspector-jobs.yaml @@ -49,6 +49,25 @@ devstack_localrc: USE_PYTHON3: True +- job: + name: ironic-inspector-non-standalone-tempest-python3 + description: Execute python3 tempest tests for ironic-inspector running in non-standalone mode + parent: ironic-inspector-base + vars: + devstack_localrc: + USE_PYTHON3: True + IRONIC_INSPECTOR_STANDALONE: False + devstack_services: + s-account: True + s-container: True + s-object: True + s-proxy: True + ir-api: True + ir-cond: True + ironic-inspector-api: True + ironic-inspector-conductor: True + ironic-inspector-dhcp: True + - job: name: ironic-inspector-tempest-discovery description: ironic-inspector-tempest-discovery diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 4c27c8829..239212874 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -13,6 +13,7 @@ - ironic-inspector-tempest - ironic-inspector-tempest-discovery - ironic-inspector-tempest-python3 + - ironic-inspector-non-standalone-tempest-python3 - openstack-tox-functional - openstack-tox-functional-py36 - bifrost-integration-tinyipa-ubuntu-xenial @@ -25,6 +26,7 @@ - ironic-inspector-tempest - ironic-inspector-tempest-discovery - ironic-inspector-tempest-python3 + - ironic-inspector-non-standalone-tempest-python3 - openstack-tox-functional - openstack-tox-functional-py36 - bifrost-integration-tinyipa-ubuntu-xenial