Work around gate breakage

This is merged from three cherry-picked patches, all needed in order to
pass gate testing. Make neutron-grenade non-voting in gate because
dropping it there would be complicated.

Use packaged uwsgi on Fedora and Ubuntu

Building uwsgi from source was a workaround that was introduced a long
time ago, it doesn't seem like it is needed anymore and will actually
fail for Ubuntu 20.04.

Also it doesn't match what will happen for most real-world
installations, so let's try to get back to using distro packages. We'll
still use the source install for RHEL/Centos, it remains to be tested
whether we can get back to using distro versions there, too.

Use uwsgi binary from path

All these uwsgi invocations assume that the uwsgi binary is in the
same directory as their project binaries are installed into (probably
/usr/bin).  That may not be correct -- for example if using a packaged
uwsgi on Fedora the binary will live in /usr/sbin/uwsgi (not /usr/bin
where the project files from pip are).

Switch invocations to just find it in the path.

Related-Bug: 1883468
Change-Id: I82f539bfa533349293dd5a8ce309c9cc0ffb0393
(cherry picked from commit 2d903568ed)
(cherry picked from commit 84737ebd96)
(cherry picked from commit 312517d510)
This commit is contained in:
Jens Harbott
2020-06-15 09:48:46 +02:00
parent ab86ced64c
commit 5c07f3b1b5
9 changed files with 67 additions and 36 deletions

View File

@@ -614,7 +614,8 @@
check: check:
jobs: jobs:
- devstack - devstack
- devstack-xenial - devstack-xenial:
voting: false
- devstack-ipv6: - devstack-ipv6:
voting: false voting: false
- devstack-platform-centos-7 - devstack-platform-centos-7
@@ -622,7 +623,8 @@
- devstack-platform-fedora-latest - devstack-platform-fedora-latest
- devstack-platform-xenial - devstack-platform-xenial
- devstack-multinode - devstack-multinode
- devstack-multinode-xenial - devstack-multinode-xenial:
voting: false
- devstack-unit-tests - devstack-unit-tests
- openstack-tox-bashate - openstack-tox-bashate
- ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa: - ironic-tempest-ipa-wholedisk-bios-agent_ipmitool-tinyipa:
@@ -633,10 +635,12 @@
- ^.*\.rst$ - ^.*\.rst$
- ^doc/.*$ - ^doc/.*$
- neutron-grenade: - neutron-grenade:
voting: false
irrelevant-files: irrelevant-files:
- ^.*\.rst$ - ^.*\.rst$
- ^doc/.*$ - ^doc/.*$
- neutron-grenade-multinode: - neutron-grenade-multinode:
voting: false
irrelevant-files: irrelevant-files:
- ^.*\.rst$ - ^.*\.rst$
- ^doc/.*$ - ^doc/.*$
@@ -652,20 +656,21 @@
gate: gate:
jobs: jobs:
- devstack - devstack
- devstack-xenial # - devstack-xenial
- devstack-multinode - devstack-multinode
- devstack-multinode-xenial # - devstack-multinode-xenial
- devstack-unit-tests - devstack-unit-tests
- openstack-tox-bashate - openstack-tox-bashate
- neutron-grenade-multinode: # - neutron-grenade-multinode:
irrelevant-files: # irrelevant-files:
- ^.*\.rst$ # - ^.*\.rst$
- ^doc/.*$ # - ^doc/.*$
- neutron-tempest-linuxbridge: - neutron-tempest-linuxbridge:
irrelevant-files: irrelevant-files:
- ^.*\.rst$ - ^.*\.rst$
- ^doc/.*$ - ^doc/.*$
- neutron-grenade: - neutron-grenade:
voting: false
irrelevant-files: irrelevant-files:
- ^.*\.rst$ - ^.*\.rst$
- ^doc/.*$ - ^doc/.*$

View File

