Skip to content

Commit 92dd517

Browse files
committed
update helm charts to dev
1 parent e4c3b73 commit 92dd517

5 files changed

Lines changed: 131 additions & 27 deletions

File tree

charts/d2e-services/charts/d2e-core/templates/core-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ spec:
285285
args:
286286
[
287287
"-c",
288-
"npm run cli db seed -- --swe && npx @logto/cli db alteration rollback 1.23.0 && npx @logto/cli db alteration deploy 1.23.1",
288+
"npm run cli db seed -- --swe && npm run cli db alteration deploy latest && node packages/core/d2e-grants.mjs",
289289
]
290290
resources:
291291
{{- toYaml .Values.global.resources.logtoSeedInit | nindent 12 }}

charts/d2e-services/ci/test-values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ global:
170170
LOGTO__CLIENTID_PASSWORD__BASIC_AUTH: "Y2ktbTJtOmNpLW0ybS1zZWNyZXQ="
171171
SUPABASE_STORAGE_JWT_SECRET: "ci-supabase-jwt-secret-not-real-0000000000"
172172
SUPABASE_STORAGE_JWT_TOKEN: ""
173+
TREX__SQL__PASSWORD: "pencil"
174+
TREX_ROOT_KEY: "ndDfri0G85Aw/P+s5jYqdnuBFdfbbY8irhrI9gFSE1Q="
173175
resources:
174176
caddy:
175177
requests: { cpu: 25m, memory: 50Mi }
@@ -189,6 +191,9 @@ global:
189191
dataflowGen:
190192
requests: { cpu: 50m, memory: 150Mi }
191193
limits: { cpu: 500m, memory: 500Mi }
194+
dataflowGenWorker:
195+
requests: { cpu: 100m, memory: 250Mi }
196+
limits: { cpu: 250m, memory: 1000Mi }
192197

193198
features:
194199
materializeCohorts: false

