diff --git a/doc/source/eventlet_deprecation/index.rst b/doc/source/eventlet_deprecation/index.rst index 6283eff9200..3febb6d3c91 100644 --- a/doc/source/eventlet_deprecation/index.rst +++ b/doc/source/eventlet_deprecation/index.rst @@ -62,3 +62,30 @@ This implementation does not rely on ``neutron.api.wsgi.Server`` nor configuration variable. Right now only the embedded form (local thread) is implemented (``metadata_workers=0``, the default value). Future implementations will enable again this configuration variable. + + +Neutron API +----------- + +The Neutron API currently can be executed only with the uWSGI module; the +eventlet executor has been deprecated, although the code has not been removed +from the repository yet. + +The Neutron API consists of the following executables: + +* The API server: is a multiprocess worker; each process is created by the + ``uWSGI`` server. + +* The periodic worker: a mult process worker that spawns several threads to + execute the periodic workers. + +* The RPC worker: a multiprocess process worker that attends the requests from + the RPC clients, for example the Neutron agents. + +* The ML2/OVN maintenance worker: single process worker, needed by the ML2/OVN + mechanism driver. + + +.. note:: + + Right now, only the API server is running without eventlet. diff --git a/neutron/cmd/eventlet/server/__init__.py b/neutron/cmd/eventlet/server/__init__.py index fb634449b94..7458efaec80 100644 --- a/neutron/cmd/eventlet/server/__init__.py +++ b/neutron/cmd/eventlet/server/__init__.py @@ -11,7 +11,6 @@ # under the License. from neutron import server -from neutron.server import api_eventlet from neutron.server import ovn_maintenance from neutron.server import periodic_eventlet from neutron.server import rpc_eventlet @@ -26,10 +25,6 @@ def main_rpc_eventlet(): server.boot_server(rpc_eventlet.eventlet_rpc_server) -def main_api_eventlet(): - return server.boot_server(api_eventlet.eventlet_api_server) - - def main_periodic_eventlet(): server.boot_server(periodic_eventlet.eventlet_periodic_workers) diff --git a/neutron/cmd/server/__init__.py b/neutron/cmd/server/__init__.py new file mode 100644 index 00000000000..8b0e6c37835 --- /dev/null +++ b/neutron/cmd/server/__init__.py @@ -0,0 +1,21 @@ +# Copyright (c) 2025 Red Hat Inc. +# All rights reserved. +# +# 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. + +from neutron import server +from neutron.server import api + + +def main_api_uwsgi(): + return server.boot_server(api.api_server) diff --git a/neutron/server/api_eventlet.py b/neutron/server/api.py similarity index 97% rename from neutron/server/api_eventlet.py rename to neutron/server/api.py index d7eaa667aa1..01a94ec86d4 100644 --- a/neutron/server/api_eventlet.py +++ b/neutron/server/api.py @@ -24,7 +24,7 @@ from neutron.common import config from neutron.common import profiler -def eventlet_api_server(): +def api_server(): profiler.setup('neutron-server', cfg.CONF.host) app = config.load_paste_app('neutron') registry.publish(resources.PROCESS, events.BEFORE_SPAWN, diff --git a/neutron/wsgi/api.py b/neutron/wsgi/api.py index 7fbafb0f65a..7dad6b916ba 100644 --- a/neutron/wsgi/api.py +++ b/neutron/wsgi/api.py @@ -22,10 +22,10 @@ eventlet_utils.monkey_patch() import threading # noqa:E402 from neutron import server # noqa:E402 -from neutron.server import api_eventlet # noqa:E402 +from neutron.server import api # noqa:E402 application = None lock = threading.Lock() with lock: if application is None: - application = server.boot_server(api_eventlet.eventlet_api_server) + application = server.boot_server(api.api_server) diff --git a/setup.cfg b/setup.cfg index 07f21a419cb..bd005cd9661 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ data_files = [entry_points] wsgi_scripts = - neutron-api = neutron.cmd.eventlet.server:main_api_eventlet + neutron-api = neutron.cmd.server:main_api_uwsgi console_scripts = neutron-db-manage = neutron.db.migration.cli:main neutron-dhcp-agent = neutron.cmd.eventlet.agents.dhcp:main