Skip to content

Commit 01ad1ca

Browse files
authored
Merge pull request #228 from element-hq/bbz/refresh-synapse-worker-paths-1.124.0
2 parents 78468c7 + cb48ad3 commit 01ad1ca

File tree

13 files changed

+115
-12
lines changed

13 files changed

+115
-12
lines changed

charts/matrix-stack/ci/fragments/synapse-all-workers-running.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ synapse:
2727
enabled: true
2828
presence-writer:
2929
enabled: true
30+
push-rules:
31+
enabled: true
3032
pusher:
3133
enabled: true
3234
instances: 2

charts/matrix-stack/ci/fragments/synapse-pytest-self-extras.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ synapse:
1717
value: "1"
1818

1919
workers:
20+
# A non-HTTP worker & a stream writer
21+
event-persister:
22+
enabled: true
23+
# A standard HTTP worker
2024
sliding-sync:
2125
enabled: true
26+
# Media repo is fairly distinct from other workers
2227
media-repository:
2328
enabled: true

charts/matrix-stack/ci/pytest-synapse-values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ synapse:
3535
annotations:
3636
has-no-service-monitor: "true"
3737
workers:
38+
# A non-HTTP worker & a stream writer
39+
event-persister:
40+
enabled: true
41+
# Media repo is fairly distinct from other workers
3842
media-repository:
3943
enabled: true
44+
# A standard HTTP worker
4045
sliding-sync:
4146
enabled: true
4247
wellKnownDelegation:

charts/matrix-stack/ci/synapse-worker-example-values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ synapse:
4141
enabled: true
4242
presence-writer:
4343
enabled: true
44+
push-rules:
45+
enabled: true
4446
pusher:
4547
enabled: true
4648
instances: 2

charts/matrix-stack/configs/synapse/partial-haproxy.cfg.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ backend synapse-{{ $workerType }}
176176
{{- $workerTypeName := include "element-io.synapse.process.workerTypeName" (dict "root" $root "context" $workerType) }}
177177
# Use DNS SRV service discovery on the headless service
178178
server-template {{ $workerTypeName }} {{ $maxInstances }} _synapse-http._tcp.{{ $root.Release.Name }}-synapse-{{ $workerTypeName }}.{{ $root.Release.Namespace }}.svc.cluster.local resolvers kubedns init-addr none check
179-
{{- end }}
180179
{{- if include "element-io.synapse.process.canFallbackToMain" (dict "root" $root "context" $workerType) }}
181-
server-template main 1 _synapse-http._tcp.{{ $root.Release.Name }}-synapse-main.{{ $root.Release.Namespace }}.svc.cluster.local resolvers kubedns init-addr none check backup
180+
server-template main-backup 1 _synapse-http._tcp.{{ $root.Release.Name }}-synapse-main.{{ $root.Release.Namespace }}.svc.cluster.local resolvers kubedns init-addr none check backup
181+
{{- end }}
182182
{{- end }}
183183
{{- end }}
184184

charts/matrix-stack/source/synapse.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@
146146
"presence-writer": {
147147
"$ref": "file://synapse/single_worker.json"
148148
},
149+
"push-rules": {
150+
"$ref": "file://synapse/single_worker.json"
151+
},
149152
"pusher": {
150153
"$ref": "file://synapse/scalable_worker.json"
151154
},

charts/matrix-stack/source/synapse.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ workers:
4545
{{- synapse_sub_schema_values.scalable_worker('initial-synchrotron') | indent(2) }}
4646
{{- synapse_sub_schema_values.single_worker('media-repository') | indent(2) }}
4747
{{- synapse_sub_schema_values.single_worker('presence-writer') | indent(2) }}
48+
{{- synapse_sub_schema_values.single_worker('push-rules') | indent(2) }}
4849
{{- synapse_sub_schema_values.scalable_worker('pusher') | indent(2) }}
4950
{{- synapse_sub_schema_values.single_worker('receipts-account') | indent(2) }}
5051
{{- synapse_sub_schema_values.scalable_worker('sliding-sync') | indent(2) }}