charts/d2e-services/templates/d2e-deployment.yaml

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,13 @@ spec:
385385
echo "webapi-init: SQL scripts complete";
386386
tail -f /dev/null
387387
- name: trex
388+
command: ["/bin/sh", "-c"]
389+
args:
390+
- |
391+
mkdir -p /usr/src/cert
392+
printf '%s' "$TLS__INTERNAL__CRT" > /usr/src/cert/cert.pem
393+
printf '%s' "$TLS__INTERNAL__KEY" > /usr/src/cert/key.pem
394+
exec /usr/src/entrypoint.sh
388395
env:
389396
- name: RUST_BACKTRACE
390397
value: "full"
@@ -404,6 +411,24 @@ spec:
404411
key: AZ_AUTO_GRANT_RESEARCHER_BY_DATASET_CODES
405412
- name: USER_MGMT__ROLE_SOURCE
406413
value: "logto"
414+
- name: NETWORK_COGNITO_DOMAIN
415+
value: ""
416+
- name: NETWORK_CENTRAL_API_URL
417+
value: ""
418+
- name: NETWORK_MACHINE_CLIENT_ID
419+
value: ""
420+
- name: NETWORK_TOKEN_SCOPE
421+
value: ""
422+
- name: NETWORK_COORDINATOR_CLIENT_ID
423+
value: ""
424+
- name: NETWORK_COORDINATOR_TOKEN_SCOPE
425+
value: ""
426+
- name: NETWORK_CLIENT_SECRET
427+
value: ""
428+
- name: NETWORK_ENC_KEY
429+
value: ""
430+
- name: NETWORK_COORDINATOR_CLIENT_SECRET
431+
value: ""
407432
- name: CADDY__D2E__PUBLIC_FQDN
408433
valueFrom:
409434
configMapKeyRef:
@@ -736,6 +761,11 @@ spec:
736761
value: postgres
737762
- name: TREX__SQL__DBNAME
738763
value: postgres
764+
- name: TREX__SQL__PASSWORD
765+
valueFrom:
766+
secretKeyRef:
767+
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
768+
key: TREX__SQL__PASSWORD
739769
- name: TREX__ENDPOINT_URL
740770
value: "http://localhost:33001"
741771
- name: TREX_ROUTES
@@ -746,6 +776,14 @@ spec:
746776
value: "1024"
747777
- name: TREXSQL_ENABLED
748778
value: "true"
779+
- name: "PG_SCHEMA"
780+
value: "trexdb,notebook"
781+
- name: HADES_ENVS_BASE_DIR
782+
value: /data/hades/envs
783+
- name: HADES_OUTPUT_BASE_DIR
784+
value: /data/hades/runs
785+
- name: HADES_WORK_SCHEMA
786+
value: _config.work
749787
- name: SWARM_NODE
750788
value: d2e
751789
- name: SWARM_CONFIG
@@ -770,7 +808,7 @@ spec:
770808
},
771809
{
772810
"name": "pgwire",
773-
"config": { "host": "0.0.0.0", "port": 5433, "password": "dummy" }
811+
"config": { "host": "0.0.0.0", "port": 5433, "password": "$(TREX__SQL__PASSWORD)" }
774812
}
775813
]
776814
}
@@ -872,6 +910,20 @@ spec:
872910
key: PG__SSL
873911
- name: PREFECT_API_URL
874912
value: http://dataflow-gen.d2e.svc.cluster.local:443/d2e/api
913+
- name: PREFECT_HEALTH_CHECK
914+
value: "http://dataflow-gen.d2e.svc.cluster.local:443/d2e/api/health"
915+
- name: PREFECT_POOL
916+
value: "process-pool"
917+
- name: WORKPOOL_TYPE
918+
value: "process"
919+
- name: DEFAULT_FLOW_COMMAND
920+
value: "/app/run-flow.sh d2e-flows"
921+
- name: STORAGE_FILE_BACKEND_PATH
922+
value: "/usr/src/data/storage"
923+
- name: TREX_STORAGE_URL
924+
value: "http://localhost:33001/plugins/trex/storage-api"
925+
- name: TREX_STORAGE_SERVICE_KEY
926+
value: ""
875927
- name: PROJECT_NAME
876928
value: d2e
877929
- name: SERVICE_ROUTES
@@ -920,8 +972,6 @@ spec:
920972
key: TLS__INTERNAL__KEY
921973
- name: TREX__SQL__PORT
922974
value: "443"
923-
- name: TREX__SQL__PASSWORD
924-
value: "dummy"
925975
- name: TREX_SQL_PASSWORD
926976
value: "$(TREX__SQL__PASSWORD)"
927977
- name: JASYPT_ENCRYPTOR_ENABLED
@@ -938,6 +988,28 @@ spec:
938988
value: "false"
939989
- name: ANALYTICS_HANA_STREAMING_ENABLED
940990
value: {{ .Values.features.materializeCohorts | quote }}
991+
- name: DATABASE_URL
992+
valueFrom:
993+
secretKeyRef:
994+
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
995+
key: STORAGE__JDBC__URL
996+
- name: TREX_ROOT_KEY
997+
valueFrom:
998+
secretKeyRef:
999+
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
1000+
key: TREX_ROOT_KEY
1001+
- name: BETTER_AUTH_SECRET
1002+
value: "$(TREX_ROOT_KEY)"
1003+
- name: BETTER_AUTH_URL
1004+
value: "http://localhost:33001/trex"
1005+
- name: BASE_PATH
1006+
value: /trex
1007+
- name: SCHEMA_DIR
1008+
value: /usr/src/core/schema
1009+
- name: PLUGINS_DEV_PATH
1010+
value: "/usr/src/plugins-dev:/usr/src/bundled-plugins"
1011+
- name: D2E_COMPAT
1012+
value: "true"
9411013
- name: ANALYTICS_STREAMING_CHUNK_SIZE_BY_DIALECT
9421014
value: '{"hana": 10000}'
9431015
- name: IS_SELF_MANAGED_ROLES
@@ -977,11 +1049,11 @@ spec:
9771049
command:
9781050
- /bin/sh
9791051
- -c
980-
- curl -f http://localhost:33001/_internal/health || exit 1
981-
failureThreshold: 5
982-
initialDelaySeconds: 200
983-
periodSeconds: 5
1052+
- curl -fk https://localhost:33000/trex/_internal/health || curl -f http://localhost:33001/trex/_internal/health || exit 1
1053+
initialDelaySeconds: 120
1054+
periodSeconds: 10
9841055
timeoutSeconds: 10
1056+
failureThreshold: 30
9851057
{{- if .Values.features.materializeCohorts }}
9861058
- name: materialize-cohorts
9871059
command: ["npm", "run", "start"]
@@ -1015,7 +1087,8 @@ spec:
10151087
protocol: TCP
10161088
resources:
10171089
requests:
1018-
cpu: 100m
1090+
# cpu: 100m
1091+
cpu: 50m # for dev
10191092
memory: 200Mi
10201093
limits:
10211094
cpu: 1000m

charts/d2e-services/templates/d2e-secrets.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ data:
3737
SECURITY_DB_DATASOURCE_URL: '{{ printf "jdbc:postgresql://%s:5432/%s?currentSchema=webapi_security&sslmode=%s" .Values.global.secrets.POSTGRES_HOST .Values.global.secrets.POSTGRES_CONFIG_DB .Values.global.pgSSLMode | b64enc }}'
3838
SUPABASE_STORAGE_JWT_SECRET: "{{ .Values.global.secrets.SUPABASE_STORAGE_JWT_SECRET | b64enc }}"
3939
SUPABASE_STORAGE_JWT_TOKEN: "{{ .Values.global.secrets.SUPABASE_STORAGE_JWT_TOKEN | b64enc }}"
40+
TREX__SQL__PASSWORD: "{{ .Values.global.secrets.TREX__SQL__PASSWORD | b64enc }}"
41+
TREX_ROOT_KEY: "{{ .Values.global.secrets.TREX_ROOT_KEY | b64enc }}"
4042
{{- if .Values.features.materializeCohorts }}
4143
---
4244
apiVersion: v1

charts/d2e-services/templates/dataflow-worker-deployment.yaml

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ spec:
1919
spec:
2020
serviceAccountName: dataflow-gen-svc-acc
2121
restartPolicy: Always
22+
affinity:
23+
podAffinity:
24+
requiredDuringSchedulingIgnoredDuringExecution:
25+
- labelSelector:
26+
matchLabels:
27+
profile: d2e-functions
28+
topologyKey: kubernetes.io/hostname
2229
# nodeSelector:
2330
# "kubernetes.io/os": linux
2431
# "system": "d2e"
@@ -38,7 +45,7 @@ spec:
3845
[
3946
"sh",
4047
"-c",
41-
"while :;do sleep {{ .Values.dataflowWorker.readinessSleep }} && wget -O success-trex http://trex-http.d2e.svc.cluster.local:443/_internal/health && wget -O success-dataflow http://dataflow-gen.d2e.svc.cluster.local:443/d2e/api/health && if test -f success-trex; then if test -f success-dataflow; then exit 0; fi; fi; done",
48+
"while :;do sleep {{ .Values.dataflowWorker.readinessSleep }} && wget -O success-trex http://trex-http.d2e.svc.cluster.local:443/trex/_internal/health && wget -O success-dataflow http://dataflow-gen.d2e.svc.cluster.local:443/d2e/api/health && if test -f success-trex; then if test -f success-dataflow; then exit 0; fi; fi; done",
4249
]
4350
resources:
4451
requests:
@@ -140,6 +147,9 @@ spec:
140147
- name: d2e-worker-cm
141148
configMap:
142149
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
150+
- name: trex-volume
151+
persistentVolumeClaim:
152+
claimName: trex-pvc
143153
containers:
144154
- name: dataflow-gen-worker
145155
env:
@@ -211,6 +221,12 @@ spec:
211221
value: postgresql+asyncpg://$(PG__USER):$(PG__PASSWORD)@$(PG__HOST):5432/$(PG__DB_NAME)
212222
- name: PREFECT_API_URL
213223
value: http://dataflow-gen.d2e.svc.cluster.local:443/d2e/api
224+
- name: INSTALL_SQLALCHEMY_HANA
225+
value: "true"
226+
- name: TREX_STORAGE_URL
227+
value: "http://trex-http.d2e.svc.cluster.local:443/plugins/trex/storage-api"
228+
- name: TREX_STORAGE_SERVICE_KEY
229+
value: ""
214230
- name: PREFECT_API_ENABLE_HTTP2
215231
value: "False"
216232
- name: PREFECT_WORKER_WEBSERVER_HOST
@@ -258,32 +274,40 @@ spec:
258274
secretKeyRef:
259275
name: "{{ .Release.Name }}-{{ .Chart.Name }}"
260276
key: TLS__INTERNAL__CA_CRT
261-
command: ["/bin/sh"]
277+
command:
278+
- pixi
279+
- run
280+
- --manifest-path
281+
- /opt/worker/pyproject.toml
282+
- sh
283+
- -c
262284
args:
263-
[
264-
"-c",
265-
"rm -rf /root/.prefect/storage/run_cache.db /root/.prefect/storage/events.db; pip install prefect[kubernetes]==3.6.10 && prefect work-pool create 'docker-pool' --type kubernetes; prefect worker start --pool 'docker-pool' --type kubernetes --name prefect-docker-worker --with-healthcheck",
266-
]
267-
image: prefecthq/prefect:3.6.10-python3.12
268-
imagePullPolicy: IfNotPresent
285+
- >-
286+
rm -rf /root/.prefect/storage/run_cache.db /root/.prefect/storage/events.db;
287+
prefect work-pool create '${PREFECT_POOL:-process-pool}' --type ${WORKPOOL_TYPE:-process};
288+
prefect worker start --pool '${PREFECT_POOL:-process-pool}' --type ${WORKPOOL_TYPE:-process}
289+
--name prefect-${WORKPOOL_TYPE:-process}-worker --with-healthcheck
290+
--limit {{ .Values.dataflowWorker.flowRunLimit | default 3 }}
291+
image: ghcr.io/ohdsi/d2e-dataflow-gen-worker:{{ .Values.global.image.tag }}
292+
imagePullPolicy: Always
269293
volumeMounts:
270294
- mountPath: /opt/prefect/libs/baseJobTemplate.json
271295
name: d2e-worker-cm
272296
subPath: baseJobTemplate.json
297+
- mountPath: /app/duckdb_data
298+
name: trex-volume
273299
resources:
274-
requests:
275-
cpu: 100m
276-
memory: 250Mi
277-
limits:
278-
cpu: 250m
279-
memory: 1000Mi
300+
{{- toYaml .Values.global.resources.dataflowGenWorker | nindent 12 }}
280301
livenessProbe:
281302
exec:
282303
command:
283-
- wget
284-
- -O
285-
- liveness
286-
- http://localhost:8080/health
304+
- pixi
305+
- run
306+
- --manifest-path
307+
- /opt/worker/pyproject.toml
308+
- python
309+
- -c
310+
- "import urllib.request, sys; sys.exit(0 if 200 <= urllib.request.urlopen('http://localhost:8080/health', timeout=5).getcode() < 300 else 1)"
287311
failureThreshold: 5
288312
initialDelaySeconds: 120
289313
periodSeconds: 10

0 commit comments

Comments
 (0)