Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions charts/langsmith/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,14 @@ Template containing common environment variables that are used by several servic
key: insights_encryption_key
optional: false
{{- end }}
{{- if .Values.config.polly.enabled }}
- name: POLLY_ENCRYPTION_KEY
valueFrom:
secretKeyRef:
name: {{ include "langsmith.secretsName" . }}
key: polly_encryption_key
optional: false
{{- end }}
{{- end }}


Expand Down Expand Up @@ -601,6 +609,9 @@ Template containing common environment variables that are used by several servic
{{- if .Values.config.insights.enabled }}
{{- $createProducts = append $createProducts "insights" }}
{{- end }}
{{- if .Values.config.polly.enabled }}
{{- $createProducts = append $createProducts "smith_polly" }}
{{- end }}
{{ toYaml $createProducts }}
{{- end -}}

Expand All @@ -612,6 +623,9 @@ Template containing common environment variables that are used by several servic
{{- if not .Values.config.insights.enabled }}
{{- $destroyProducts = append $destroyProducts "insights" }}
{{- end }}
{{- if not .Values.config.polly.enabled }}
{{- $destroyProducts = append $destroyProducts "smith_polly" }}
{{- end }}
{{ toYaml $destroyProducts }}
{{- end -}}

Expand Down
14 changes: 14 additions & 0 deletions charts/langsmith/templates/agent-bootstrap/bootstrap-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ spec:
"memory_limit_mb": {{ .Values.config.insights.agent.resources.memoryLimitMb }},
"min_scale": {{ .Values.config.insights.agent.resources.minScale }},
"max_scale": {{ .Values.config.insights.agent.resources.maxScale }}
}{{- if .Values.config.polly.enabled }},{{- end }}
{{- end }}
{{- if .Values.config.polly.enabled }}
"smith-polly": {
"image": "{{ include "langsmith.image" (dict "Values" .Values "Chart" .Chart "component" "pollyAgentImage") }}",
"configmap_name": "{{ include "langsmith.fullname" . }}-polly-config",
"k8s_namespace": "{{ .Values.namespace | default .Release.Namespace }}",
"restart_deployments": ["{{ include "langsmith.fullname" . }}-{{ .Values.frontend.name }}"],
"cpu": {{ .Values.config.polly.agent.resources.cpu }},
"cpu_limit": {{ .Values.config.polly.agent.resources.cpuLimit }},
"memory_mb": {{ .Values.config.polly.agent.resources.memoryMb }},
"memory_limit_mb": {{ .Values.config.polly.agent.resources.memoryLimitMb }},
"min_scale": {{ .Values.config.polly.agent.resources.minScale }},
"max_scale": {{ .Values.config.polly.agent.resources.maxScale }}
}
{{- end }}
}
Expand Down
5 changes: 4 additions & 1 deletion charts/langsmith/templates/agent-bootstrap/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ automountServiceAccountToken: {{ .Values.backend.agentBootstrap.serviceAccount.a
{{- end }}
---
# Role + RoleBinding: only when at least one product is enabled (create path patches ConfigMaps and restarts deployments)
{{- if and .Values.backend.agentBootstrap.enabled .Values.config.deployment.enabled (or .Values.config.agentBuilder.enabled .Values.config.insights.enabled) }}
{{- if and .Values.backend.agentBootstrap.enabled .Values.config.deployment.enabled (or .Values.config.agentBuilder.enabled .Values.config.insights.enabled .Values.config.polly.enabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand All @@ -47,6 +47,9 @@ rules:
{{- if .Values.config.insights.enabled }}
- {{ include "langsmith.fullname" . }}-insights-config
{{- end }}
{{- if .Values.config.polly.enabled }}
- {{ include "langsmith.fullname" . }}-polly-config
{{- end }}
# Permission to restart deployments after ConfigMap updates
- apiGroups: ["apps"]
resources: ["deployments"]
Expand Down
3 changes: 3 additions & 0 deletions charts/langsmith/templates/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ data:
FF_USE_PG_FOR_FEEDBACK_CONFIGS_FETCH_ENABLED_ALL: "true"
FF_USE_PG_FOR_FEEDBACK_FETCH_ENABLED_ALL: "true"
IS_SELF_HOSTED: "true"
{{- if .Values.config.polly.enabled }}
SELF_HOSTED_POLLY_ENABLED: "true"
{{- end }}
# Security - CORS configuration
{{- if .Values.config.security.cors.allowedOriginsRegex }}
CORS_ALLOWED_ORIGINS_REGEX: {{ .Values.config.security.cors.allowedOriginsRegex | quote }}
Expand Down
9 changes: 9 additions & 0 deletions charts/langsmith/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
- name: VITE_SELF_HOSTED_CLIO_ENABLED
value: {{ .enabled | quote }}
{{- end }}
{{- with .Values.config.polly }}
- name: VITE_SELF_HOSTED_POLLY_ENABLED
value: {{ .enabled | quote }}
{{- end }}
{{- /* Agent Builder OAuth provider IDs for frontend */ -}}
{{- if .Values.config.agentBuilder.oauth.googleOAuthProvider }}
- name: VITE_GOOGLE_OAUTH_PROVIDER
Expand Down Expand Up @@ -138,6 +142,11 @@ spec:
name: {{ include "langsmith.fullname" . }}-agent-builder-config
optional: true
{{- end }}
{{- if .Values.config.polly.enabled }}
- configMapRef:
name: {{ include "langsmith.fullname" . }}-polly-config
optional: true
{{- end }}
image: {{ include "langsmith.image" (dict "Values" .Values "Chart" .Chart "component" "frontendImage") | quote }}
imagePullPolicy: {{ .Values.images.frontendImage.pullPolicy }}
ports:
Expand Down
1 change: 1 addition & 0 deletions charts/langsmith/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ data:
azure_storage_connection_string: {{ .Values.config.blobStorage.azureStorageConnectionString | b64enc | quote }}
agent_builder_encryption_key: {{ .Values.config.agentBuilder.encryptionKey | b64enc | quote }}
insights_encryption_key: {{ .Values.config.insights.encryptionKey | b64enc | quote }}
polly_encryption_key: {{ .Values.config.polly.encryptionKey | b64enc | quote }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/langsmith/templates/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ AWS Marketplace Helm template verification).
{{- fail "config.insights.encryptionKey is required when Insights is enabled. Generate one with: python -c \"from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())\"" -}}
{{- end -}}

{{- /* Validate polly configuration */ -}}
{{- if and .Values.config.polly.enabled (not .Values.config.deployment.enabled) -}}
{{- fail "config.deployment.enabled must be true when Polly is enabled. Polly requires LangSmith Deployments." -}}
{{- end -}}
{{- if and .Values.config.polly.enabled (not .Values.config.polly.encryptionKey) (not .Values.config.existingSecretName) -}}
{{- fail "config.polly.encryptionKey is required when Polly is enabled. Generate one with: python -c \"from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())\"" -}}
{{- end -}}

{{- /* Validate autoscaling configuration for all services */ -}}
{{- $autoscalingServices := dict
"aceBackend" .Values.aceBackend.autoscaling
Expand Down
13 changes: 13 additions & 0 deletions charts/langsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ config:
minScale: 1
maxScale: 5

# Polly configuration
polly:
enabled: false
encryptionKey: ""
agent:
resources:
cpu: 2
cpuLimit: 4
memoryMb: 4096
memoryLimitMb: 8192
minScale: 1
maxScale: 5

# Agent Builder configuration - UI for creating and managing agents
# Requires config.deployment.enabled to be true
agentBuilder:
Expand Down
Loading