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/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 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).