forked from phoenix/litellm-mirror
(feat) helm hook to sync db schema (#6715)
* v0 migration job * fix job
This commit is contained in:
parent
5081b912eb
commit
688d513459
2 changed files with 36 additions and 0 deletions
27
deploy/charts/litellm-helm/templates/migrations-job.yaml
Normal file
27
deploy/charts/litellm-helm/templates/migrations-job.yaml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
"""
|
||||||
|
This job runs the prisma migrations for the LiteLLM DB.
|
||||||
|
"""
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: {{ include "litellm.fullname" . }}-migrations
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": pre-install,pre-upgrade
|
||||||
|
"helm.sh/hook-weight": "0"
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: prisma-migrations
|
||||||
|
image: "ghcr.io/berriai/litellm:main-stable"
|
||||||
|
command: ["python", "/litellm/proxy/prisma_migration.py"]
|
||||||
|
env:
|
||||||
|
- name: DATABASE_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .Values.db.secret.name }}
|
||||||
|
key: url
|
||||||
|
- name: DISABLE_SCHEMA_UPDATE
|
||||||
|
value: "{{ .Values.migrationJob.disableSchemaUpdate }}"
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
backoffLimit: {{ .Values.migrationJob.backoffLimit }}
|
|
@ -179,3 +179,12 @@ postgresql:
|
||||||
redis:
|
redis:
|
||||||
enabled: false
|
enabled: false
|
||||||
architecture: standalone
|
architecture: standalone
|
||||||
|
|
||||||
|
# Prisma migration job settings
|
||||||
|
migrationJob:
|
||||||
|
enabled: true # Enable or disable the schema migration Job
|
||||||
|
retries: 3 # Number of retries for the Job in case of failure
|
||||||
|
backoffLimit: 4 # Backoff limit for Job restarts
|
||||||
|
disableSchemaUpdate: false # Skip schema migrations for specific environments. When True, the job will exit with code 0.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue