Skip to content

Commit

Permalink
feat: add langfuse v3 support (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen911 authored Dec 9, 2024
1 parent 7c3a816 commit cb06625
Show file tree
Hide file tree
Showing 11 changed files with 500 additions and 77 deletions.
118 changes: 117 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,118 @@
Chart.lock
charts/*/charts/*
charts/*/charts/*

# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,intellij+all,helm
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,intellij+all,helm

### Helm ###
# Chart dependencies
**/charts/*.tgz

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,intellij+all,helm
137 changes: 106 additions & 31 deletions README.md

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions charts/langfuse/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: langfuse
version: 0.8.0
version: 0.9.0
description: Open source LLM engineering platform - LLM observability, metrics, evaluations, prompt management.
type: application
keywords:
Expand All @@ -18,9 +18,21 @@ dependencies:
version: 15.x.x
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.deploy
- name: clickhouse
version: 6.x.x
repository: oci://registry-1.docker.io/bitnamicharts
condition: clickhouse.deploy
- name: valkey
version: 1.x.x
repository: oci://registry-1.docker.io/bitnamicharts
condition: valkey.deploy
- name: minio
version: 14.x.x
repository: oci://registry-1.docker.io/bitnamicharts
condition: minio.deploy
maintainers:
- name: langfuse
email: contact@langfuse.com
url: https://langfuse.com/
icon: https://langfuse.com/langfuse_logo.png
appVersion: "2"
appVersion: "3"
1 change: 0 additions & 1 deletion charts/langfuse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Create the name of the service account to use
{{- end }}
{{- end }}


{{/*
Create the name of the secret for nextauth
*/}}
Expand Down
154 changes: 154 additions & 0 deletions charts/langfuse/templates/deployment-web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "langfuse.fullname" . }}-web
labels:
{{- include "langfuse.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ coalesce (.Values.langfuse.web).replicas .Values.replicaCount 1 }}
{{- end }}
selector:
matchLabels:
{{- include "langfuse.selectorLabels" . | nindent 6 }}
app: web
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "langfuse.selectorLabels" . | nindent 8 }}
app: web
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "langfuse.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.langfuse.extraInitContainers }}
initContainers:
{{- toYaml .Values.langfuse.extraInitContainers | nindent 8 }}
{{- end }}
{{- if .Values.langfuse.extraVolumes }}
volumes:
{{- toYaml .Values.langfuse.extraVolumes | nindent 8 }}
{{- end }}
containers:
{{- if .Values.langfuse.extraContainers }}
{{- toYaml .Values.langfuse.extraContainers | nindent 8 }}
{{- end }}
- name: {{ .Chart.Name }}-web
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: LANGFUSE_EE_LICENSE_KEY
value: {{ .Values.langfuse.licenseKey | quote }}
- name: NODE_ENV
value: {{ .Values.langfuse.nodeEnv | quote }}
- name: HOSTNAME
value: "0.0.0.0"
- name: PORT
value: {{ .Values.langfuse.port | quote }}
{{- if .Values.postgresql.auth.username }}
- name: DATABASE_USERNAME
value: {{ .Values.postgresql.auth.username | quote }}
{{- end }}
{{- if .Values.postgresql.auth.password }}
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "langfuse.postgresql.fullname" . }}
key: postgres-password
{{- end }}
{{- if .Values.postgresql.host }}
- name: DATABASE_HOST
value: {{ .Values.postgresql.deploy | ternary (include "langfuse.postgresql.fullname" . | quote) (.Values.postgresql.host | quote) }}
{{- end }}
{{- if .Values.postgresql.auth.database }}
- name: DATABASE_NAME
value: {{ .Values.postgresql.auth.database | quote }}
{{- end }}
{{- if not .Values.postgresql.deploy }}
{{- if .Values.postgresql.directUrl }}
- name: DIRECT_URL
valueFrom:
secretKeyRef:
name: {{ include "langfuse.postgresqlSecretName" . }}
key: postgres-direct-url
{{- end }}
{{- if .Values.postgresql.shadowDatabaseUrl }}
- name: SHADOW_DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ include "langfuse.postgresqlSecretName" . }}
key: postgres-shadow-database-url
{{- end }}
{{- end }}
- name: NEXTAUTH_URL
value: {{ .Values.langfuse.nextauth.url | quote }}
{{- if .Values.langfuse.nextauth.secret }}
- name: NEXTAUTH_SECRET
valueFrom:
secretKeyRef:
name: {{ include "langfuse.nextauthSecretName" . }}
key: nextauth-secret
{{- end }}
{{- if .Values.langfuse.salt }}
- name: SALT
value: {{ .Values.langfuse.salt | quote }}
{{- end }}
- name: TELEMETRY_ENABLED
value: {{ .Values.langfuse.telemetryEnabled | quote }}
- name: NEXT_PUBLIC_SIGN_UP_DISABLED
value: {{ .Values.langfuse.nextPublicSignUpDisabled | quote }}
- name: ENABLE_EXPERIMENTAL_FEATURES
value: {{ .Values.langfuse.enableExperimentalFeatures | quote }}
{{- if .Values.langfuse.additionalEnv }}
{{- toYaml .Values.langfuse.additionalEnv | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.langfuse.port }}
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.langfuse.next.healthcheckBasePath | default "" | trimSuffix "/" }}/api/public/health
port: http
initialDelaySeconds: {{ coalesce ((.Values.langfuse.web).livenessProbe).initialDelaySeconds 20 }}
periodSeconds: {{ coalesce ((.Values.langfuse.web).livenessProbe).periodSeconds 10 }}
timeoutSeconds: {{ coalesce ((.Values.langfuse.web).livenessProbe).timeoutSeconds 5 }}
successThreshold: {{ coalesce ((.Values.langfuse.web).livenessProbe).successThreshold 1 }}
failureThreshold: {{ coalesce ((.Values.langfuse.web).livenessProbe).failureThreshold 5 }}
readinessProbe:
httpGet:
path: {{ .Values.langfuse.next.healthcheckBasePath | default "" | trimSuffix "/" }}/api/public/ready
port: http
initialDelaySeconds: {{ coalesce ((.Values.langfuse.web).readinessProbe).initialDelaySeconds 20 }}
periodSeconds: {{ coalesce ((.Values.langfuse.web).readinessProbe).periodSeconds 10 }}
timeoutSeconds: {{ coalesce ((.Values.langfuse.web).readinessProbe).timeoutSeconds 5 }}
successThreshold: {{ coalesce ((.Values.langfuse.web).readinessProbe).successThreshold 1 }}
failureThreshold: {{ coalesce ((.Values.langfuse.web).readinessProbe).failureThreshold 5 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.langfuse.extraVolumeMounts }}
volumeMounts:
{{- toYaml .Values.langfuse.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading

0 comments on commit cb06625

Please sign in to comment.