Manila: Support uWSGI for API server

Currently Manila API server still using eventlet-based HTTP servers,
it is generally considered more performant and flexible to run them
using a generic HTTP server that supports WSGI.

Change-Id: Iff83c0854e3969a8b584a830479625393257af7c
This commit is contained in:
ricolin 2023-11-02 16:07:56 +08:00
parent b0e5d8e3e2
commit 7e3beb1a76
6 changed files with 34 additions and 3 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Manila
name: manila
version: 0.1.7
version: 0.1.8
home: https://docs.openstack.org/manila/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Manila/OpenStack_Project_Manila_vertical.png
sources:

View File

@ -18,8 +18,7 @@ set -ex
COMMAND="${@:-start}"
function start () {
exec manila-api \
--config-file /etc/manila/manila.conf
exec uwsgi --ini /etc/manila/manila-api-uwsgi.ini
}
function stop () {

View File

@ -207,6 +207,15 @@ limitations under the License.
{{- $_ := set .Values.conf.manila.glance "memcache_secret_key" $memcache_secret_key -}}
{{- end -}}
{{- if empty .Values.conf.manila_api_uwsgi.uwsgi.processes -}}
{{- $_ := set .Values.conf.manila_api_uwsgi.uwsgi "processes" .Values.conf.manila.DEFAULT.osapi_share_workers -}}
{{- end -}}
{{- if empty (index .Values.conf.manila_api_uwsgi.uwsgi "http-socket") -}}
{{- $http_socket_port := tuple "sharev2" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }}
{{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }}
{{- $_ := set .Values.conf.manila_api_uwsgi.uwsgi "http-socket" $http_socket -}}
{{- end -}}
{{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}}
{{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
{{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
@ -228,6 +237,7 @@ type: Opaque
data:
rally_tests.yaml: {{ toYaml .Values.conf.rally_tests.tests | b64enc }}
manila.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.manila | b64enc }}
manila-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.manila_api_uwsgi | b64enc }}
{{- range $key, $value := $envAll.Values.conf.rootwrap_filters }}
{{- $filePrefix := replace "_" "-" $key }}
{{ printf "%s.filters" $filePrefix }}: {{ $value.content | b64enc }}

View File

@ -94,6 +94,10 @@ spec:
mountPath: /etc/manila/manila.conf
subPath: manila.conf
readOnly: true
- name: manila-etc
mountPath: /etc/manila/manila-api-uwsgi.ini
subPath: manila-api-uwsgi.ini
readOnly: true
{{- if .Values.conf.manila.DEFAULT.log_config_append }}
- name: manila-etc
mountPath: {{ .Values.conf.manila.DEFAULT.log_config_append }}

View File

@ -850,6 +850,23 @@ conf:
sla:
failure_rate:
max: 0
manila_api_uwsgi:
uwsgi:
add-header: "Connection: close"
buffer-size: 65535
die-on-term: true
enable-threads: true
exit-on-reload: false
hook-master-start: unix_signal:15 gracefully_kill_them_all
lazy-apps: true
log-x-forwarded-for: true
master: true
procname-prefix-spaced: "manila-api:"
route-user-agent: '^kube-probe.* donotlog:'
thunder-lock: true
worker-reload-mercy: 80
wsgi-file: /var/lib/openstack/bin/manila-wsgi
# Names of secrets used by bootstrap and environmental checks
secrets:
identity:

View File

@ -8,4 +8,5 @@ manila:
- 0.1.5 Update port name of service-api.yaml
- 0.1.6 Add 2023.2 Ubuntu Jammy overrides
- 0.1.7 Properly config network host for share service
- 0.1.8 uses uWSGI for API service
...