Skip to content

Commit b941ad4

Browse files
authored
chore(coprocessor): chart updates for multi coprocessor (#2222)
* chore(coprocessor): first pass at updating helm charts for multi-copro * chore(coprocessor): update env inheritance scheme * chore(coprocessor): repo and project for images * chore(coprocessor): add info around nodeSelector, affinity, tolerations * chore(coprocessor): add info around empty vars from values.yaml * chore(coprocessor): update approach to arg handling * chore(coprocessor): reintroduce previous arg comments * chore(coprocessor): address private key management for txSender * chore(coprocessor): align args, envs with live values * chore(coprocessor): address lint errors * chore(coprocessor): address PB feedback * chore(coprocessor): address PB feedback * chore(coprocessor): address lint errors
1 parent ef080b9 commit b941ad4

12 files changed

+965
-471
lines changed

charts/coprocessor/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: coprocessor
22
description: A helm chart to distribute and deploy Zama fhevm Co-Processor services
3-
version: 0.8.6
3+
version: 0.9.0
44
apiVersion: v2
55
keywords:
66
- fhevm

charts/coprocessor/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535

3636
{{- define "snsWorkerName" -}}
3737
{{- $snsWorkerNameDefault := printf "%s-%s" .Release.Name "sns-worker" }}
38-
{{- default $snsWorkerNameDefault .Values.zkProofWorker.nameOverride | trunc 63 | trimSuffix "-" -}}
38+
{{- default $snsWorkerNameDefault .Values.snsWorker.nameOverride | trunc 63 | trimSuffix "-" -}}
3939
{{- end -}}

charts/coprocessor/templates/coprocessor-db-migration.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ spec:
2222
imagePullSecrets:
2323
- name: registry-credentials
2424
restartPolicy: Never
25-
{{- if and .Values.dbMigration.affinity .Values.dbMigration.affinity.enabled }}
25+
{{- with .Values.dbMigration.nodeSelector }}
26+
nodeSelector:
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
{{- with .Values.dbMigration.affinity }}
2630
affinity:
27-
{{ toYaml (omit .Values.dbMigration.affinity "enabled") | indent 8 }}
31+
{{- toYaml . | nindent 8 }}
2832
{{- end }}
29-
{{- if and .Values.dbMigration.tolerations .Values.dbMigration.tolerations.enabled }}
33+
{{- with .Values.dbMigration.tolerations }}
3034
tolerations:
31-
{{ toYaml .Values.dbMigration.tolerations.items | indent 8 }}
35+
{{- toYaml . | nindent 8 }}
3236
{{- end }}
3337
{{- if .Values.dbMigration.serviceAccountName }}
3438
serviceAccountName: {{ .Values.dbMigration.serviceAccountName }}
@@ -38,7 +42,14 @@ spec:
3842
image: {{ .Values.dbMigration.image.name }}:{{ .Values.dbMigration.image.tag }}
3943
command: ["/initialize_db.sh"]
4044
env:
41-
{{ toYaml .Values.dbMigration.env | nindent 12 }}
45+
- name: DATABASE_URL
46+
value: {{ .Values.commonConfig.databaseUrl | quote }}
47+
{{- with .Values.commonConfig.env }}
48+
{{- toYaml . | nindent 10 }}
49+
{{- end }}
50+
{{- with .Values.dbMigration.env }}
51+
{{- toYaml . | nindent 10 }}
52+
{{- end }}
4253
resources:
4354
requests:
4455
cpu: {{ .Values.dbMigration.resources.requests.cpu | default "100m" }}

charts/coprocessor/templates/coprocessor-gw-listener-deployment.yaml

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ spec:
3131
imagePullSecrets:
3232
- name: registry-credentials
3333
restartPolicy: Always
34-
{{- if and .Values.gwListener.affinity .Values.gwListener.affinity.enabled }}
34+
{{- with .Values.gwListener.nodeSelector }}
35+
nodeSelector:
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
38+
{{- with .Values.gwListener.affinity }}
3539
affinity:
36-
{{ toYaml (omit .Values.gwListener.affinity "enabled") | indent 8 }}
40+
{{- toYaml . | nindent 8 }}
3741
{{- end }}
38-
{{- if and .Values.gwListener.tolerations .Values.gwListener.tolerations.enabled }}
42+
{{- with .Values.gwListener.tolerations }}
3943
tolerations:
40-
{{ toYaml .Values.gwListener.tolerations.items | indent 8 }}
44+
{{- toYaml . | nindent 8 }}
4145
{{- end }}
4246
{{- if .Values.gwListener.serviceAccountName }}
4347
serviceAccountName: {{ .Values.gwListener.serviceAccountName }}
@@ -47,9 +51,55 @@ spec:
4751
image: {{ .Values.gwListener.image.name }}:{{ .Values.gwListener.image.tag }}
4852
command: ["gw_listener"]
4953
args:
50-
{{ toYaml .Values.gwListener.args | nindent 12 }}
54+
- --database-url=$(DATABASE_URL)
55+
- --gw-url=$(GATEWAY_URL)
56+
- --input-verification-address=$(INPUT_VERIFICATION_ADDRESS)
57+
- --kms-generation-address=$(KMS_GENERATION_ADDRESS)
58+
- --ciphertext-commits-address=$(CIPHERTEXT_COMMITS_ADDRESS)
59+
- --gateway-config-address=$(GATEWAY_CONFIG_ADDRESS)
60+
- --health-check-port={{ .Values.gwListener.ports.healthcheck }}
61+
- --metrics-addr=0.0.0.0:{{ .Values.gwListener.ports.metrics }}
62+
- --log-level={{ .Values.gwListener.args.logLevel }}
63+
- --service-name={{ .Values.gwListener.args.serviceName }}
64+
- --database-pool-size={{ .Values.gwListener.args.databasePoolSize }}
65+
- --verify-proof-req-database-channel={{ .Values.gwListener.args.verifyProofReqDatabaseChannel }}
66+
- --error-sleep-initial-secs={{ .Values.gwListener.args.errorSleepInitialSecs }}
67+
- --error-sleep-max-secs={{ .Values.gwListener.args.errorSleepMaxSecs }}
68+
- --provider-max-retries={{ .Values.gwListener.args.providerMaxRetries }}
69+
- --provider-retry-interval={{ .Values.gwListener.args.providerRetryInterval }}
70+
- --get-logs-poll-interval={{ .Values.gwListener.args.getLogsPollInterval }}
71+
- --get-logs-block-batch-size={{ .Values.gwListener.args.getLogsBlockBatchSize }}
72+
- --log-last-processed-every-number-of-updates={{ .Values.gwListener.args.logLastProcessedEveryNumberOfUpdates }}
73+
{{- with .Values.gwListener.extraArgs }}
74+
{{- toYaml . | nindent 12 }}
75+
{{- end }}
5176
env:
52-
{{ toYaml .Values.gwListener.env | nindent 12 }}
77+
- name: DATABASE_URL
78+
value: {{ .Values.commonConfig.databaseUrl | quote }}
79+
- name: GATEWAY_URL
80+
value: {{ .Values.commonConfig.gatewayUrl | quote }}
81+
- name: INPUT_VERIFICATION_ADDRESS
82+
value: {{ required "commonConfig.gatewayContractAddresses.inputVerification is required" .Values.commonConfig.gatewayContractAddresses.inputVerification | quote }}
83+
- name: KMS_GENERATION_ADDRESS
84+
value: {{ required "commonConfig.gatewayContractAddresses.kmsGeneration is required" .Values.commonConfig.gatewayContractAddresses.kmsGeneration | quote }}
85+
- name: CIPHERTEXT_COMMITS_ADDRESS
86+
value: {{ required "commonConfig.gatewayContractAddresses.ciphertextCommits is required" .Values.commonConfig.gatewayContractAddresses.ciphertextCommits | quote }}
87+
- name: GATEWAY_CONFIG_ADDRESS
88+
value: {{ required "commonConfig.gatewayContractAddresses.gatewayConfig is required" .Values.commonConfig.gatewayContractAddresses.gatewayConfig | quote }}
89+
{{- if default .Values.commonConfig.tracing.enabled .Values.gwListener.tracing.enabled }}
90+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
91+
value: {{ .Values.commonConfig.tracing.endpoint | quote }}
92+
- name: OTEL_SERVICE_NAME
93+
valueFrom:
94+
fieldRef:
95+
fieldPath: metadata.name
96+
{{- end }}
97+
{{- with .Values.commonConfig.env }}
98+
{{- toYaml . | nindent 12 }}
99+
{{- end }}
100+
{{- with .Values.gwListener.env }}
101+
{{- toYaml . | nindent 12 }}
102+
{{- end }}
53103
ports:
54104
{{- range $portName, $portValue := .Values.gwListener.ports }}
55105
- name: {{ $portName }}
@@ -65,10 +115,10 @@ spec:
65115
memory: {{ .Values.gwListener.resources.limits.memory | default "512Mi" }}
66116
{{- if and .Values.gwListener.probes .Values.gwListener.probes.liveness.enabled }}
67117
livenessProbe:
68-
{{ toYaml (omit .Values.gwListener.probes.liveness "enabled") | nindent 12 }}
118+
{{- toYaml (omit .Values.gwListener.probes.liveness "enabled") | nindent 12 }}
69119
{{- end }}
70120
{{- if and .Values.gwListener.probes .Values.gwListener.probes.readiness.enabled }}
71121
readinessProbe:
72-
{{ toYaml (omit .Values.gwListener.probes.readiness "enabled") | nindent 12 }}
122+
{{- toYaml (omit .Values.gwListener.probes.readiness "enabled") | nindent 12 }}
73123
{{- end }}
74124
{{- end -}}

charts/coprocessor/templates/coprocessor-host-listener-catchup-only-deployment.yaml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ spec:
3131
imagePullSecrets:
3232
- name: registry-credentials
3333
restartPolicy: Always
34-
{{- if and .Values.hostListenerCatchupOnly.affinity .Values.hostListenerCatchupOnly.affinity.enabled }}
34+
{{- with .Values.hostListenerCatchupOnly.nodeSelector }}
35+
nodeSelector:
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
38+
{{- with .Values.hostListenerCatchupOnly.affinity }}
3539
affinity:
36-
{{ toYaml (omit .Values.hostListenerCatchupOnly.affinity "enabled") | indent 8 }}
40+
{{- toYaml . | nindent 8 }}
3741
{{- end }}
38-
{{- if and .Values.hostListenerCatchupOnly.tolerations .Values.hostListenerCatchupOnly.tolerations.enabled }}
42+
{{- with .Values.hostListenerCatchupOnly.tolerations }}
3943
tolerations:
40-
{{ toYaml .Values.hostListenerCatchupOnly.tolerations.items | indent 8 }}
44+
{{- toYaml . | nindent 8 }}
4145
{{- end }}
4246
{{- if .Values.hostListenerCatchupOnly.serviceAccountName }}
4347
serviceAccountName: {{ .Values.hostListenerCatchupOnly.serviceAccountName }}
@@ -47,14 +51,50 @@ spec:
4751
image: {{ .Values.hostListenerCatchupOnly.image.name }}:{{ .Values.hostListenerCatchupOnly.image.tag }}
4852
command: ["host_listener"]
4953
args:
50-
{{- range $arg := .Values.hostListenerCatchupOnly.args }}
51-
{{- if not (hasPrefix "--dependent-ops-max-per-chain=" $arg) }}
52-
- {{ $arg | quote }}
54+
- --database-url=$(DATABASE_URL)
55+
- --url=$(ETHEREUM_RPC_URL)
56+
- --acl-contract-address=$(ACL_CONTRACT_ADDRESS)
57+
- --tfhe-contract-address=$(FHEVM_EXECUTOR_CONTRACT_ADDRESS)
58+
- --health-port={{ .Values.hostListenerCatchupOnly.ports.healthcheck }}
59+
- --dependent-ops-max-per-chain={{ int .Values.commonConfig.dependentOpsMaxPerChain }}
60+
- --log-level={{ .Values.hostListenerCatchupOnly.args.logLevel }}
61+
- --initial-block-time={{ .Values.hostListenerCatchupOnly.args.initialBlockTime }}
62+
- --dependence-cache-size={{ .Values.hostListenerCatchupOnly.args.dependenceCacheSize }}
63+
- --reorg-maximum-duration-in-blocks={{ .Values.hostListenerCatchupOnly.args.reorgMaximumDurationInBlocks }}
64+
- --service-name={{ .Values.hostListenerCatchupOnly.args.serviceName }}
65+
- --catchup-finalization-in-blocks={{ .Values.hostListenerCatchupOnly.args.catchupFinalizationInBlocks }}
66+
{{- if .Values.hostListenerCatchupOnly.args.onlyCatchupLoop }}
67+
- --only-catchup-loop
5368
{{- end }}
69+
- --end-at-block={{ .Values.hostListenerCatchupOnly.args.endAtBlock }}
70+
- --catchup-loop-sleep-secs={{ .Values.hostListenerCatchupOnly.args.catchupLoopSleepSecs }}
71+
- --coprocessor-api-key=$(TENANT_API_KEY)
72+
{{- with .Values.hostListenerCatchupOnly.extraArgs }}
73+
{{- toYaml . | nindent 12 }}
5474
{{- end }}
55-
- --dependent-ops-max-per-chain={{ int .Values.dependentOps.maxPerChain }}
5675
env:
57-
{{ toYaml .Values.hostListenerCatchupOnly.env | nindent 12 }}
76+
- name: DATABASE_URL
77+
value: {{ .Values.commonConfig.databaseUrl | quote }}
78+
- name: ETHEREUM_RPC_URL
79+
value: {{ .Values.commonConfig.hostChainWsUrl | quote }}
80+
- name: ACL_CONTRACT_ADDRESS
81+
value: {{ required "commonConfig.aclContractAddress is required" .Values.commonConfig.aclContractAddress | quote }}
82+
- name: FHEVM_EXECUTOR_CONTRACT_ADDRESS
83+
value: {{ required "commonConfig.fhevmExecutorContractAddress is required" .Values.commonConfig.fhevmExecutorContractAddress | quote }}
84+
{{- if default .Values.commonConfig.tracing.enabled .Values.hostListenerCatchupOnly.tracing.enabled }}
85+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
86+
value: {{ .Values.commonConfig.tracing.endpoint | quote }}
87+
- name: OTEL_SERVICE_NAME
88+
valueFrom:
89+
fieldRef:
90+
fieldPath: metadata.name
91+
{{- end }}
92+
{{- with .Values.commonConfig.env }}
93+
{{- toYaml . | nindent 12 }}
94+
{{- end }}
95+
{{- with .Values.hostListenerCatchupOnly.env }}
96+
{{- toYaml . | nindent 12 }}
97+
{{- end }}
5898
ports:
5999
{{- range $portName, $portValue := .Values.hostListenerCatchupOnly.ports }}
60100
- name: {{ $portName }}
@@ -70,10 +110,10 @@ spec:
70110
memory: {{ .Values.hostListenerCatchupOnly.resources.limits.memory | default "512Mi" }}
71111
{{- if and .Values.hostListenerCatchupOnly.probes .Values.hostListenerCatchupOnly.probes.liveness.enabled }}
72112
livenessProbe:
73-
{{ toYaml (omit .Values.hostListenerCatchupOnly.probes.liveness "enabled") | nindent 12 }}
113+
{{- toYaml (omit .Values.hostListenerCatchupOnly.probes.liveness "enabled") | nindent 12 }}
74114
{{- end }}
75115
{{- if and .Values.hostListenerCatchupOnly.probes .Values.hostListenerCatchupOnly.probes.readiness.enabled }}
76116
readinessProbe:
77-
{{ toYaml (omit .Values.hostListenerCatchupOnly.probes.readiness "enabled") | nindent 12 }}
117+
{{- toYaml (omit .Values.hostListenerCatchupOnly.probes.readiness "enabled") | nindent 12 }}
78118
{{- end }}
79119
{{- end -}}

charts/coprocessor/templates/coprocessor-host-listener-deployment.yaml

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ spec:
3131
imagePullSecrets:
3232
- name: registry-credentials
3333
restartPolicy: Always
34-
{{- if and .Values.hostListener.affinity .Values.hostListener.affinity.enabled }}
34+
{{- with .Values.hostListener.nodeSelector }}
35+
nodeSelector:
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
38+
{{- with .Values.hostListener.affinity }}
3539
affinity:
36-
{{ toYaml (omit .Values.hostListener.affinity "enabled") | indent 8 }}
40+
{{- toYaml . | nindent 8 }}
3741
{{- end }}
38-
{{- if and .Values.hostListener.tolerations .Values.hostListener.tolerations.enabled }}
42+
{{- with .Values.hostListener.tolerations }}
3943
tolerations:
40-
{{ toYaml .Values.hostListener.tolerations.items | indent 8 }}
44+
{{- toYaml . | nindent 8 }}
4145
{{- end }}
4246
{{- if .Values.hostListener.serviceAccountName }}
4347
serviceAccountName: {{ .Values.hostListener.serviceAccountName }}
@@ -47,14 +51,44 @@ spec:
4751
image: {{ .Values.hostListener.image.name }}:{{ .Values.hostListener.image.tag }}
4852
command: ["host_listener"]
4953
args:
50-
{{- range $arg := .Values.hostListener.args }}
51-
{{- if not (hasPrefix "--dependent-ops-max-per-chain=" $arg) }}
52-
- {{ $arg | quote }}
54+
- --database-url=$(DATABASE_URL)
55+
- --url=$(ETHEREUM_RPC_URL)
56+
- --acl-contract-address=$(ACL_CONTRACT_ADDRESS)
57+
- --tfhe-contract-address=$(FHEVM_EXECUTOR_CONTRACT_ADDRESS)
58+
- --health-port={{ .Values.hostListener.ports.healthcheck }}
59+
- --dependent-ops-max-per-chain={{ int .Values.commonConfig.dependentOpsMaxPerChain }}
60+
- --log-level={{ .Values.hostListener.args.logLevel }}
61+
- --initial-block-time={{ .Values.hostListener.args.initialBlockTime }}
62+
- --reorg-maximum-duration-in-blocks={{ .Values.hostListener.args.reorgMaximumDurationInBlocks }}
63+
- --service-name={{ .Values.hostListener.args.serviceName }}
64+
- --catchup-finalization-in-blocks={{ .Values.hostListener.args.catchupFinalizationInBlocks }}
65+
- --coprocessor-api-key=$(TENANT_API_KEY)
66+
{{- with .Values.hostListener.extraArgs }}
67+
{{- toYaml . | nindent 12 }}
5368
{{- end }}
54-
{{- end }}
55-
- --dependent-ops-max-per-chain={{ int .Values.dependentOps.maxPerChain }}
5669
env:
57-
{{ toYaml .Values.hostListener.env | nindent 12 }}
70+
- name: DATABASE_URL
71+
value: {{ .Values.commonConfig.databaseUrl | quote }}
72+
- name: ETHEREUM_RPC_URL
73+
value: {{ .Values.commonConfig.hostChainWsUrl | quote }}
74+
- name: ACL_CONTRACT_ADDRESS
75+
value: {{ required "commonConfig.aclContractAddress is required" .Values.commonConfig.aclContractAddress | quote }}
76+
- name: FHEVM_EXECUTOR_CONTRACT_ADDRESS
77+
value: {{ required "commonConfig.fhevmExecutorContractAddress is required" .Values.commonConfig.fhevmExecutorContractAddress | quote }}
78+
{{- if default .Values.commonConfig.tracing.enabled .Values.hostListener.tracing.enabled }}
79+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
80+
value: {{ .Values.commonConfig.tracing.endpoint | quote }}
81+
- name: OTEL_SERVICE_NAME
82+
valueFrom:
83+
fieldRef:
84+
fieldPath: metadata.name
85+
{{- end }}
86+
{{- with .Values.commonConfig.env }}
87+
{{- toYaml . | nindent 12 }}
88+
{{- end }}
89+
{{- with .Values.hostListener.env }}
90+
{{- toYaml . | nindent 12 }}
91+
{{- end }}
5892
ports:
5993
{{- range $portName, $portValue := .Values.hostListener.ports }}
6094
- name: {{ $portName }}
@@ -70,10 +104,10 @@ spec:
70104
memory: {{ .Values.hostListener.resources.limits.memory | default "512Mi" }}
71105
{{- if and .Values.hostListener.probes .Values.hostListener.probes.liveness.enabled }}
72106
livenessProbe:
73-
{{ toYaml (omit .Values.hostListener.probes.liveness "enabled") | nindent 12 }}
107+
{{- toYaml (omit .Values.hostListener.probes.liveness "enabled") | nindent 12 }}
74108
{{- end }}
75109
{{- if and .Values.hostListener.probes .Values.hostListener.probes.readiness.enabled }}
76110
readinessProbe:
77-
{{ toYaml (omit .Values.hostListener.probes.readiness "enabled") | nindent 12 }}
111+
{{- toYaml (omit .Values.hostListener.probes.readiness "enabled") | nindent 12 }}
78112
{{- end }}
79113
{{- end -}}

0 commit comments

Comments
 (0)