matrix-synapse: Decouple worker app and config key
This should allow running several separate instances of specalized workers where that makes sense.
This commit is contained in:
parent
72802cbb79
commit
c47961e682
4 changed files with 16 additions and 7 deletions
|
@ -113,23 +113,23 @@ data:
|
|||
{{- $default := .Values.workers.default }}
|
||||
{{- range $worker, $config := .Values.workers }}
|
||||
{{- if $config.enabled }}
|
||||
{{- if eq $worker "pusher" }}
|
||||
{{- if or (eq $worker "pusher") (eq $config.app "pusher") }}
|
||||
|
||||
# For pusher worker
|
||||
start_pushers: false
|
||||
{{- else if eq $worker "appservice" }}
|
||||
{{- else if or (eq $worker "appservice") (eq $config.app "appservice") }}
|
||||
|
||||
# For appservice worker
|
||||
notify_appservices: false
|
||||
{{- else if eq $worker "federation_sender" }}
|
||||
{{- else if or (eq $worker "federation_sender") (eq $config.app "federation_sender") }}
|
||||
|
||||
# For federation_sender worker
|
||||
send_federation: false
|
||||
{{- else if eq $worker "media_repository" }}
|
||||
{{- else if or (eq $worker "media_repository") (eq $config.app "media_repository") }}
|
||||
|
||||
# For media_repository worker
|
||||
enable_media_repo: false
|
||||
{{- else if eq $worker "user_dir" }}
|
||||
{{- else if or (eq $worker "user_dir") (eq $config.app "user_dir") }}
|
||||
|
||||
# For user_dir worker
|
||||
update_user_directory: false
|
||||
|
|
|
@ -19,9 +19,10 @@ data:
|
|||
{{- range $worker, $config := .Values.workers -}}
|
||||
{{- if $config.enabled -}}
|
||||
{{- $name := $worker | replace "_" "-" }}
|
||||
{{- $app := $config.app | default $worker }}
|
||||
|
||||
{{ $name }}.worker: |
|
||||
worker_app: "synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $worker }}"
|
||||
worker_app: "synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $app }}"
|
||||
{{- if $config.name -}}
|
||||
{{- if (gt ($config.replicaCount | int) 1) -}}
|
||||
{{- fail "Replica count must be 1 if a worker has a unique name." -}}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
{{- range $worker, $config := .Values.workers }}
|
||||
{{- if $config.enabled }}
|
||||
{{- $name := $worker | replace "_" "-" }}
|
||||
{{- $app := $config.app | default $worker }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
@ -78,7 +79,7 @@ spec:
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
exec python -B -m synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $worker }} \
|
||||
exec python -B -m synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $app }} \
|
||||
-c /synapse/config/homeserver.yaml \
|
||||
-c /synapse/config/conf.d/ \
|
||||
-c /synapse/config/{{ $name }}.worker
|
||||
|
|
|
@ -529,6 +529,13 @@ workers:
|
|||
federation_sender:
|
||||
enabled: false
|
||||
|
||||
## Specialized workers can also be run as multiple separate instances,
|
||||
## make sure to read the relevant documentation.
|
||||
##
|
||||
# federation_sender_other:
|
||||
# app: federation_sender
|
||||
# enabled: false
|
||||
|
||||
## This worker deals with serving and storing media.
|
||||
## NB; Running multiple instances will conflict with background jobs.
|
||||
##
|
||||
|
|
Loading…
Reference in a new issue