From 78d7e87490f6a53764de4cef197aefd90b1eb5ae Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 12 Nov 2024 10:52:19 -0800 Subject: [PATCH] v0 migration job --- .../templates/migrations-job.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 deploy/charts/litellm-helm/templates/migrations-job.yaml diff --git a/deploy/charts/litellm-helm/templates/migrations-job.yaml b/deploy/charts/litellm-helm/templates/migrations-job.yaml new file mode 100644 index 000000000..64aa9d3c5 --- /dev/null +++ b/deploy/charts/litellm-helm/templates/migrations-job.yaml @@ -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