Change the wsgi path for devstack

Since pip 23.1, the wsgi_script from PBR are not installed anymore
(see [1])

So, instead, rely on the wsgi.py app which is directly bundled in
mistral source code.

[1] https://discuss.python.org/t/adding-support-for-wsgi-scripts-entrypoint/30905/11

Change-Id: Ideed8421427e865f8010b7bfca58c3f010ac6bd6
Signed-off-by: Arnaud M <arnaud.morin@gmail.com>
This commit is contained in:
Arnaud M 2023-11-09 23:15:17 +01:00
parent e343ccb078
commit ecdeadeb7a
4 changed files with 11 additions and 18 deletions

View File

@ -35,3 +35,5 @@ Project Resources
* Source for the project can be found at: * Source for the project can be found at:
https://opendev.org/openstack/mistral https://opendev.org/openstack/mistral
* WSGI app is located in `mistral/api/wsgi.py`

View File

@ -1,9 +1,9 @@
Listen %PUBLICPORT% Listen %PUBLICPORT%
<VirtualHost *:%PUBLICPORT%> <VirtualHost *:%PUBLICPORT%>
WSGIDaemonProcess mistral-api processes=%API_WORKERS% threads=1 user=%USER% display-name=%{GROUP} %VIRTUALENV% WSGIDaemonProcess mistral-api processes=%API_WORKERS% threads=1 user=%USER% display-name=%{GROUP} python-home=%MISTRAL_ENV_DIR%
WSGIProcessGroup mistral-api WSGIProcessGroup mistral-api
WSGIScriptAlias / %MISTRAL_BIN_DIR%/mistral-wsgi-api WSGIScriptAlias / %MISTRAL_DIR%/mistral/api/wsgi.py
WSGIApplicationGroup %{GLOBAL} WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On WSGIPassAuthorization On
AllowEncodedSlashes On AllowEncodedSlashes On
@ -12,11 +12,8 @@ Listen %PUBLICPORT%
</IfVersion> </IfVersion>
ErrorLog /var/log/%APACHE_NAME%/mistral_api.log ErrorLog /var/log/%APACHE_NAME%/mistral_api.log
CustomLog /var/log/%APACHE_NAME%/mistral_api_access.log combined CustomLog /var/log/%APACHE_NAME%/mistral_api_access.log combined
%SSLENGINE%
%SSLCERTFILE%
%SSLKEYFILE%
<Directory %MISTRAL_BIN_DIR%> <Directory %MISTRAL_DIR%/mistral/api/>
<IfVersion >= 2.4> <IfVersion >= 2.4>
Require all granted Require all granted
</IfVersion> </IfVersion>

View File

@ -21,6 +21,10 @@ else
MISTRAL_BIN_DIR=$(get_python_exec_prefix) MISTRAL_BIN_DIR=$(get_python_exec_prefix)
fi fi
# By default, mistral is installed in DEVSTACK_VENV
# NOTE(arnaud) maybe check if PROJECT_VENV should be used here
MISTRAL_ENV_DIR=${DEVSTACK_VENV}
# Toggle for deploying Mistral API under HTTPD + mod_wsgi # Toggle for deploying Mistral API under HTTPD + mod_wsgi
MISTRAL_USE_MOD_WSGI=${MISTRAL_USE_MOD_WSGI:-True} MISTRAL_USE_MOD_WSGI=${MISTRAL_USE_MOD_WSGI:-True}
@ -249,23 +253,16 @@ function _mistral_cleanup_apache_wsgi {
function _config_mistral_apache_wsgi { function _config_mistral_apache_wsgi {
local mistral_apache_conf local mistral_apache_conf
mistral_apache_conf=$(apache_site_config_for mistral-api) mistral_apache_conf=$(apache_site_config_for mistral-api)
local mistral_ssl=""
local mistral_certfile=""
local mistral_keyfile=""
local mistral_api_port=$MISTRAL_SERVICE_PORT local mistral_api_port=$MISTRAL_SERVICE_PORT
local venv_path=""
sudo cp $MISTRAL_FILES_DIR/apache-mistral-api.template $mistral_apache_conf sudo cp $MISTRAL_FILES_DIR/apache-mistral-api.template $mistral_apache_conf
sudo sed -e " sudo sed -e "
s|%PUBLICPORT%|$mistral_api_port|g; s|%PUBLICPORT%|$mistral_api_port|g;
s|%APACHE_NAME%|$APACHE_NAME|g; s|%APACHE_NAME%|$APACHE_NAME|g;
s|%MISTRAL_BIN_DIR%|$MISTRAL_BIN_DIR|g; s|%MISTRAL_DIR%|$MISTRAL_DIR|g;
s|%MISTRAL_ENV_DIR%|$MISTRAL_ENV_DIR|g;
s|%API_WORKERS%|$API_WORKERS|g; s|%API_WORKERS%|$API_WORKERS|g;
s|%SSLENGINE%|$mistral_ssl|g;
s|%SSLCERTFILE%|$mistral_certfile|g;
s|%SSLKEYFILE%|$mistral_keyfile|g;
s|%USER%|$STACK_USER|g; s|%USER%|$STACK_USER|g;
s|%VIRTUALENV%|$venv_path|g
" -i $mistral_apache_conf " -i $mistral_apache_conf
} }

View File

@ -28,9 +28,6 @@ console_scripts =
mistral-server = mistral.cmd.launch:main mistral-server = mistral.cmd.launch:main
mistral-db-manage = mistral.db.sqlalchemy.migration.cli:main mistral-db-manage = mistral.db.sqlalchemy.migration.cli:main
wsgi_scripts =
mistral-wsgi-api = mistral.api.app:init_wsgi
mistral.rpc.backends = mistral.rpc.backends =
oslo_client = mistral.rpc.oslo.oslo_client:OsloRPCClient oslo_client = mistral.rpc.oslo.oslo_client:OsloRPCClient
oslo_server = mistral.rpc.oslo.oslo_server:OsloRPCServer oslo_server = mistral.rpc.oslo.oslo_server:OsloRPCServer