v0 migration job

This commit is contained in:
Ishaan Jaff 2024-11-12 10:52:19 -08:00
parent 5081b912eb
commit 78d7e87490

View 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: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ["python", "/path/to/prisma_migration.py"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.databaseSecret }}
key: database_url
- name: DISABLE_SCHEMA_UPDATE
value: "False" # Toggle this for environments like review labs
restartPolicy: OnFailure
backoffLimit: 3