Compare commits

...

3 Commits

Author SHA1 Message Date
HoloPanio 2c737b22f1 fix(dalpuri): exit(0) after sync completes to release k8s job
Prisma MSSQL adapter keeps connections open after the sync finishes,
preventing the process from exiting naturally. The k8s job was staying
in Running state indefinitely. Call process.exit(0) on success so the
job completes and the GH workflow step passes.
2026-04-08 21:50:52 +00:00
HoloPanio a3bfe9f374 fix(ci): increase dalpuri sync timeout from 30min to 2h
Full initial sync has 500k+ rows across all tables and exceeded the
30-minute activeDeadlineSeconds. Bump both the k8s job deadline and
the kubectl wait timeout to 7200s (2 hours).
2026-04-08 21:19:43 +00:00
HoloPanio a106bb15a8 fix(ci): explicit env vars in dalpuri sync job; add CW_DATABASE_URL to secret
envFrom was loading api-env-secret but CW_DATABASE_URL was absent from the
deployed secret, causing sync.ts to fall back to DATABASE_URL (Postgres) as
the MSSQL connection string -> 'Invalid port number: //optima'.

- Replaced envFrom with explicit CW_DATABASE_URL and API_DATABASE_URL env
  entries so the mapping is unambiguous
- Patched api-env-secret in cluster to add CW_DATABASE_URL
2026-04-08 20:41:49 +00:00
3 changed files with 16 additions and 10 deletions
+2 -2
View File
@@ -318,9 +318,9 @@ jobs:
TAG=${{ github.event.release.tag_name }} TAG=${{ github.event.release.tag_name }}
JOB="job/dalpuri-sync-${TAG}" JOB="job/dalpuri-sync-${TAG}"
kubectl wait --for=condition=complete --timeout=1800s -n optima "$JOB" & kubectl wait --for=condition=complete --timeout=7200s -n optima "$JOB" &
WAIT_COMPLETE=$! WAIT_COMPLETE=$!
kubectl wait --for=condition=failed --timeout=1800s -n optima "$JOB" & kubectl wait --for=condition=failed --timeout=7200s -n optima "$JOB" &
WAIT_FAILED=$! WAIT_FAILED=$!
wait -n $WAIT_COMPLETE $WAIT_FAILED wait -n $WAIT_COMPLETE $WAIT_FAILED
+6 -4
View File
@@ -8,7 +8,7 @@ metadata:
spec: spec:
backoffLimit: 0 backoffLimit: 0
ttlSecondsAfterFinished: 86400 ttlSecondsAfterFinished: 86400
activeDeadlineSeconds: 1800 activeDeadlineSeconds: 7200
template: template:
metadata: metadata:
labels: labels:
@@ -17,10 +17,12 @@ spec:
containers: containers:
- name: sync - name: sync
image: ghcr.io/horizonstacksoftware/optima-dalpuri-sync:RELEASE_TAG image: ghcr.io/horizonstacksoftware/optima-dalpuri-sync:RELEASE_TAG
envFrom:
- secretRef:
name: api-env-secret
env: env:
- name: CW_DATABASE_URL
valueFrom:
secretKeyRef:
name: api-env-secret
key: CW_DATABASE_URL
- name: API_DATABASE_URL - name: API_DATABASE_URL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
+8 -4
View File
@@ -1860,8 +1860,12 @@ export const executeForcedIncrementalDalpuriSync = async (options?: {
}; };
if (import.meta.main) { if (import.meta.main) {
executeFullDalpuriSync().catch((error) => { executeFullDalpuriSync()
console.error("CW -> API sync failed:", error); .then(() => {
process.exit(1); process.exit(0);
}); })
.catch((error) => {
console.error("CW -> API sync failed:", error);
process.exit(1);
});
} }