Skip to content

Commit 3c10763

Browse files
committed
Add Helm chart templates for host-listener-catchup-only deployment
1 parent 4a42487 commit 3c10763

File tree

5 files changed

+217
-0
lines changed

5 files changed

+217
-0
lines changed

charts/coprocessor/templates/_helpers.tpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
{{- default $hostListenerPollerNameDefault .Values.hostListenerPoller.nameOverride | trunc 63 | trimSuffix "-" -}}
1414
{{- end -}}
1515

16+
{{- define "hostListenerCatchupOnlyName" -}}
17+
{{- $hostListenerCatchupOnlyNameDefault := printf "%s-%s" .Release.Name "host-listener-catchup-only" }}
18+
{{- default $hostListenerCatchupOnlyNameDefault .Values.hostListenerCatchupOnly.nameOverride | trunc 63 | trimSuffix "-" -}}
19+
{{- end -}}
20+
1621
{{- define "txSenderName" -}}
1722
{{- $txSenderNameDefault := printf "%s-%s" .Release.Name "tx-sender" }}
1823
{{- default $txSenderNameDefault .Values.txSender.nameOverride | trunc 63 | trimSuffix "-" -}}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{{- if .Values.hostListenerCatchupOnly.enabled -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
labels:
6+
app: coprocessor-host-listener-catchup-only
7+
app.kubernetes.io/name: {{ include "hostListenerCatchupOnlyName" . }}
8+
name: {{ include "hostListenerCatchupOnlyName" . }}
9+
spec:
10+
replicas: {{ .Values.hostListenerCatchupOnly.replicas }}
11+
selector:
12+
matchLabels:
13+
app: coprocessor-host-listener-catchup-only
14+
{{- if .Values.hostListenerCatchupOnly.updateStrategy }}
15+
strategy:
16+
{{- toYaml .Values.hostListenerCatchupOnly.updateStrategy | nindent 4 }}
17+
{{- end }}
18+
template:
19+
metadata:
20+
labels:
21+
app: coprocessor-host-listener-catchup-only
22+
app.kubernetes.io/name: {{ include "hostListenerCatchupOnlyName" . }}
23+
{{- with .Values.podLabels }}
24+
{{- toYaml . | nindent 8 }}
25+
{{- end }}
26+
{{- with .Values.podAnnotations }}
27+
annotations:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
spec:
31+
imagePullSecrets:
32+
- name: registry-credentials
33+
restartPolicy: Always
34+
{{- if and .Values.hostListenerCatchupOnly.affinity .Values.hostListenerCatchupOnly.affinity.enabled }}
35+
affinity:
36+
{{ toYaml (omit .Values.hostListenerCatchupOnly.affinity "enabled") | indent 8 }}
37+
{{- end }}
38+
{{- if and .Values.hostListenerCatchupOnly.tolerations .Values.hostListenerCatchupOnly.tolerations.enabled }}
39+
tolerations:
40+
{{ toYaml .Values.hostListenerCatchupOnly.tolerations.items | indent 8 }}
41+
{{- end }}
42+
{{- if .Values.hostListenerCatchupOnly.serviceAccountName }}
43+
serviceAccountName: {{ .Values.hostListenerCatchupOnly.serviceAccountName }}
44+
{{- end }}
45+
containers:
46+
- name: coprocessor-host-listener-catchup-only
47+
image: {{ .Values.hostListenerCatchupOnly.image.name }}:{{ .Values.hostListenerCatchupOnly.image.tag }}
48+
command: ["host_listener"]
49+
args:
50+
{{ toYaml .Values.hostListenerCatchupOnly.args | nindent 12 }}
51+
env:
52+
{{ toYaml .Values.hostListenerCatchupOnly.env | nindent 12 }}
53+
ports:
54+
{{- range $portName, $portValue := .Values.hostListenerCatchupOnly.ports }}
55+
- name: {{ $portName }}
56+
containerPort: {{ $portValue }}
57+
protocol: TCP
58+
{{- end }}
59+
resources:
60+
requests:
61+
cpu: {{ .Values.hostListenerCatchupOnly.resources.requests.cpu | default "100m" }}
62+
memory: {{ .Values.hostListenerCatchupOnly.resources.requests.memory | default "256Mi" }}
63+
limits:
64+
cpu: {{ .Values.hostListenerCatchupOnly.resources.limits.cpu | default "500m" }}
65+
memory: {{ .Values.hostListenerCatchupOnly.resources.limits.memory | default "512Mi" }}
66+
{{- if and .Values.hostListenerCatchupOnly.probes .Values.hostListenerCatchupOnly.probes.liveness.enabled }}
67+
livenessProbe:
68+
{{ toYaml (omit .Values.hostListenerCatchupOnly.probes.liveness "enabled") | nindent 12 }}
69+
{{- end }}
70+
{{- if and .Values.hostListenerCatchupOnly.probes .Values.hostListenerCatchupOnly.probes.readiness.enabled }}
71+
readinessProbe:
72+
{{ toYaml (omit .Values.hostListenerCatchupOnly.probes.readiness "enabled") | nindent 12 }}
73+
{{- end }}
74+
{{- end -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.hostListenerCatchupOnly.serviceMonitor.enabled -}}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
labels:
6+
app: coprocessor-host-listener-catchup-only
7+
app.kubernetes.io/name: {{ include "hostListenerCatchupOnlyName" . }}
8+
name: {{ include "hostListenerCatchupOnlyName" . }}
9+
spec:
10+
selector:
11+
matchLabels:
12+
app: coprocessor-host-listener-catchup-only
13+
app.kubernetes.io/name: {{ include "hostListenerCatchupOnlyName" . }}
14+
endpoints:
15+
- port: metrics
16+
{{- end -}}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if .Values.hostListenerCatchupOnly.enabled }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
labels:
6+
app: coprocessor-host-listener-catchup-only
7+
app.kubernetes.io/name: {{ include "hostListenerCatchupOnlyName" . }}
8+
name: {{ include "hostListenerCatchupOnlyName" . }}
9+
spec:
10+
ports:
11+
- name: metrics
12+
port: {{ .Values.hostListenerCatchupOnly.ports.metrics }}
13+
targetPort: metrics
14+
- name: healthcheck
15+
port: {{ .Values.hostListenerCatchupOnly.ports.healthcheck }}
16+
targetPort: healthcheck
17+
selector:
18+
app: coprocessor-host-listener-catchup-only
19+
app.kubernetes.io/name: {{ include "hostListenerCatchupOnlyName" . }}
20+
type: ClusterIP
21+
{{- end }}

charts/coprocessor/values.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,107 @@ hostListenerPoller:
314314
maxSurge: 1
315315
maxUnavailable: 0
316316

317+
# -----------------------------------------------------------------------------
318+
# Host Listener Catchup Only
319+
# -----------------------------------------------------------------------------
320+
# Host listener variant that runs only the catchup loop without real-time subscription.
321+
hostListenerCatchupOnly:
322+
enabled: false
323+
nameOverride:
324+
325+
image:
326+
name: ghcr.io/zama-ai/fhevm-coprocessor
327+
tag: v0.10.0
328+
329+
replicas: 1
330+
331+
# Environment variables
332+
env:
333+
- name: DATABASE_URL
334+
valueFrom:
335+
secretKeyRef:
336+
name: coprocessor-db-url
337+
key: coprocessor-db-url
338+
- name: TENANT_API_KEY
339+
valueFrom:
340+
secretKeyRef:
341+
name: coprocessor-api-key
342+
key: coprocessor-api-key
343+
344+
# Command line arguments for the host listener catchup only mode
345+
# NOTE: --only-catchup-loop requires --end-at-block to be set
346+
args:
347+
- --database-url=$(DATABASE_URL)
348+
- --coprocessor-api-key=$(TENANT_API_KEY)
349+
- --url=$(ETHEREUM_RPC_URL)
350+
- --acl-contract-address=$(ACL_CONTRACT_ADDRESS)
351+
- --tfhe-contract-address=$(FHEVM_EXECUTOR_CONTRACT_ADDRESS)
352+
- --initial-block-time=12
353+
- --log-level=INFO
354+
- --health-port=8080
355+
- --dependence-cache-size=128
356+
- --reorg-maximum-duration-in-blocks=50
357+
- --service-name="host-listener-catchup-only"
358+
- --catchup-finalization-in-blocks=20
359+
360+
### Catchup-only specific parameters (required)
361+
- --only-catchup-loop
362+
- --end-at-block=-15 # Relative to latest block (negative value)
363+
- --catchup-loop-sleep-secs=60
364+
365+
### Optional catchup parameters
366+
# - --start-at-block # To catch up from a specific block
367+
# - --catchup-margin
368+
# - --catchup-paging
369+
370+
# Service ports configuration
371+
ports:
372+
metrics: 9100
373+
healthcheck: 8080
374+
375+
serviceMonitor:
376+
enabled: false
377+
378+
serviceAccountName:
379+
380+
resources:
381+
requests:
382+
cpu: 100m
383+
memory: 256Mi
384+
limits:
385+
cpu: 500m
386+
memory: 512Mi
387+
388+
# Health check probes
389+
probes:
390+
liveness:
391+
enabled: false
392+
httpGet:
393+
path: /liveness
394+
port: healthcheck
395+
initialDelaySeconds: 10
396+
periodSeconds: 10
397+
readiness:
398+
enabled: false
399+
httpGet:
400+
path: /healthz
401+
port: healthcheck
402+
initialDelaySeconds: 5
403+
periodSeconds: 10
404+
405+
affinity:
406+
enabled: false
407+
408+
tolerations:
409+
enabled: false
410+
items: []
411+
412+
updateStrategy:
413+
type: RollingUpdate
414+
rollingUpdate:
415+
maxSurge: 1
416+
maxUnavailable: 0
417+
317418
# -----------------------------------------------------------------------------
318419
# Gateway Listener
319420
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)