diff --git a/.zuul.yaml b/.zuul.yaml index 08b671d61..ce329ec1e 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -51,16 +51,6 @@ post-run: playbooks/designate-bind9/post.yaml parent: designate-base -- job: - name: designate-bind9-centos9stream-fips - parent: designate-bind9 - nodeset: devstack-single-node-centos-9-stream - description: | - Functional testing for a FIPS enabled Centos 9 stream system - pre-run: playbooks/enable-fips.yaml - vars: - nslookup_target: 'opendev.org' - - job: name: designate-bind9-keystone-old-default-roles post-run: playbooks/designate-bind9/post.yaml @@ -83,15 +73,6 @@ enforce_scope: designate: False -- job: - name: designate-bind9-centos-9-stream - parent: designate-bind9 - nodeset: devstack-single-node-centos-9-stream - vars: - devstack_localrc: - DESIGNATE_COORDINATION_URL: "etcd3+http://{{ hostvars['controller']['nodepool']['private_ipv4'] }}:2379?api_version=v3" - - - job: name: designate-bind9-catalog-zones parent: designate-bind9 @@ -218,14 +199,11 @@ check: jobs: - designate-bind9 - - designate-bind9-centos9stream-fips: - voting: false - - designate-bind9-centos-9-stream: - voting: false - designate-bind9-keystone-old-default-roles - designate-pdns4 - designate-grenade-bind9 - - designate-grenade-pdns4 + - designate-grenade-pdns4: + voting: false - designate-grenade-bind9-skip-level - designate-grenade-pdns4-skip-level - designate-ipv6-only-pdns4 @@ -236,7 +214,6 @@ - designate-bind9 - designate-bind9-keystone-old-default-roles - designate-pdns4 - - designate-grenade-pdns4 - designate-grenade-pdns4-skip-level - designate-ipv6-only-pdns4 - designate-ipv6-only-bind9 diff --git a/designate/wsgi/__init__.py b/designate/wsgi/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/designate/wsgi/api.py b/designate/wsgi/api.py new file mode 100644 index 000000000..b083f1d29 --- /dev/null +++ b/designate/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 Designate API.""" + +import threading + +from designate.api import wsgi + +application = None + +lock = threading.Lock() +with lock: + if application is None: + application = wsgi.init_application() diff --git a/devstack/lib/wsgi b/devstack/lib/wsgi index e16a914eb..661e7acb5 100644 --- a/devstack/lib/wsgi +++ b/devstack/lib/wsgi @@ -1,7 +1,7 @@ #!/usr/bin/env bash function designate_configure_uwsgi { - write_uwsgi_config "$DESIGNATE_UWSGI_CONF" "$DESIGNATE_UWSGI" "/dns" + 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 diff --git a/devstack/settings b/devstack/settings index 3f541a2fd..5c0731127 100644 --- a/devstack/settings +++ b/devstack/settings @@ -60,7 +60,7 @@ DESIGNATE_ROOTWRAP_CONF=$DESIGNATE_CONF_DIR/rootwrap.conf DESIGNATE_APIPASTE_CONF=$DESIGNATE_CONF_DIR/api-paste.ini DESIGNATE_PLUGINS=$DESIGNATE_DIR/devstack/designate_plugins -DESIGNATE_UWSGI=$DESIGNATE_BIN_DIR/designate-api-wsgi +DESIGNATE_UWSGI=designate.wsgi.api:application DESIGNATE_UWSGI_CONF=$DESIGNATE_CONF_DIR/designate-api-uwsgi.ini # Default repositories diff --git a/releasenotes/notes/remove-wsgi-scripts-d848069ac50cf062.yaml b/releasenotes/notes/remove-wsgi-scripts-d848069ac50cf062.yaml new file mode 100644 index 000000000..e010683fd --- /dev/null +++ b/releasenotes/notes/remove-wsgi-scripts-d848069ac50cf062.yaml @@ -0,0 +1,29 @@ +--- +features: + - | + A new module, ``designate.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/designate-api-wsgi + + You can now use: + + .. code-block:: ini + + [uwsgi] + module = designate.wsgi.api:application + + This also simplifies deployment with other WSGI servers that expect module + paths such as gunicorn. +upgrade: + - | + The WSGI script ``designate-api-wsgi`` has been removed. Deployment tooling + should instead reference the Python module path for the wsgi module in + Designate, ``designate.wsgi.api:application`` if their chosen WSGI server + supports this (gunicorn, uWSGI, etc.) or implement a .wsgi script + themselves if not (mod_wsgi). diff --git a/setup.cfg b/setup.cfg index 56c8a35f6..2c379f954 100644 --- a/setup.cfg +++ b/setup.cfg @@ -119,6 +119,3 @@ designate.heartbeat_emitter = designate.notification.plugin = default = designate.notifications:Default audit = designate.notifications:Audit - -wsgi_scripts = - designate-api-wsgi = designate.api.wsgi:init_application