From ec42f6b22ddb39774286a8b1162ff7a39c377ddb Mon Sep 17 00:00:00 2001 From: infra Date: Fri, 5 Jul 2024 19:57:30 -0400 Subject: [PATCH 1/2] fix: only show env vars if necessary --- charts/langsmith/Chart.yaml | 2 +- charts/langsmith/templates/_helpers.tpl | 4 +++- charts/langsmith/templates/backend/deployment.yaml | 3 +++ .../langsmith/templates/clickhouse/stateful-set.yaml | 3 +++ charts/langsmith/templates/frontend/deployment.yaml | 3 +++ .../templates/platform-backend/deployment.yaml | 3 +++ charts/langsmith/templates/playground/deployment.yaml | 11 ++++++++--- charts/langsmith/templates/postgres/stateful-set.yaml | 3 +++ charts/langsmith/templates/queue/deployment.yaml | 3 +++ charts/langsmith/templates/redis/stateful-set.yaml | 11 ++++++++--- 10 files changed, 38 insertions(+), 8 deletions(-) diff --git a/charts/langsmith/Chart.yaml b/charts/langsmith/Chart.yaml index 668a485..0c093cb 100644 --- a/charts/langsmith/Chart.yaml +++ b/charts/langsmith/Chart.yaml @@ -5,5 +5,5 @@ maintainers: email: ankush@langchain.dev description: Helm chart to deploy the langsmith application and all services it depends on. type: application -version: 0.6.12 +version: 0.6.13 appVersion: "0.6.23" diff --git a/charts/langsmith/templates/_helpers.tpl b/charts/langsmith/templates/_helpers.tpl index 0be0f6a..0f1884b 100644 --- a/charts/langsmith/templates/_helpers.tpl +++ b/charts/langsmith/templates/_helpers.tpl @@ -200,20 +200,22 @@ Template containing common environment variables that are used by several servic key: openai_api_key - name: GO_ENDPOINT value: http://{{- include "langsmith.fullname" . }}-{{.Values.platformBackend.name}}:{{ .Values.platformBackend.service.port }} +{{- if .Values.config.ttl.enabled }} - name: FF_TRACE_TIERS_ENABLED value: {{ .Values.config.ttl.enabled | quote }} -{{- if .Values.config.ttl.enabled }} - name: FF_UPGRADE_TRACE_TIER_ENABLED value: "true" - name: TRACE_TIER_TTL_DURATION_SEC_MAP value: "{ \"longlived\": {{ .Values.config.ttl.ttl_period_seconds.longlived }}, \"shortlived\": {{ .Values.config.ttl.ttl_period_seconds.shortlived }} }" {{- end }} +{{- if .Values.config.orgCreationDisabled }} - name: FF_ORG_CREATION_DISABLED value: {{ .Values.config.orgCreationDisabled | quote }} {{- if .Values.commonEnv }} {{ toYaml .Values.commonEnv }} {{- end }} {{- end }} +{{- end }} {{- define "backend.serviceAccountName" -}} {{- if .Values.backend.serviceAccount.create -}} diff --git a/charts/langsmith/templates/backend/deployment.yaml b/charts/langsmith/templates/backend/deployment.yaml index 3d91cd2..29866bc 100644 --- a/charts/langsmith/templates/backend/deployment.yaml +++ b/charts/langsmith/templates/backend/deployment.yaml @@ -56,6 +56,9 @@ spec: {{- with .Values.backend.deployment.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.commonEnv }} + {{ toYaml . | nindent 12 }} + {{- end }} envFrom: - configMapRef: name: {{ include "langsmith.fullname" . }}-config diff --git a/charts/langsmith/templates/clickhouse/stateful-set.yaml b/charts/langsmith/templates/clickhouse/stateful-set.yaml index 4081c84..5831d87 100644 --- a/charts/langsmith/templates/clickhouse/stateful-set.yaml +++ b/charts/langsmith/templates/clickhouse/stateful-set.yaml @@ -67,6 +67,9 @@ spec: {{- with .Values.clickhouse.statefulSet.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.commonEnv }} + {{ toYaml . | nindent 12 }} + {{- end }} ports: - name: ch containerPort: {{ .Values.clickhouse.containerHttpPort }} diff --git a/charts/langsmith/templates/frontend/deployment.yaml b/charts/langsmith/templates/frontend/deployment.yaml index 94925a6..ac544cf 100644 --- a/charts/langsmith/templates/frontend/deployment.yaml +++ b/charts/langsmith/templates/frontend/deployment.yaml @@ -69,6 +69,9 @@ spec: - name: VITE_SUBDOMAIN value: {{ .Values.ingress.subdomain }} {{- end }} + {{- with .Values.commonEnv }} + {{ toYaml . | nindent 12 }} + {{- end }} envFrom: - configMapRef: name: {{ include "langsmith.fullname" . }}-config diff --git a/charts/langsmith/templates/platform-backend/deployment.yaml b/charts/langsmith/templates/platform-backend/deployment.yaml index f2f3617..274af57 100644 --- a/charts/langsmith/templates/platform-backend/deployment.yaml +++ b/charts/langsmith/templates/platform-backend/deployment.yaml @@ -56,6 +56,9 @@ spec: {{- with .Values.platformBackend.deployment.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.commonEnv }} + {{ toYaml . | nindent 12 }} + {{- end }} envFrom: - configMapRef: name: {{ include "langsmith.fullname" . }}-config diff --git a/charts/langsmith/templates/playground/deployment.yaml b/charts/langsmith/templates/playground/deployment.yaml index d2101a4..56d1792 100644 --- a/charts/langsmith/templates/playground/deployment.yaml +++ b/charts/langsmith/templates/playground/deployment.yaml @@ -49,10 +49,15 @@ spec: command: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.playground.deployment.extraEnv }} + {{- if or .Values.playground.deployment.extraEnv .Values.commonEnv }} env: - {{- toYaml . | nindent 12 }} - {{- end }} + {{- with .Values.playground.deployment.extraEnv}} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.commonEnv}} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} image: "{{ .Values.images.playgroundImage.repository }}:{{ .Values.images.playgroundImage.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.images.playgroundImage.pullPolicy }} ports: diff --git a/charts/langsmith/templates/postgres/stateful-set.yaml b/charts/langsmith/templates/postgres/stateful-set.yaml index beed24b..da5859a 100644 --- a/charts/langsmith/templates/postgres/stateful-set.yaml +++ b/charts/langsmith/templates/postgres/stateful-set.yaml @@ -67,6 +67,9 @@ spec: {{- with .Values.postgres.statefulSet.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.commonEnv }} + {{- toYaml . | nindent 12 }} + {{- end }} image: "{{ .Values.images.postgresImage.repository }}:{{ .Values.images.postgresImage.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.images.postgresImage.pullPolicy }} ports: diff --git a/charts/langsmith/templates/queue/deployment.yaml b/charts/langsmith/templates/queue/deployment.yaml index 1085064..995a95b 100644 --- a/charts/langsmith/templates/queue/deployment.yaml +++ b/charts/langsmith/templates/queue/deployment.yaml @@ -59,6 +59,9 @@ spec: {{- with .Values.queue.deployment.extraEnv }} {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.commonEnv }} + {{- toYaml . | nindent 12 }} + {{- end }} envFrom: - configMapRef: name: {{ include "langsmith.fullname" . }}-config diff --git a/charts/langsmith/templates/redis/stateful-set.yaml b/charts/langsmith/templates/redis/stateful-set.yaml index a7b4d6b..093f4c5 100644 --- a/charts/langsmith/templates/redis/stateful-set.yaml +++ b/charts/langsmith/templates/redis/stateful-set.yaml @@ -46,10 +46,15 @@ spec: command: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.redis.statefulSet.extraEnv }} + {{- if or .Values.redis.statefulSet.extraEnv .Values.commonEnv }} env: - {{- toYaml . | nindent 12 }} - {{- end }} + {{- with .Values.redis.statefulSet.extraEnv}} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.commonEnv}} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} image: "{{ .Values.images.redisImage.repository }}:{{ .Values.images.redisImage.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.images.redisImage.pullPolicy }} ports: From 6b9de5f09ad357edfb4d8a30b96c1d3be7a07e1d Mon Sep 17 00:00:00 2001 From: infra Date: Fri, 5 Jul 2024 20:09:13 -0400 Subject: [PATCH 2/2] fix test --- charts/langsmith/templates/_helpers.tpl | 3 --- 1 file changed, 3 deletions(-) diff --git a/charts/langsmith/templates/_helpers.tpl b/charts/langsmith/templates/_helpers.tpl index 0f1884b..285d967 100644 --- a/charts/langsmith/templates/_helpers.tpl +++ b/charts/langsmith/templates/_helpers.tpl @@ -211,9 +211,6 @@ Template containing common environment variables that are used by several servic {{- if .Values.config.orgCreationDisabled }} - name: FF_ORG_CREATION_DISABLED value: {{ .Values.config.orgCreationDisabled | quote }} -{{- if .Values.commonEnv }} -{{ toYaml .Values.commonEnv }} -{{- end }} {{- end }} {{- end }}