Skip to content

Commit c8cd02d

Browse files
committed
define initial change propagation chart
1 parent 95003a6 commit c8cd02d

File tree

5 files changed

+190
-0
lines changed

5 files changed

+190
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: change-propagation
3+
description: A Helm chart for the Mediawiki service change propagation
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.0.0"
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: change-propagation-config
5+
data:
6+
config.yaml: |
7+
num_workers: 1
8+
worker_heap_limit_mb: 256
9+
logging:
10+
level: info
11+
services:
12+
- name: cpjobqueue
13+
module: hyperswitch
14+
conf:
15+
port: {{ .Values.service.port }}
16+
user_agent: ChangePropagation/JobQueue
17+
spec:
18+
x-sub-request-filters:
19+
- type: default
20+
name: http
21+
options:
22+
allow:
23+
- pattern: '/^https?:\/\/.*/'
24+
forward_headers:
25+
user-agent: true
26+
x-request-id: true
27+
paths:
28+
/{api:sys}:
29+
x-modules:
30+
- path: sys/kafka.js
31+
options:
32+
metadata_broker_list: 'kafka-0.kafka.{{ .Release.Namespace }}.svc.cluster.local:9092'
33+
dc_name: {{ .Values.kafka.dcName }}
34+
startup_delay: {{ .Values.jobqueue.startupDelay }}
35+
consumer:
36+
fetch.wait.max.ms: {{ .Values.jobqueue.consumer.fetchWaitMaxMs | quote }}
37+
fetch.min.bytes: {{ .Values.jobqueue.consumer.fetchMinBytes | quote }}
38+
producer:
39+
queue.buffering.max.messages: {{ .Values.jobqueue.producer.queueBufferingMaxMessages | quote }}
40+
compression.codec: {{ .Values.jobqueue.producer.compressionCodec }}
41+
42+
disable_ratelimit: true
43+
44+
concurrency: {{ .Values.jobqueue.concurrency }}
45+
reenqueue_delay: {{ .Values.jobqueue.reenqueueDelay }}
46+
47+
templates:
48+
# ==============================================
49+
# Job execution rule
50+
# ==============================================
51+
# Subscribes to all configured mediawiki.job.*
52+
# topics and POSTs each event to the MediaWiki
53+
# EventBus RunJob REST API for execution.
54+
#
55+
# Kafka topic naming:
56+
# {dc_name}.mediawiki.job.{jobType}
57+
# e.g. mardi.mediawiki.job.refreshLinks
58+
#
59+
# Retry topics are auto-created by the service:
60+
# {dc_name}.change-prop.retry.mediawiki.job.{jobType}
61+
# ==============================================
62+
job_execute:
63+
topic: '/^mediawiki\.job\..*/'
64+
# Retry up to 3 times with back-off on 5xx
65+
retry_limit: 3
66+
retry_delay: 500
67+
retry_on:
68+
status:
69+
- '5xx'
70+
exec:
71+
method: post
72+
uri: '{{ .Values.mediawiki.host }}/w/rest.php/eventbus/v0/internal/job/execute'
73+
headers:
74+
content-type: application/json
75+
host: '{{ "{{message.meta.domain}}" }}'
76+
body: '{{ "{{globals.message}}" }}'
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: change-propagation
5+
labels:
6+
app: change-propagation
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
app: change-propagation
12+
template:
13+
metadata:
14+
labels:
15+
app: change-propagation
16+
annotations:
17+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
18+
spec:
19+
containers:
20+
- name: change-propagation
21+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
22+
imagePullPolicy: {{ .Values.image.pullPolicy }}
23+
args:
24+
- "-c"
25+
- "/etc/change-propagation/config.yaml"
26+
ports:
27+
- containerPort: {{ .Values.service.port }}
28+
protocol: TCP
29+
volumeMounts:
30+
- name: config
31+
mountPath: /etc/change-propagation
32+
resources:
33+
{{- toYaml .Values.resources | nindent 12 }}
34+
readinessProbe:
35+
httpGet:
36+
path: /_info
37+
port: {{ .Values.service.port }}
38+
initialDelaySeconds: 15
39+
periodSeconds: 10
40+
livenessProbe:
41+
httpGet:
42+
path: /_info
43+
port: {{ .Values.service.port }}
44+
initialDelaySeconds: 30
45+
periodSeconds: 15
46+
volumes:
47+
- name: config
48+
configMap:
49+
name: change-propagation-config
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: change-propagation
5+
labels:
6+
app: change-propagation
7+
spec:
8+
type: ClusterIP
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: {{ .Values.service.port }}
12+
protocol: TCP
13+
selector:
14+
app: change-propagation
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
image:
2+
repository: docker-registry.wikimedia.org/wikimedia/mediawiki-services-change-propagation
3+
tag: 2025-07-28-033107-production
4+
pullPolicy: IfNotPresent
5+
6+
replicaCount: 1
7+
8+
service:
9+
port: 7200
10+
11+
kafka:
12+
dcName: mardi
13+
14+
mediawiki:
15+
host: http://wikibase-apache
16+
17+
jobqueue:
18+
# ------------------------------------------------------------------
19+
# Concurrency
20+
# ------------------------------------------------------------------
21+
# Max concurrent job executions across ALL rules combined.
22+
concurrency: 50
23+
24+
# Seconds before a failed job is re-enqueued for retry.
25+
reenqueueDelay: 120
26+
27+
# Delay (seconds) after startup before consuming begins.
28+
# Gives Kafka consumers time to settle.
29+
startupDelay: 5
30+
31+
consumer:
32+
fetchWaitMaxMs: "100"
33+
fetchMinBytes: "1"
34+
35+
producer:
36+
queueBufferingMaxMessages: "10"
37+
compressionCodec: snappy
38+
39+
resources:
40+
requests:
41+
cpu: 100m
42+
memory: 256Mi
43+
limits:
44+
cpu: "1"
45+
memory: 512Mi

0 commit comments

Comments
 (0)