Files
designate/devstack/lib/wsgi
Michael Johnson e6d83dfcf7 Add wsgi module to Designate and remove wsgi script
Changes in python packaging tooling mean that the wsgi_scripts
functionality via PBR may not longer function.

This patch switches Designate from using the PBR wsgi_scripts method to
using a new wsgi module that provides the same behavior as the generated
wsgi scripts provided.

A related devstack patch enables devstack to setup uWSGI to use the new
module path instead of the generated wsgi scripts.

This also aligns Designate to a new proposed OpenStack goal[1].

[1] https://review.opendev.org/c/openstack/governance/+/902807

In order to make the CI work, this patch was merged with:

zuul: Drop centos9 and make grenade non-voting

The requirements repo has dropped upper-constraints for python3.9, so
the centos9-based jobs are no longer working on master, let's drop them.

Also the grenade jobs are broken due to the referenced bug, make them
temporarily non-voting, so that we can merge the fix[0] on master first,
backport it, and then re-enable them.

[0] https://review.opendev.org/c/openstack/designate/+/902846

Related-Bug: 2109577
Depends-On: https://review.opendev.org/c/openstack/devstack/+/902758
Change-Id: If90056ae1de4a6a3557fc870497e6233088bfb02
2025-04-29 15:09:33 +00:00

41 lines
1.5 KiB
Bash

#!/usr/bin/env bash
function designate_configure_uwsgi {
write_uwsgi_config "$DESIGNATE_UWSGI_CONF" "$DESIGNATE_UWSGI" "/dns" "" "designate-api-wsgi"
# We are using the http transport to work around an issue with
# broken connections when using the uwsgi protocol of a local socket
# See bug: https://github.com/unbit/uwsgi/issues/2368
enable_apache_mod proxy
enable_apache_mod proxy_http
wsgi_conf=$(apache_site_config_for designate-api-wsgi)
echo 'ProxyPass "/dns" "http://127.0.0.1:60053" retry=0' | sudo tee $wsgi_conf
iniset $DESIGNATE_UWSGI_CONF uwsgi http-socket 127.0.0.1:60053
}
function designate_configure_mod_wsgi {
local designate_api_apache_conf
local venv_path=""
local designate_bin_dir=""
designate_bin_dir=$(get_python_exec_prefix)
designate_api_apache_conf=$(apache_site_config_for designate-api)
if [[ ${USE_VENV} = True ]]; then
venv_path="python-path=${PROJECT_VENV["designate"]}/lib/$(python_version)/site-packages"
designate_bin_dir=${PROJECT_VENV["designate"]}/bin
fi
sudo cp $DESIGNATE_DIR/devstack/files/apache-designate-api.template $designate_api_apache_conf
sudo sed -e "
s|%APACHE_NAME%|$APACHE_NAME|g;
s|%DESIGNATE_BIN_DIR%|$designate_bin_dir|g;
s|%SSLENGINE%|$designate_ssl|g;
s|%SSLCERTFILE%|$designate_certfile|g;
s|%SSLKEYFILE%|$designate_keyfile|g;
s|%USER%|$STACK_USER|g;
s|%VIRTUALENV%|$venv_path|g;
s|%APIWORKERS%|$API_WORKERS|g;
" -i $designate_api_apache_conf
}