From 761b51eed18b89ee667fc1d564c7e2b333fb5f82 Mon Sep 17 00:00:00 2001 From: Ivan Anfimov Date: Tue, 29 Apr 2025 19:54:05 +0000 Subject: [PATCH 1/2] Remove tags from README The tags framework has been discontinued for a long time. https://governance.openstack.org/tc/reference/tags/ https://governance.openstack.org/tc/resolutions/20211224-tags-framework-removal.html Change-Id: I0c8789806dd3a9b18706eaf4b19cf0e4fe7533e7 --- README.rst | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 253594eb..2ac032cc 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,11 @@ -======================== -Team and repository tags -======================== +========== +CloudKitty +========== .. image:: https://governance.openstack.org/tc/badges/cloudkitty.svg - :target: https://governance.openstack.org/tc/reference/tags/index.html .. Change things from this point on -========== -CloudKitty -========== - .. image:: doc/source/images/cloudkitty-logo.png :alt: cloudkitty :align: center From 2a29211052e74199278c42457243054465bc6c77 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 13 May 2025 09:20:18 +0200 Subject: [PATCH 2/2] Add wsgi module to cloudkitty Changes in python packaging tooling mean that the wsgi_scripts functionality via PBR may not longer function. This patch switches cloudkitty 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. For more details see the proposed OpenStack goal [1]. Make grenade job non-voting until backport to stable/2025.1. [1] https://review.opendev.org/c/openstack/governance/+/902807 Change-Id: Id38cfa97699f01be89b37a9ee7a9e3253925e187 --- .zuul.yaml | 4 +-- cloudkitty/wsgi/__init__.py | 0 cloudkitty/wsgi/api.py | 24 +++++++++++++++ devstack/plugin.sh | 2 +- .../remove-wsgi-scripts-27d0da6926c2127c.yaml | 29 +++++++++++++++++++ 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 cloudkitty/wsgi/__init__.py create mode 100644 cloudkitty/wsgi/api.py create mode 100644 releasenotes/notes/remove-wsgi-scripts-27d0da6926c2127c.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 6bca6805..db2b2a58 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -201,7 +201,8 @@ - cloudkitty-tempest-full-ipv6-only - cloudkitty-tox-bandit: voting: false - - cloudkitty-grenade-job + - cloudkitty-grenade-job: + voting: false gate: jobs: - cloudkitty-tempest-full-v2-storage-influxdb @@ -211,4 +212,3 @@ - cloudkitty-tempest-full-v2-storage-opensearch - cloudkitty-tempest-full-v1-storage-sqlalchemy - cloudkitty-tempest-full-ipv6-only - - cloudkitty-grenade-job diff --git a/cloudkitty/wsgi/__init__.py b/cloudkitty/wsgi/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cloudkitty/wsgi/api.py b/cloudkitty/wsgi/api.py new file mode 100644 index 00000000..22c3e68a --- /dev/null +++ b/cloudkitty/wsgi/api.py @@ -0,0 +1,24 @@ +# 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 the CloudKitty API.""" + +import threading + +from cloudkitty.api import app + +application = None + +lock = threading.Lock() +with lock: + if application is None: + application = app.build_wsgi_app() diff --git a/devstack/plugin.sh b/devstack/plugin.sh index e2f87f91..1406c462 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -37,7 +37,7 @@ if [[ -d $CLOUDKITTY_DIR/bin ]]; then else CLOUDKITTY_BIN_DIR=$(get_python_exec_prefix) fi -CLOUDKITTY_UWSGI=$CLOUDKITTY_BIN_DIR/cloudkitty-api +CLOUDKITTY_UWSGI=cloudkitty.wsgi.api:application if [ ${CLOUDKITTY_USE_UWSGI,,} == 'true' ]; then CLOUDKITTY_ENDPOINT=$CLOUDKITTY_SERVICE_PROTOCOL://$CLOUDKITTY_SERVICE_HOST/rating else diff --git a/releasenotes/notes/remove-wsgi-scripts-27d0da6926c2127c.yaml b/releasenotes/notes/remove-wsgi-scripts-27d0da6926c2127c.yaml new file mode 100644 index 00000000..7143218e --- /dev/null +++ b/releasenotes/notes/remove-wsgi-scripts-27d0da6926c2127c.yaml @@ -0,0 +1,29 @@ +--- +features: + - | + A new module, ``cloudkitty.wsgi``, has been added as a place to gather WSGI + ``application`` objects. This is intended to ease deployment by providing a + consistent location for these objects. For example, if using uWSGI then + instead of: + + .. code-block:: ini + + [uwsgi] + wsgi-file = /bin/cloudkitty-api + + You can now use: + + .. code-block:: ini + + [uwsgi] + module = cloudkitty.wsgi.api:application + + This also simplifies deployment with other WSGI servers that expect module + paths such as gunicorn. +upgrade: + - | + The WSGI script ``cloudkitty-api`` has been removed. Deployment tooling + should instead reference the Python module path for the wsgi module in + CloudKitty, ``cloudkitty.wsgi.api:application`` if their chosen WSGI server + supports this (gunicorn, uWSGI, etc.) or implement a .wsgi script + themselves if not (mod_wsgi).