@@ -82,26 +82,52 @@ function install_apache_uwsgi {
apxs="apxs" apxs="apxs"
fi fi
# Ubuntu xenial is back level on uwsgi so the proxy doesn't # This varies based on packaged/installed. If we've
# actually work. Hence we have to build from source for now. # pip_installed, then the pip setup will only build a "python"
# module that will be either python2 or python3 depending on what
# it was built with.
# #
# Centos 7 actually has the module in epel, but there was a big # For package installs, the distro ships both plugins and you need
# push to disable epel by default. As such, compile from source # to select the right one ... it will not be autodetected.
# there as well. if python3_enabled; then
UWSGI_PYTHON_PLUGIN=python3
else
UWSGI_PYTHON_PLUGIN=python
fi
local dir if is_ubuntu; then
dir=$(mktemp -d) install_package uwsgi \
pushd $dir uwsgi-plugin-python \
pip_install uwsgi uwsgi-plugin-python3 \
pip download uwsgi -c $REQUIREMENTS_DIR/upper-constraints.txt libapache2-mod-proxy-uwsgi
local uwsgi elif [[ $os_VENDOR == "Fedora" ]]; then
uwsgi=$(ls uwsgi*) # Note httpd comes with mod_proxy_uwsgi and it is loaded by
tar xvf $uwsgi # default; the mod_proxy_uwsgi package actually conflicts now.
cd uwsgi*/apache2 # See:
sudo $apxs -i -c mod_proxy_uwsgi.c # https://bugzilla.redhat.com/show_bug.cgi?id=1574335
popd #
# delete the temp directory # Thus there is nothing else to do after this install
sudo rm -rf $dir install_package uwsgi \
uwsgi-plugin-python3
else
# Centos actually has the module in epel, but there was a big
# push to disable epel by default. As such, compile from source
# there.
local dir
dir=$(mktemp -d)
pushd $dir
pip_install uwsgi
pip download uwsgi -c $REQUIREMENTS_DIR/upper-constraints.txt
local uwsgi
uwsgi=$(ls uwsgi*)
tar xvf $uwsgi
cd uwsgi*/apache2
sudo $apxs -i -c mod_proxy_uwsgi.c
popd
# delete the temp directory
sudo rm -rf $dir
UWSGI_PYTHON_PLUGIN=python
fi
if is_ubuntu || is_suse ; then if is_ubuntu || is_suse ; then
# we've got to enable proxy and proxy_uwsgi for this to work # we've got to enable proxy and proxy_uwsgi for this to work
@@ -265,7 +291,7 @@ function write_uwsgi_config {
# configured after graceful shutdown # configured after graceful shutdown
iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT
iniset "$file" uwsgi enable-threads true iniset "$file" uwsgi enable-threads true
iniset "$file" uwsgi plugins python iniset "$file" uwsgi plugins http,${UWSGI_PYTHON_PLUGIN}
# uwsgi recommends this to prevent thundering herd on accept. # uwsgi recommends this to prevent thundering herd on accept.
iniset "$file" uwsgi thunder-lock true iniset "$file" uwsgi thunder-lock true
# Set hook to trigger graceful shutdown on SIGTERM # Set hook to trigger graceful shutdown on SIGTERM
@@ -318,7 +344,7 @@ function write_local_uwsgi_http_config {
iniset "$file" uwsgi die-on-term true iniset "$file" uwsgi die-on-term true
iniset "$file" uwsgi exit-on-reload false iniset "$file" uwsgi exit-on-reload false
iniset "$file" uwsgi enable-threads true iniset "$file" uwsgi enable-threads true
iniset "$file" uwsgi plugins python iniset "$file" uwsgi plugins http,${UWSGI_PYTHON_PLUGIN}
# uwsgi recommends this to prevent thundering herd on accept. # uwsgi recommends this to prevent thundering herd on accept.
iniset "$file" uwsgi thunder-lock true iniset "$file" uwsgi thunder-lock true
# Set hook to trigger graceful shutdown on SIGTERM # Set hook to trigger graceful shutdown on SIGTERM

View File

@@ -507,7 +507,7 @@ function start_cinder {
start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT
fi fi
else else
run_process "c-api" "$CINDER_BIN_DIR/uwsgi --procname-prefix cinder-api --ini $CINDER_UWSGI_CONF" run_process "c-api" "$(which uwsgi) --procname-prefix cinder-api --ini $CINDER_UWSGI_CONF"
cinder_url=$service_protocol://$SERVICE_HOST/volume/v3 cinder_url=$service_protocol://$SERVICE_HOST/volume/v3
fi fi
fi fi

View File

@@ -343,7 +343,7 @@ function start_glance {
run_process g-reg "$GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf" run_process g-reg "$GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
if [[ "$WSGI_MODE" == "uwsgi" ]]; then if [[ "$WSGI_MODE" == "uwsgi" ]]; then
run_process g-api "$GLANCE_BIN_DIR/uwsgi --procname-prefix glance-api --ini $GLANCE_UWSGI_CONF" run_process g-api "$(which uwsgi) --procname-prefix glance-api --ini $GLANCE_UWSGI_CONF"
else else
run_process g-api "$GLANCE_BIN_DIR/glance-api --config-dir=$GLANCE_CONF_DIR" run_process g-api "$GLANCE_BIN_DIR/glance-api --config-dir=$GLANCE_CONF_DIR"
fi fi

View File

@@ -518,7 +518,7 @@ function start_keystone {
enable_apache_site keystone enable_apache_site keystone
restart_apache_server restart_apache_server
else # uwsgi else # uwsgi
run_process keystone "$KEYSTONE_BIN_DIR/uwsgi --procname-prefix keystone --ini $KEYSTONE_PUBLIC_UWSGI_CONF" "" run_process keystone "$(which uwsgi) --procname-prefix keystone --ini $KEYSTONE_PUBLIC_UWSGI_CONF" ""
fi fi
echo "Waiting for keystone to start..." echo "Waiting for keystone to start..."

View File

@@ -460,7 +460,7 @@ function start_neutron_api {
done done
if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
run_process neutron-api "$NEUTRON_BIN_DIR/uwsgi --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF" run_process neutron-api "$(which uwsgi) --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
neutron_url=$service_protocol://$NEUTRON_SERVICE_HOST/networking/ neutron_url=$service_protocol://$NEUTRON_SERVICE_HOST/networking/
enable_service neutron-rpc-server enable_service neutron-rpc-server
run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $opts" run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $opts"

View File

@@ -486,7 +486,7 @@ function start_neutron_service_and_check {
# Start the Neutron service # Start the Neutron service
if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
enable_service neutron-api enable_service neutron-api
run_process neutron-api "$NEUTRON_BIN_DIR/uwsgi --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF" run_process neutron-api "$(which uwsgi) --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
neutron_url=$Q_PROTOCOL://$Q_HOST/networking/ neutron_url=$Q_PROTOCOL://$Q_HOST/networking/
enable_service neutron-rpc-server enable_service neutron-rpc-server
run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $cfg_file_options" run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $cfg_file_options"

View File

@@ -904,7 +904,7 @@ function start_nova_api {
start_tls_proxy nova '*' $NOVA_SERVICE_PORT $NOVA_SERVICE_HOST $NOVA_SERVICE_PORT_INT start_tls_proxy nova '*' $NOVA_SERVICE_PORT $NOVA_SERVICE_HOST $NOVA_SERVICE_PORT_INT
fi fi
else else
run_process "n-api" "$NOVA_BIN_DIR/uwsgi --procname-prefix nova-api --ini $NOVA_UWSGI_CONF" run_process "n-api" "$(which uwsgi) --procname-prefix nova-api --ini $NOVA_UWSGI_CONF"
nova_url=$service_protocol://$SERVICE_HOST/compute/v2.1/ nova_url=$service_protocol://$SERVICE_HOST/compute/v2.1/
fi fi
@@ -1020,7 +1020,7 @@ function start_nova_rest {
if [ "$NOVA_USE_MOD_WSGI" == "False" ]; then if [ "$NOVA_USE_MOD_WSGI" == "False" ]; then
run_process n-api-meta "$NOVA_BIN_DIR/nova-api-metadata --config-file $compute_cell_conf" run_process n-api-meta "$NOVA_BIN_DIR/nova-api-metadata --config-file $compute_cell_conf"
else else
run_process n-api-meta "$NOVA_BIN_DIR/uwsgi --procname-prefix nova-api-meta --ini $NOVA_METADATA_UWSGI_CONF" run_process n-api-meta "$(which uwsgi) --procname-prefix nova-api-meta --ini $NOVA_METADATA_UWSGI_CONF"
fi fi
# nova-consoleauth always runs globally # nova-consoleauth always runs globally

View File

@@ -154,7 +154,7 @@ function install_placement {
# start_placement_api() - Start the API processes ahead of other things # start_placement_api() - Start the API processes ahead of other things
function start_placement_api { function start_placement_api {
if [[ "$WSGI_MODE" == "uwsgi" ]]; then if [[ "$WSGI_MODE" == "uwsgi" ]]; then
run_process "placement-api" "$PLACEMENT_BIN_DIR/uwsgi --procname-prefix placement --ini $PLACEMENT_UWSGI_CONF" run_process "placement-api" "$(which uwsgi) --procname-prefix placement --ini $PLACEMENT_UWSGI_CONF"
else else
enable_apache_site placement-api enable_apache_site placement-api
restart_apache_server restart_apache_server