Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement uWSGI for heat api services
As part of the Pike goals we are moving api services to run as WSGI apps. heat-api, heat-api-cfn, and heat-api-cloudwatch are now set up as WSGI apps. Since this is just a drop in replacement for existing eventlet services, operators and deployers should not notice a difference. Change-Id: I3dba17c33a7f1a1b9a03020a650e258099b4d20d Implements: blueprint goal-deploy-api-in-wsgi
- Loading branch information
Showing
6 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
features: | ||
- The ``heat-api``, ``heat-api-cfn``, and | ||
``heat-api-cloudwatch`` services have moved to run | ||
as a uWSGI applications. You can set the max number | ||
of WSGI processes, the number of processes, threads, | ||
and buffer size utilizing the | ||
``heat_wsgi_processes_max``, | ||
``heat_wsgi_processes``, ``heat_wsgi_threads``, | ||
and ``heat_wsgi_buffer_size``. | ||
Additionally, you can override any settings in the | ||
uWSGI ini configuration file using the | ||
``heat_api_uwsgi_ini_overrides``, | ||
``heat_api_cfn_uwsgi_ini_overrides``, and | ||
``heat_api_cloudwatch_uwsgi_ini_overrides`` settings. | ||
The uWSGI applications will listen on the addresses | ||
specified by ``heat_api_uwsgi_bind_address``, | ||
``heat_api_cfn_uwsgi_bind_address``, and | ||
``heat_api_cloudwatch_uwsgi_bind_address`` | ||
respectively. Which all default to ``0.0.0.0``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
# Copyright 2017, Rackspace US, Inc. | ||
# | ||
# 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. | ||
|
||
- name: Ensure uWSGI directory exists | ||
file: | ||
path: "/etc/uwsgi/" | ||
state: directory | ||
mode: "0711" | ||
|
||
- name: Apply uWSGI configuration | ||
config_template: | ||
src: "heat-uwsgi.ini.j2" | ||
dest: "/etc/uwsgi/{{ item.service_name }}.ini" | ||
mode: "0744" | ||
config_overrides: "{{ item.wsgi_overrides }}" | ||
config_type: ini | ||
with_items: "{{ filtered_heat_services }}" | ||
when: item.wsgi_app | default(False) | ||
notify: | ||
- Restart heat services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[uwsgi] | ||
uid = {{ heat_system_user_name }} | ||
gid = {{ heat_system_group_name }} | ||
|
||
virtualenv = /openstack/venvs/heat-{{ heat_venv_tag }} | ||
wsgi-file = {{ heat_bin }}/{{ item.wsgi_name }} | ||
http-socket = {{ item.uwsgi_bind_address }}:{{ item.uwsgi_port }} | ||
|
||
master = true | ||
enable-threads = true | ||
processes = {{ heat_wsgi_processes }} | ||
threads = {{ heat_wsgi_threads }} | ||
exit-on-reload = true | ||
die-on-term = true | ||
lazy-apps = true | ||
add-header = Connection: close | ||
buffer-size = {{ heat_wsgi_buffer_size }} | ||
thunder-lock = true | ||
logfile-chmod = 644 |