charts/matrix-stack/templates/synapse/_synapse_details.tpl

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,21 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
77
{{- define "element-io.synapse.process.hasHttp" -}}
88
{{- $root := .root -}}
99
{{- with required "element-io.synapse.process.hasHttp missing context" .context -}}
10-
{{ $hasHttp := (list "main" "client-reader" "encryption" "event-creator"
11-
"federation-inbound" "federation-reader" "initial-synchrotron"
12-
"media-repository" "presence-writer" "receipts-account"
13-
"sliding-sync" "sso-login" "synchrotron" "typing-persister"
10+
{{ $hasHttp := (list "main"
11+
"client-reader"
12+
"encryption"
13+
"event-creator"
14+
"federation-inbound"
15+
"federation-reader"
16+
"initial-synchrotron"
17+
"media-repository"
18+
"presence-writer"
19+
"push-rules"
20+
"receipts-account"
21+
"sliding-sync"
22+
"sso-login"
23+
"synchrotron"
24+
"typing-persister"
1425
"user-dir") }}
1526
{{- if has . $hasHttp -}}
1627
hasHttp
@@ -21,8 +32,12 @@ hasHttp
2132
{{- define "element-io.synapse.process.hasReplication" -}}
2233
{{- $root := .root -}}
2334
{{- with required "element-io.synapse.process.hasReplication missing context" .context -}}
24-
{{- $hasReplication := (list "main" "encryption" "event-persister"
25-
"presence-writer" "receipts-account"
35+
{{- $hasReplication := (list "main"
36+
"encryption"
37+
"event-persister"
38+
"push-rules"
39+
"presence-writer"
40+
"receipts-account"
2641
"typing-persister") }}
2742
{{- if has . $hasReplication -}}
2843
hasReplication
@@ -33,9 +48,17 @@ hasReplication
3348
{{- define "element-io.synapse.process.isSingle" -}}
3449
{{- $root := .root -}}
3550
{{- with required "element-io.synapse.process.isSingle missing context" .context -}}
36-
{{ $isSingle := (list "main" "appservice" "background" "encryption"
37-
"media-repository" "presence-writer" "receipts-account"
38-
"sso-login" "typing-persister" "user-dir") }}
51+
{{ $isSingle := (list "main"
52+
"appservice"
53+
"background"
54+
"encryption"
55+
"media-repository"
56+
"presence-writer"
57+
"push-rules"
58+
"receipts-account"
59+
"sso-login"
60+
"typing-persister"
61+
"user-dir") }}
3962
{{- if has . $isSingle -}}
4063
isSingle
4164
{{- end -}}
@@ -96,6 +119,8 @@ responsibleForMedia
96119
{{ list "events" | toJson }}
97120
{{- else if eq . "presence-writer" }}
98121
{{ list "presence" | toJson }}
122+
{{- else if eq . "push-rules" }}
123+
{{ list "push_rules" | toJson }}
99124
{{- else if eq . "receipts-account" }}
100125
{{ list "account_data" "receipts" | toJson }}
101126
{{- else if eq . "typing-persister" }}
@@ -177,7 +202,7 @@ responsibleForMedia
177202
"^/_matrix/client/v1/rooms/.*/hierarchy$"
178203
"^/_matrix/client/(v1|unstable)/rooms/.*/relations/"
179204
"^/_matrix/client/v1/rooms/.*/threads$"
180-
"^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$"
205+
"^/_matrix/client/unstable/im.nheko.summary/summary/.*$"
181206
"^/_matrix/client/(r0|v3|unstable)/account/3pid$"
182207
"^/_matrix/client/(r0|v3|unstable)/account/whoami$"
183208
"^/_matrix/client/(r0|v3|unstable)/devices$"
@@ -304,6 +329,13 @@ responsibleForMedia
304329
}}
305330
{{- end }}
306331
332+
{{- if eq .workerType "push-rules" }}
333+
{{ $workerPaths = append $workerPaths (list
334+
"^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/"
335+
"^/_matrix/client/unstable/org.matrix.msc4140/delayed_events"
336+
) }}
337+
{{- end }}
338+
307339
{{- if eq .workerType "receipts-account" }}
308340
{{ $workerPaths = concat $workerPaths (list
309341
"^/_matrix/client/(r0|v3|unstable)/.*/tags"

charts/matrix-stack/values.schema.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,6 +4319,49 @@
43194319
"type": "object",
43204320
"additionalProperties": false
43214321
},
4322+
"push-rules": {
4323+
"properties": {
4324+
"enabled": {
4325+
"type": "boolean"
4326+
},
4327+
"resources": {
4328+
"properties": {
4329+
"limits": {
4330+
"additionalProperties": {
4331+
"anyOf": [
4332+
{
4333+
"type": "integer"
4334+
},
4335+
{
4336+
"type": "string"
4337+
}
4338+
],
4339+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
4340+
},
4341+
"type": "object"
4342+
},
4343+
"requests": {
4344+
"additionalProperties": {
4345+
"anyOf": [
4346+
{
4347+
"type": "integer"
4348+
},
4349+
{
4350+
"type": "string"
4351+
}
4352+
],
4353+
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
4354+
},
4355+
"type": "object"
4356+
}
4357+
},
4358+
"type": "object",
4359+
"additionalProperties": false
4360+
}
4361+
},
4362+
"type": "object",
4363+
"additionalProperties": false
4364+
},
43224365
"pusher": {
43234366
"required": [
43244367
"instances"

charts/matrix-stack/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,13 @@ synapse:
13661366
## Set to true to deploy a single instance of this worker
13671367
enabled: false
13681368

1369+
## Resources for this worker.
1370+
## If omitted the global Synapse resources are used
1371+
# resources: {}
1372+
push-rules:
1373+
## Set to true to deploy a single instance of this worker
1374+
enabled: false
1375+
13691376
## Resources for this worker.
13701377
## If omitted the global Synapse resources are used
13711378
# resources: {}

0 commit comments

Comments
 (0)