Skip to content

Commit

Permalink
Merge pull request #63 from langchain-ai/infra/allow-overriding-command
Browse files Browse the repository at this point in the history
Allow overriding command in helm
  • Loading branch information
langchain-infra authored Feb 2, 2024
2 parents 45b31b9 + fc11478 commit 4a4d15c
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 28 deletions.
2 changes: 1 addition & 1 deletion charts/langsmith/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ maintainers:
email: [email protected]
description: Helm chart to deploy the langsmith application and all services it depends on.
type: application
version: 0.2.9
version: 0.2.10
appVersion: "0.1.0"
4 changes: 4 additions & 0 deletions charts/langsmith/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ spec:
serviceAccountName: {{ include "backend.serviceAccountName" . }}
containers:
- name: {{ .Values.backend.name }}
{{- with.Values.backend.deployment.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- include "langsmith.commonEnv" . | nindent 12 }}
- name: OPENAI_API_KEY
Expand Down
14 changes: 7 additions & 7 deletions charts/langsmith/templates/backend/run-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ spec:
serviceAccountName: {{ include "backend.serviceAccountName" . }}
containers:
- name: {{ .Values.backend.name }}
command: ["/bin/bash", "-c", "alembic upgrade head"]
{{- with .Values.backend.migrations.postgresCommand }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- include "langsmith.commonEnv" . | nindent 12 }}
{{- with .Values.backend.migrations.extraEnv }}
Expand All @@ -60,13 +63,10 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
- name: {{ .Values.backend.name }}-clickhouse
{{- with .Values.backend.migrations.clickhouseCommand }}
command:
- migrate
- -source
- file://clickhouse/migrations
- -database
- "clickhouse://$(CLICKHOUSE_HOST):$(CLICKHOUSE_NATIVE_PORT)?username=$(CLICKHOUSE_USER)&password=$(CLICKHOUSE_PASSWORD)&database=$(CLICKHOUSE_DB)&x-multi-statement=true&x-migrations-table-engine=MergeTree"
- up
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- include "langsmith.commonEnv" . | nindent 12 }}
{{- with .Values.backend.migrations.extraEnv }}
Expand Down
5 changes: 4 additions & 1 deletion charts/langsmith/templates/clickhouse/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ spec:
- name: {{ .Values.clickhouse.name }}
image: "{{ .Values.images.clickhouseImage.repository }}:{{ .Values.images.clickhouseImage.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.images.clickhouseImage.pullPolicy }}
command: ["/bin/bash", "-c", "sed 's/id -g/id -gn/' /entrypoint.sh > /tmp/entrypoint.sh; exec bash /tmp/entrypoint.sh"]
{{- with.Values.clickhouse.statefulSet.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: CLICKHOUSE_DB
valueFrom:
Expand Down
4 changes: 4 additions & 0 deletions charts/langsmith/templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ spec:
serviceAccountName: {{ include "frontend.serviceAccountName" . }}
containers:
- name: {{ .Values.frontend.name }}
{{- with.Values.frontend.deployment.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- if .Values.config.oauth.enabled }}
- name: VITE_OAUTH_CLIENT_ID
Expand Down
4 changes: 4 additions & 0 deletions charts/langsmith/templates/hub-backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ spec:
serviceAccountName: {{ include "hubBackend.serviceAccountName" . }}
containers:
- name: {{ .Values.hubBackend.name }}
{{- with.Values.hubBackend.deployment.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- include "langsmith.commonEnv" . | nindent 12 }}
- name: PORT
Expand Down
4 changes: 4 additions & 0 deletions charts/langsmith/templates/playground/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ spec:
serviceAccountName: {{ include "playground.serviceAccountName" . }}
containers:
- name: {{ .Values.playground.name }}
{{- with.Values.playground.deployment.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.playground.deployment.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
Expand Down
10 changes: 4 additions & 6 deletions charts/langsmith/templates/postgres/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ spec:
serviceAccountName: {{ include "postgres.serviceAccountName" . }}
containers:
- name: {{ .Values.postgres.name }}
args:
- postgres
- -c
- log_min_messages=WARNING
- -c
- client_min_messages=WARNING
{{- with.Values.postgres.statefulSet.command }}
command:
{{ . }}
{{- end }}
env:
- name: POSTGRES_DB
valueFrom:
Expand Down
16 changes: 3 additions & 13 deletions charts/langsmith/templates/queue/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,10 @@ spec:
restartPolicy: Always
containers:
- name: {{ .Values.queue.name }}
{{- with.Values.queue.deployment.command }}
command:
- rq
- worker
- --with-scheduler
- -u
- $(REDIS_DATABASE_URI)
- --serializer
- lc_database.queue.serializer.ORJSONSerializer
- --worker-class
- lc_database.queue.worker.Worker
- --connection-class
- lc_database.queue.connection.RedisRetry
- --job-class
- lc_database.queue.job.AsyncJob
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- include "langsmith.commonEnv" . | nindent 12 }}
{{- with .Values.queue.deployment.extraEnv }}
Expand Down
4 changes: 4 additions & 0 deletions charts/langsmith/templates/redis/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ spec:
serviceAccountName: {{ include "redis.serviceAccountName" . }}
containers:
- name: {{ .Values.redis.name }}
{{- with.Values.redis.statefulSet.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.redis.statefulSet.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
Expand Down
41 changes: 41 additions & 0 deletions charts/langsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ backend:
# requests:
# cpu: 200m
# memory: 500Mi
command: []
extraEnv: []
sidecars: []
nodeSelector: {}
Expand All @@ -96,6 +97,17 @@ backend:
# requests:
# cpu: 200m
# memory: 500Mi
clickhouseCommand:
- "migrate"
- "-source"
- "file://clickhouse/migrations"
- "-database"
- "clickhouse://$(CLICKHOUSE_HOST):$(CLICKHOUSE_NATIVE_PORT)?username=$(CLICKHOUSE_USER)&password=$(CLICKHOUSE_PASSWORD)&database=$(CLICKHOUSE_DB)&x-multi-statement=true&x-migrations-table-engine=MergeTree"
- "up"
postgresCommand:
- "/bin/bash"
- "-c"
- "alembic upgrade head"
extraEnv: []
sidecars: []
nodeSelector: {}
Expand Down Expand Up @@ -142,6 +154,16 @@ clickhouse:
podSecurityContext: {}
securityContext: {}
resources: {}
# limits:
# cpu: 4000m
# memory: 16Gi
# requests:
# cpu: 1000m
# memory: 4Gi
command:
- "/bin/bash"
- "-c"
- "sed 's/id -g/id -gn/' /entrypoint.sh > /tmp/entrypoint.sh; exec bash /tmp/entrypoint.sh"
nodeSelector: {}
tolerations: []
affinity: {}
Expand Down Expand Up @@ -181,6 +203,7 @@ frontend:
# requests:
# cpu: 200m
# memory: 500Mi
command: []
extraEnv: []
sidecars: []
nodeSelector: {}
Expand Down Expand Up @@ -223,6 +246,7 @@ hubBackend:
# requests:
# cpu: 200m
# memory: 500Mi
command: []
extraEnv: []
sidecars: []
nodeSelector: {}
Expand Down Expand Up @@ -264,6 +288,7 @@ playground:
# requests:
# cpu: 200m
# memory: 500Mi
command: []
extraEnv: []
sidecars: []
nodeSelector: {}
Expand Down Expand Up @@ -318,6 +343,7 @@ postgres:
# requests:
# cpu: 1000m
# memory: 4Gi
command: []
extraEnv: []
sidecars: []
nodeSelector: {}
Expand Down Expand Up @@ -357,6 +383,20 @@ queue:
# requests:
# cpu: 200m
# memory: 500Mi
command:
- rq
- worker
- --with-scheduler
- -u
- $(REDIS_DATABASE_URI)
- --serializer
- lc_database.queue.serializer.ORJSONSerializer
- --worker-class
- lc_database.queue.worker.Worker
- --connection-class
- lc_database.queue.connection.RedisRetry
- --job-class
- lc_database.queue.job.AsyncJob
extraEnv: []
sidecars: []
nodeSelector: {}
Expand Down Expand Up @@ -396,6 +436,7 @@ redis:
# requests:
# cpu: 1000m
# memory: 2Gi
command: []
extraEnv: []
sidecars: []
nodeSelector: {}
Expand Down

0 comments on commit 4a4d15c

Please sign in to comment.