Merge "Enable WSGI module entrypoint for Ironic"

This commit is contained in:
Zuul 2024-10-30 18:16:11 +00:00 committed by Gerrit Code Review
commit 8ba066b33c
5 changed files with 51 additions and 4 deletions

View File

@ -411,7 +411,7 @@ fi
# Support entry points installation of console scripts
IRONIC_BIN_DIR=$(get_python_exec_prefix)
IRONIC_UWSGI_CONF=$IRONIC_CONF_DIR/ironic-uwsgi.ini
IRONIC_UWSGI=$IRONIC_BIN_DIR/ironic-api-wsgi
IRONIC_UWSGI=${IRONIC_UWSGI:-ironic.wsgi:application}
# Lets support IPv6 testing!
IRONIC_IP_VERSION=${IRONIC_IP_VERSION:-${IP_VERSION:-4}}
@ -1663,7 +1663,7 @@ function configure_ironic {
fi
# Adds uWSGI for Ironic API
write_uwsgi_config "$IRONIC_UWSGI_CONF" "$IRONIC_UWSGI" "/baremetal"
write_uwsgi_config "$IRONIC_UWSGI_CONF" "$IRONIC_UWSGI" "/baremetal" "" "ironic-api"
if [[ "$os_VENDOR" =~ (Debian|Ubuntu) ]]; then
# The groups change with newer libvirt. Older Ubuntu used

View File

@ -32,7 +32,9 @@ sys.path.insert(0, os.path.join(os.path.abspath('.'), '_exts'))
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.viewcode',
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.viewcode',
'sphinx.ext.graphviz',
'sphinxcontrib.apidoc',
'sphinxcontrib.rsvgconverter',
@ -62,6 +64,10 @@ autodoc_default_options = {
'special-members': '__call__',
}
autosummary_mock_imports = [
'ironic.wsgi',
]
redfish_interop_source = \
'../../redfish-interop-profiles/OpenStackIronicProfile.v1_1_0.json'
redfish_interop_output_dir = 'admin/drivers/redfish/'

23
ironic/wsgi/__init__.py Normal file
View File

@ -0,0 +1,23 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""WSGI application entry-point for Ironic API."""
import threading
from ironic.api import wsgi
application = None
lock = threading.Lock()
with lock:
if application is None:
application = wsgi.initialize_wsgi_app()

View File

@ -0,0 +1,18 @@
features:
- |
A new module, ``ironic.wsgi`` has been enabled as an entrypoint for WSGI
runners. For example, if using uWSGI then now instead of:
.. code-block:: ini
[uwsgi]
wsgi-file = /bin/ironic-api-wsgi
You can now use:
.. code-block:: ini
[uwsgi]
module = ironic.wsgi:application
Legacy installed wsgi scripts will be removed in a future version of Ironic.

View File

@ -100,7 +100,7 @@ commands = sphinx-build -b html doc/source doc/build/html
allowlist_externals = make
deps = {[testenv:docs]deps}
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
sphinx-build -b latex doc/source doc/build/pdf
make -C doc/build/pdf