From 50b9c3aaab8ef791f3bf658ef18cd7fafd7fede4 Mon Sep 17 00:00:00 2001 From: infra Date: Thu, 7 Mar 2024 16:20:37 -0800 Subject: [PATCH 1/7] release: bump chart image versions --- charts/langsmith/README.md | 24 +++------ .../templates/backend/deployment.yaml | 2 +- .../templates/frontend/config-map.yaml | 54 ------------------- .../templates/frontend/deployment.yaml | 2 +- .../templates/hub-backend/deployment.yaml | 3 +- .../templates/playground/deployment.yaml | 3 +- .../langsmith/templates/queue/deployment.yaml | 3 +- charts/langsmith/values.yaml | 36 ++++--------- 8 files changed, 26 insertions(+), 101 deletions(-) diff --git a/charts/langsmith/README.md b/charts/langsmith/README.md index d1ea21d..b9bfecc 100644 --- a/charts/langsmith/README.md +++ b/charts/langsmith/README.md @@ -1,6 +1,6 @@ # langsmith -![Version: 0.3.2](https://img.shields.io/badge/Version-0.3.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) +![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) Helm chart to deploy the langsmith application and all services it depends on. @@ -261,16 +261,16 @@ We typically validate deployment using the following quickstart guide: | fullnameOverride | string | `""` | String to fully override `"langsmith.fullname"` | | images.backendImage.pullPolicy | string | `"IfNotPresent"` | | | images.backendImage.repository | string | `"docker.io/langchain/langchainplus-backend"` | | -| images.backendImage.tag | string | `"d2c7513"` | | +| images.backendImage.tag | string | `"0.1.18"` | | | images.clickhouseImage.pullPolicy | string | `"Always"` | | | images.clickhouseImage.repository | string | `"docker.io/clickhouse/clickhouse-server"` | | | images.clickhouseImage.tag | string | `"23.9"` | | | images.frontendImage.pullPolicy | string | `"IfNotPresent"` | | | images.frontendImage.repository | string | `"docker.io/langchain/langchainplus-frontend-dynamic"` | | -| images.frontendImage.tag | string | `"d2c7513"` | | +| images.frontendImage.tag | string | `"0.1.18"` | | | images.hubBackendImage.pullPolicy | string | `"IfNotPresent"` | | | images.hubBackendImage.repository | string | `"docker.io/langchain/langchainhub-backend"` | | -| images.hubBackendImage.tag | string | `"d2c7513"` | | +| images.hubBackendImage.tag | string | `"0.1.18"` | | | images.imagePullSecrets | list | `[]` | Secrets with credentials to pull images from a private registry. Specified as name: value. | | images.playgroundImage.pullPolicy | string | `"IfNotPresent"` | | | images.playgroundImage.repository | string | `"docker.io/langchain/langchainplus-playground"` | | @@ -590,19 +590,9 @@ We typically validate deployment using the following quickstart guide: | queue.autoscaling.targetCPUUtilizationPercentage | int | `80` | | | queue.deployment.affinity | object | `{}` | | | queue.deployment.annotations | object | `{}` | | -| queue.deployment.command[0] | string | `"rq"` | | -| queue.deployment.command[10] | string | `"lc_database.queue.connection.RedisRetry"` | | -| queue.deployment.command[11] | string | `"--job-class"` | | -| queue.deployment.command[12] | string | `"lc_database.queue.job.AsyncJob"` | | -| queue.deployment.command[1] | string | `"worker"` | | -| queue.deployment.command[2] | string | `"--with-scheduler"` | | -| queue.deployment.command[3] | string | `"-u"` | | -| queue.deployment.command[4] | string | `"$(REDIS_DATABASE_URI)"` | | -| queue.deployment.command[5] | string | `"--serializer"` | | -| queue.deployment.command[6] | string | `"lc_database.queue.serializer.ORJSONSerializer"` | | -| queue.deployment.command[7] | string | `"--worker-class"` | | -| queue.deployment.command[8] | string | `"lc_database.queue.worker.Worker"` | | -| queue.deployment.command[9] | string | `"--connection-class"` | | +| queue.deployment.command[0] | string | `"saq"` | | +| queue.deployment.command[1] | string | `"app.async_worker.settings"` | | +| queue.deployment.command[2] | string | `"--quiet"` | | | queue.deployment.extraContainerConfig | object | `{}` | | | queue.deployment.extraEnv | list | `[]` | | | queue.deployment.labels | object | `{}` | | diff --git a/charts/langsmith/templates/backend/deployment.yaml b/charts/langsmith/templates/backend/deployment.yaml index c910aaa..f241f30 100644 --- a/charts/langsmith/templates/backend/deployment.yaml +++ b/charts/langsmith/templates/backend/deployment.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - checksum/config: {{ include (print $.Template.BasePath "/backend/config-map.yaml") . | sha256sum }} + rollme: {{ randAlphaNum 5 | quote }} {{- with .Values.backend.deployment.annotations }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/langsmith/templates/frontend/config-map.yaml b/charts/langsmith/templates/frontend/config-map.yaml index 92c7430..12c78e8 100644 --- a/charts/langsmith/templates/frontend/config-map.yaml +++ b/charts/langsmith/templates/frontend/config-map.yaml @@ -86,33 +86,6 @@ data: index index.html index.htm; try_files $uri $uri/ /{{ .Values.ingress.subdomain }}/index.html; } - - {{- if .Values.frontend.cache.enabled }} - location ~ /{{ .Values.ingress.subdomain }}/proxy/openai { - rewrite /{{ .Values.ingress.subdomain }}/proxy/openai/(.*) /v1/$1 break; - proxy_pass {{ .Values.frontend.cache.config.openAIUrl }}; - proxy_set_header Host api.openai.com; - - - proxy_set_header Connection ''; - proxy_ignore_headers Cache-Control; - proxy_ignore_headers "Set-Cookie"; - - proxy_buffer_size 2k; - - proxy_cache llm_cache; - proxy_cache_methods POST; - proxy_cache_key "{{ .Values.frontend.cache.config.openAIUrl }}|$request_method|$request_uri|$request_body"; - proxy_cache_valid 200 302 10m; - proxy_cache_valid 404 1m; - proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; - proxy_cache_background_update on; - - add_header X-Cache-Status $upstream_cache_status; - client_body_buffer_size 4m; - access_log /dev/stdout cache_log; - } - {{- end }} } {{- else }} nginx.conf: | @@ -186,32 +159,5 @@ data: proxy_cache off; proxy_pass http://{{ include "langsmith.fullname" . }}-{{ .Values.backend.name }}:{{ .Values.backend.service.port }}; } - - {{- if .Values.frontend.cache.enabled }} - location ~ /proxy/openai { - rewrite /proxy/openai/(.*) /v1/$1 break; - proxy_pass {{ .Values.frontend.cache.config.openAIUrl }}; - proxy_set_header Host api.openai.com; - - - proxy_set_header Connection ''; - proxy_ignore_headers Cache-Control; - proxy_ignore_headers "Set-Cookie"; - - proxy_buffer_size 2k; - - proxy_cache llm_cache; - proxy_cache_methods POST; - proxy_cache_key "{{ .Values.frontend.cache.config.openAIUrl }}|$request_method|$request_uri|$request_body"; - proxy_cache_valid 200 302 10m; - proxy_cache_valid 404 1m; - proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; - proxy_cache_background_update on; - - add_header X-Cache-Status $upstream_cache_status; - client_body_buffer_size 4m; - access_log /dev/stdout cache_log; - } - {{- end }} } {{- end }} diff --git a/charts/langsmith/templates/frontend/deployment.yaml b/charts/langsmith/templates/frontend/deployment.yaml index 72bee3b..9847b38 100644 --- a/charts/langsmith/templates/frontend/deployment.yaml +++ b/charts/langsmith/templates/frontend/deployment.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - checksum/config: {{ include (print $.Template.BasePath "/frontend/config-map.yaml") . | sha256sum }} + rollme: {{ randAlphaNum 5 | quote }} {{- with .Values.frontend.deployment.annotations }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/langsmith/templates/hub-backend/deployment.yaml b/charts/langsmith/templates/hub-backend/deployment.yaml index 6c9e04d..580999a 100644 --- a/charts/langsmith/templates/hub-backend/deployment.yaml +++ b/charts/langsmith/templates/hub-backend/deployment.yaml @@ -22,8 +22,9 @@ spec: app.kubernetes.io/component: {{ include "langsmith.fullname" . }}-{{ .Values.hubBackend.name }} template: metadata: - {{- with .Values.hubBackend.deployment.annotations }} annotations: + rollme: {{ randAlphaNum 5 | quote }} + {{- with .Values.hubBackend.deployment.annotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: diff --git a/charts/langsmith/templates/playground/deployment.yaml b/charts/langsmith/templates/playground/deployment.yaml index 11beff9..08f5422 100644 --- a/charts/langsmith/templates/playground/deployment.yaml +++ b/charts/langsmith/templates/playground/deployment.yaml @@ -22,8 +22,9 @@ spec: app.kubernetes.io/component: {{ include "langsmith.fullname" . }}-{{ .Values.playground.name }} template: metadata: - {{- with .Values.playground.deployment.annotations }} annotations: + rollme: {{ randAlphaNum 5 | quote }} + {{- with .Values.playground.deployment.annotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: diff --git a/charts/langsmith/templates/queue/deployment.yaml b/charts/langsmith/templates/queue/deployment.yaml index 149ed18..e11999f 100644 --- a/charts/langsmith/templates/queue/deployment.yaml +++ b/charts/langsmith/templates/queue/deployment.yaml @@ -22,8 +22,9 @@ spec: app.kubernetes.io/component: {{ include "langsmith.fullname" . }}-{{ .Values.queue.name }} template: metadata: - {{- with .Values.queue.deployment.annotations }} annotations: + rollme: {{ randAlphaNum 5 | quote }} + {{- with .Values.queue.deployment.annotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: diff --git a/charts/langsmith/values.yaml b/charts/langsmith/values.yaml index d757a9d..a1e34db 100644 --- a/charts/langsmith/values.yaml +++ b/charts/langsmith/values.yaml @@ -15,15 +15,15 @@ images: backendImage: repository: "docker.io/langchain/langchainplus-backend" pullPolicy: IfNotPresent - tag: "d2c7513" + tag: "0.1.18" frontendImage: repository: "docker.io/langchain/langchainplus-frontend-dynamic" pullPolicy: IfNotPresent - tag: "d2c7513" + tag: "0.1.18" hubBackendImage: repository: "docker.io/langchain/langchainhub-backend" pullPolicy: IfNotPresent - tag: "d2c7513" + tag: "0.1.18" playgroundImage: repository: "docker.io/langchain/langchainplus-playground" pullPolicy: IfNotPresent @@ -198,6 +198,7 @@ clickhouse: affinity: {} volumes: [] volumeMounts: [] + # We recommend using a persistent volume and increasing the storage size to something like 50Gi when using in a persistent environment! persistence: size: 8Gi storageClassName: "" @@ -219,11 +220,6 @@ frontend: name: "frontend" containerPort: 8080 existingConfigMapName: "" - # Turn on LLM Proxy Cache - cache: - enabled: true - config: - openAIUrl: "https://api.openai.com" deployment: replicas: 1 labels: {} @@ -425,25 +421,15 @@ queue: securityContext: {} resources: {} # limits: -# cpu: 1000m -# memory: 1Gi +# cpu: 2000m +# memory: 4Gi # requests: -# cpu: 200m -# memory: 500Mi +# cpu: 1000m +# memory: 2000Mi 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" + - "saq" + - "app.async_worker.settings" + - "--quiet" extraContainerConfig: {} extraEnv: [] sidecars: [] From 364d1992ebf1ed6783977d15269fe91366c08b0f Mon Sep 17 00:00:00 2001 From: infra Date: Thu, 7 Mar 2024 16:39:32 -0800 Subject: [PATCH 2/7] release: create backend-ingress --- charts/langsmith/Chart.yaml | 4 +- charts/langsmith/README.md | 2 +- charts/langsmith/README.md.gotmpl | 2 +- charts/langsmith/templates/api_ingress.yaml | 41 +++++++++++++++++++++ charts/langsmith/values.yaml | 11 +++++- 5 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 charts/langsmith/templates/api_ingress.yaml diff --git a/charts/langsmith/Chart.yaml b/charts/langsmith/Chart.yaml index e985278..8d8cac9 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.3.5 -appVersion: "0.1.0" +version: 0.3.6 +appVersion: "0.1.18" diff --git a/charts/langsmith/README.md b/charts/langsmith/README.md index b9bfecc..3e45e56 100644 --- a/charts/langsmith/README.md +++ b/charts/langsmith/README.md @@ -1,6 +1,6 @@ # langsmith -![Version: 0.3.5](https://img.shields.io/badge/Version-0.3.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) +![Version: 0.3.6](https://img.shields.io/badge/Version-0.3.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.18](https://img.shields.io/badge/AppVersion-0.1.18-informational?style=flat-square) Helm chart to deploy the langsmith application and all services it depends on. diff --git a/charts/langsmith/README.md.gotmpl b/charts/langsmith/README.md.gotmpl index 93e93a0..0c65fc8 100644 --- a/charts/langsmith/README.md.gotmpl +++ b/charts/langsmith/README.md.gotmpl @@ -35,7 +35,7 @@ Ensure you have the following tools/items ready. 3. LangSmith License Key 1. You can get this from your Langchain representative. Contact us at support@langchain.dev for more information. 3. SSL(optional) - 1. This should be attachable to a load balancer that + 1. This should be attachable to the load balancer that you will be provisioning. 4. OpenAI API Key(optional). 1. Used for natural language search feature. Can specify OpenAI key in browser as well for the playground feature. 5. Oauth Configuration(optional). diff --git a/charts/langsmith/templates/api_ingress.yaml b/charts/langsmith/templates/api_ingress.yaml new file mode 100644 index 0000000..05685f8 --- /dev/null +++ b/charts/langsmith/templates/api_ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.apiIngress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "langsmith.fullname" . }}-api-ingress + annotations: + {{- include "langsmith.annotations" . | nindent 4 }} + {{- with .Values.apiIngress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + external-dns.alpha.kubernetes.io/hostname: {{ .Values.apiIngress.hostname }} + labels: + {{- include "langsmith.labels" . | nindent 4 }} + {{- with .Values.apiIngress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: {{ .Values.apiIngress.ingressClassName }} + {{- with .Values.apiIngress.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - host: {{ .Values.apiIngress.hostname }} + http: + paths: + - path: /{{ .Values.apiIngress.subdomain }} + pathType: Prefix + backend: + service: + name: {{ include "langsmith.fullname" . }}-{{ .Values.backend.name }} + port: + number: {{ .Values.backend.service.port }} + - path: /{{ .Values.apiIngress.subdomain }} + pathType: Prefix + backend: + service: + name: {{ include "langsmith.fullname" . }}-{{ .Values.backend.name }} + port: + number: {{ .Values.backend.service.port }} +{{- end }} diff --git a/charts/langsmith/values.yaml b/charts/langsmith/values.yaml index a1e34db..de6dee4 100644 --- a/charts/langsmith/values.yaml +++ b/charts/langsmith/values.yaml @@ -42,14 +42,23 @@ images: tag: "23.9" ingress: + enabled: false hostname: "" subdomain: "" - enabled: false ingressClassName: "" annotations: {} labels: {} tls: [] +apiIngress: + enabled: false + hostname: "" + subdomain: "" + ingressClassName: "" + annotations: { } + labels: { } + tls: [] + config: existingSecretName: "" openaiApiKey: "" From 8b29a717218ee80784f1f4ff56018ba30c25ce79 Mon Sep 17 00:00:00 2001 From: infra Date: Thu, 7 Mar 2024 17:30:23 -0800 Subject: [PATCH 3/7] Add an api Bingress --- charts/langsmith/templates/api_ingress.yaml | 6 +++--- charts/langsmith/templates/clickhouse/config-map.yaml | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/charts/langsmith/templates/api_ingress.yaml b/charts/langsmith/templates/api_ingress.yaml index 05685f8..3f5564f 100644 --- a/charts/langsmith/templates/api_ingress.yaml +++ b/charts/langsmith/templates/api_ingress.yaml @@ -24,18 +24,18 @@ spec: - host: {{ .Values.apiIngress.hostname }} http: paths: - - path: /{{ .Values.apiIngress.subdomain }} + - path: /{{ .Values.apiIngress.subdomain }}/api/v1 pathType: Prefix backend: service: name: {{ include "langsmith.fullname" . }}-{{ .Values.backend.name }} port: number: {{ .Values.backend.service.port }} - - path: /{{ .Values.apiIngress.subdomain }} + - path: /{{ .Values.apiIngress.subdomain }}/api-hub/v1 pathType: Prefix backend: service: - name: {{ include "langsmith.fullname" . }}-{{ .Values.backend.name }} + name: {{ include "langsmith.fullname" . }}-{{ .Values.hubBackend.name }} port: number: {{ .Values.backend.service.port }} {{- end }} diff --git a/charts/langsmith/templates/clickhouse/config-map.yaml b/charts/langsmith/templates/clickhouse/config-map.yaml index 65e0553..0214a08 100644 --- a/charts/langsmith/templates/clickhouse/config-map.yaml +++ b/charts/langsmith/templates/clickhouse/config-map.yaml @@ -16,7 +16,17 @@ data: 1 1 1 + default + + + 1 + 2000000 + 1 + 0 + 1 + + {{- end }} From cf6510de35844caed1ef81272af97b2fb9d51a1e Mon Sep 17 00:00:00 2001 From: infra Date: Fri, 8 Mar 2024 09:50:17 -0500 Subject: [PATCH 4/7] add examples --- charts/langsmith/README.md.gotmpl | 8 +- .../examples/autoscaling_config.yaml | 62 +++++++++++++ charts/langsmith/examples/basic_config.yaml | 3 + charts/langsmith/examples/basic_external.yaml | 14 +++ charts/langsmith/examples/basic_oauth.yaml | 6 ++ charts/langsmith/examples/medium_size.yaml | 90 +++++++++++++++++++ charts/langsmith/values.yaml | 25 +++--- 7 files changed, 190 insertions(+), 18 deletions(-) create mode 100644 charts/langsmith/examples/autoscaling_config.yaml create mode 100644 charts/langsmith/examples/basic_config.yaml create mode 100644 charts/langsmith/examples/basic_external.yaml create mode 100644 charts/langsmith/examples/basic_oauth.yaml create mode 100644 charts/langsmith/examples/medium_size.yaml diff --git a/charts/langsmith/README.md.gotmpl b/charts/langsmith/README.md.gotmpl index 0c65fc8..8841302 100644 --- a/charts/langsmith/README.md.gotmpl +++ b/charts/langsmith/README.md.gotmpl @@ -104,11 +104,7 @@ config: postgres: external: enabled: true - host: - port: 5432 - user: - password: - database: + connectionUrl: "postgresql://:@:5432/" redis: external: enabled: true @@ -118,6 +114,8 @@ redis: You can also use existingSecretName to avoid checking in secrets. This secret will need to follow the same format as the secret in the corresponding `secrets.yaml` file. +More examples can be found in the `examples` directory. + ### Deploying to Kubernetes: diff --git a/charts/langsmith/examples/autoscaling_config.yaml b/charts/langsmith/examples/autoscaling_config.yaml new file mode 100644 index 0000000..53be424 --- /dev/null +++ b/charts/langsmith/examples/autoscaling_config.yaml @@ -0,0 +1,62 @@ +config: + langsmithLicenseKey: "YOUR_LICENSE_KEY" + +# Note, you likely should tweak the values to match your needs +backend: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +hubBackend: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +frontend: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +playground: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +queue: + deployment: + requests: + cpu: "1000m" + memory: "4Gi" + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 diff --git a/charts/langsmith/examples/basic_config.yaml b/charts/langsmith/examples/basic_config.yaml new file mode 100644 index 0000000..6cdf2a2 --- /dev/null +++ b/charts/langsmith/examples/basic_config.yaml @@ -0,0 +1,3 @@ +config: + langsmithLicenseKey: "YOUR_LICENSE_KEY" + # existingSecretName: "langsmith-config" You can also put the above into a secret if you want to avoid putting the license key in the values file. diff --git a/charts/langsmith/examples/basic_external.yaml b/charts/langsmith/examples/basic_external.yaml new file mode 100644 index 0000000..c35d95c --- /dev/null +++ b/charts/langsmith/examples/basic_external.yaml @@ -0,0 +1,14 @@ +config: + langsmithLicenseKey: "YOUR_LICENSE_KEY" + +postgres: + external: + enabled: true + connectionUrl: "default:foo@host:port/database?sslmode=require" + # existingSecretName: "postgres-secret" Can also put the above into a secret if you want to avoid putting the connection string in the values file. + +redis: + external: + enabled: true + connectionUrl: "redis://host:port" + # existingSecretName: "redis-secret" Can also put the above into a secret if you want to avoid putting the connection string in the values file. diff --git a/charts/langsmith/examples/basic_oauth.yaml b/charts/langsmith/examples/basic_oauth.yaml new file mode 100644 index 0000000..b3f403f --- /dev/null +++ b/charts/langsmith/examples/basic_oauth.yaml @@ -0,0 +1,6 @@ +config: + langsmithLicenseKey: "YOUR_LICENSE_KEY" + oauth: + enabled: true + oauthClientId: "YOUR_CLIENT_ID" + oauthIssuerUrl: "YOUR_ISSUER_URL" diff --git a/charts/langsmith/examples/medium_size.yaml b/charts/langsmith/examples/medium_size.yaml new file mode 100644 index 0000000..e4acae8 --- /dev/null +++ b/charts/langsmith/examples/medium_size.yaml @@ -0,0 +1,90 @@ +config: + langsmithLicenseKey: "YOUR_LICENSE_KEY" + openaiApiKey: "YOUR OPENAI API KEY" + oauth: + enabled: true + oauthClientId: "YOUR_CLIENT_ID" + oauthIssuerUrl: "YOUR_ISSUER_URL" + +# Note, you likely should tweak the values to match your needs +backend: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +hubBackend: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +frontend: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +playground: + deployment: + resources: + requests: + cpu: 500m + memory: 1000Mi + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +queue: + deployment: + requests: + cpu: "1000m" + memory: "4Gi" + autoscaling: + enabled: true + minReplicas: 1 + maxReplicas: 10 + targetCPUUtilizationPercentage: 50 + +# We suggest using an external database for production use cases. +postgres: + external: + enabled: true + connectionUrl: "default:foo@host:port/database?sslmode=require" + # existingSecretName: "postgres-secret" Can also put the above into a secret if you want to avoid putting the connection string in the values file. + +# We suggest using an external redis for production use cases. +redis: + external: + enabled: true + connectionUrl: "redis://host:port" + # existingSecretName: "redis-secret" Can also put the above into a secret if you want to avoid putting the connection string in the values file. + +clickhouse: + statefulset: + resources: + requests: + cpu: "2000m" + memory: "8Gi" + persistence: + size: "50Gi" diff --git a/charts/langsmith/values.yaml b/charts/langsmith/values.yaml index de6dee4..0d27177 100644 --- a/charts/langsmith/values.yaml +++ b/charts/langsmith/values.yaml @@ -13,21 +13,21 @@ images: # -- Secrets with credentials to pull images from a private registry. Specified as name: value. imagePullSecrets: [] backendImage: - repository: "docker.io/langchain/langchainplus-backend" + repository: "docker.io/langchain/langsmith-backend" pullPolicy: IfNotPresent tag: "0.1.18" frontendImage: - repository: "docker.io/langchain/langchainplus-frontend-dynamic" + repository: "docker.io/langchain/langsmith-frontend" pullPolicy: IfNotPresent tag: "0.1.18" hubBackendImage: - repository: "docker.io/langchain/langchainhub-backend" + repository: "docker.io/langchain/langhub-backend" pullPolicy: IfNotPresent tag: "0.1.18" playgroundImage: - repository: "docker.io/langchain/langchainplus-playground" + repository: "docker.io/langchain/langsmith-playground" pullPolicy: IfNotPresent - tag: "d2c7513" + tag: "0.1.18" postgresImage: repository: "docker.io/postgres" pullPolicy: IfNotPresent @@ -55,8 +55,8 @@ apiIngress: hostname: "" subdomain: "" ingressClassName: "" - annotations: { } - labels: { } + annotations: {} + labels: {} tls: [] config: @@ -190,11 +190,11 @@ clickhouse: securityContext: {} resources: {} # limits: - # cpu: 4000m - # memory: 16Gi + # cpu: 5000m + # memory: 20Gi # requests: - # cpu: 1000m - # memory: 4Gi + # cpu: 3000m + # memory: 12Gi command: - "/bin/bash" - "-c" @@ -207,7 +207,7 @@ clickhouse: affinity: {} volumes: [] volumeMounts: [] - # We recommend using a persistent volume and increasing the storage size to something like 50Gi when using in a persistent environment! + # We recommend using a persistent volume and increasing the storage size to something like 50Gi when using in a production environment! persistence: size: 8Gi storageClassName: "" @@ -404,7 +404,6 @@ postgres: volumes: [] volumeMounts: [] persistence: - enabled: false size: 8Gi storageClassName: "" service: From 46aa68a2d68da75d6374ac1a34c4dbeae905e1bd Mon Sep 17 00:00:00 2001 From: infra Date: Fri, 8 Mar 2024 09:50:42 -0500 Subject: [PATCH 5/7] add examples --- charts/langsmith/README.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/charts/langsmith/README.md b/charts/langsmith/README.md index 3e45e56..6224bee 100644 --- a/charts/langsmith/README.md +++ b/charts/langsmith/README.md @@ -35,7 +35,7 @@ Ensure you have the following tools/items ready. 3. LangSmith License Key 1. You can get this from your Langchain representative. Contact us at support@langchain.dev for more information. 3. SSL(optional) - 1. This should be attachable to a load balancer that + 1. This should be attachable to the load balancer that you will be provisioning. 4. OpenAI API Key(optional). 1. Used for natural language search feature. Can specify OpenAI key in browser as well for the playground feature. 5. Oauth Configuration(optional). @@ -104,11 +104,7 @@ config: postgres: external: enabled: true - host: - port: 5432 - user: - password: - database: + connectionUrl: "postgresql://:@:5432/" redis: external: enabled: true @@ -118,6 +114,8 @@ redis: You can also use existingSecretName to avoid checking in secrets. This secret will need to follow the same format as the secret in the corresponding `secrets.yaml` file. +More examples can be found in the `examples` directory. + ### Deploying to Kubernetes: 1. Verify that you can connect to your Kubernetes cluster(note: We highly suggest installing into an empty namespace) @@ -216,6 +214,13 @@ We typically validate deployment using the following quickstart guide: | Key | Type | Default | Description | |-----|------|---------|-------------| +| apiIngress.annotations | object | `{}` | | +| apiIngress.enabled | bool | `false` | | +| apiIngress.hostname | string | `""` | | +| apiIngress.ingressClassName | string | `""` | | +| apiIngress.labels | object | `{}` | | +| apiIngress.subdomain | string | `""` | | +| apiIngress.tls | list | `[]` | | | clickhouse.containerHttpPort | int | `8123` | | | clickhouse.containerNativePort | int | `9000` | | | clickhouse.external.database | string | `"default"` | | @@ -260,21 +265,21 @@ We typically validate deployment using the following quickstart guide: | commonLabels | object | `{}` | Labels that will be applied to all resources created by the chart | | fullnameOverride | string | `""` | String to fully override `"langsmith.fullname"` | | images.backendImage.pullPolicy | string | `"IfNotPresent"` | | -| images.backendImage.repository | string | `"docker.io/langchain/langchainplus-backend"` | | +| images.backendImage.repository | string | `"docker.io/langchain/langsmith-backend"` | | | images.backendImage.tag | string | `"0.1.18"` | | | images.clickhouseImage.pullPolicy | string | `"Always"` | | | images.clickhouseImage.repository | string | `"docker.io/clickhouse/clickhouse-server"` | | | images.clickhouseImage.tag | string | `"23.9"` | | | images.frontendImage.pullPolicy | string | `"IfNotPresent"` | | -| images.frontendImage.repository | string | `"docker.io/langchain/langchainplus-frontend-dynamic"` | | +| images.frontendImage.repository | string | `"docker.io/langchain/langsmith-frontend"` | | | images.frontendImage.tag | string | `"0.1.18"` | | | images.hubBackendImage.pullPolicy | string | `"IfNotPresent"` | | -| images.hubBackendImage.repository | string | `"docker.io/langchain/langchainhub-backend"` | | +| images.hubBackendImage.repository | string | `"docker.io/langchain/langhub-backend"` | | | images.hubBackendImage.tag | string | `"0.1.18"` | | | images.imagePullSecrets | list | `[]` | Secrets with credentials to pull images from a private registry. Specified as name: value. | | images.playgroundImage.pullPolicy | string | `"IfNotPresent"` | | -| images.playgroundImage.repository | string | `"docker.io/langchain/langchainplus-playground"` | | -| images.playgroundImage.tag | string | `"d2c7513"` | | +| images.playgroundImage.repository | string | `"docker.io/langchain/langsmith-playground"` | | +| images.playgroundImage.tag | string | `"0.1.18"` | | | images.postgresImage.pullPolicy | string | `"IfNotPresent"` | | | images.postgresImage.repository | string | `"docker.io/postgres"` | | | images.postgresImage.tag | string | `"14.7"` | | @@ -568,7 +573,6 @@ We typically validate deployment using the following quickstart guide: | postgres.statefulSet.extraEnv | list | `[]` | | | postgres.statefulSet.labels | object | `{}` | | | postgres.statefulSet.nodeSelector | object | `{}` | | -| postgres.statefulSet.persistence.enabled | bool | `false` | | | postgres.statefulSet.persistence.size | string | `"8Gi"` | | | postgres.statefulSet.persistence.storageClassName | string | `""` | | | postgres.statefulSet.podSecurityContext | object | `{}` | | From 84c864fcb3b08b2ccf9c0c57a99ad816ffb20d13 Mon Sep 17 00:00:00 2001 From: infra Date: Fri, 8 Mar 2024 10:23:19 -0500 Subject: [PATCH 6/7] Some saq fixes --- charts/langsmith/templates/_helpers.tpl | 5 +++++ charts/langsmith/templates/backend/deployment.yaml | 5 ----- charts/langsmith/templates/queue/deployment.yaml | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/charts/langsmith/templates/_helpers.tpl b/charts/langsmith/templates/_helpers.tpl index be7222e..653b2f6 100644 --- a/charts/langsmith/templates/_helpers.tpl +++ b/charts/langsmith/templates/_helpers.tpl @@ -188,6 +188,11 @@ Template containing common environment variables that are used by several servic secretKeyRef: name: {{ include "langsmith.secretsName" . }} key: api_key_salt +- name: OPENAI_API_KEY + valueFrom: + secretKeyRef: + name: {{ include "langsmith.secretsName" . }} + key: openai_api_key {{- end }} {{- define "backend.serviceAccountName" -}} diff --git a/charts/langsmith/templates/backend/deployment.yaml b/charts/langsmith/templates/backend/deployment.yaml index f241f30..731e001 100644 --- a/charts/langsmith/templates/backend/deployment.yaml +++ b/charts/langsmith/templates/backend/deployment.yaml @@ -49,11 +49,6 @@ spec: {{- end }} env: {{- include "langsmith.commonEnv" . | nindent 12 }} - - name: OPENAI_API_KEY - valueFrom: - secretKeyRef: - name: {{ include "langsmith.secretsName" . }} - key: openai_api_key - name: PORT value: {{ .Values.backend.containerPort | quote }} {{- with .Values.backend.deployment.extraEnv }} diff --git a/charts/langsmith/templates/queue/deployment.yaml b/charts/langsmith/templates/queue/deployment.yaml index e11999f..cc4cbc2 100644 --- a/charts/langsmith/templates/queue/deployment.yaml +++ b/charts/langsmith/templates/queue/deployment.yaml @@ -49,6 +49,10 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} env: + - name: "REDIS_MAX_CONNECTIONS" + value: "250" + - name: "ASYNCPG_POOL_MAX_SIZE" + value: "3" {{- include "langsmith.commonEnv" . | nindent 12 }} {{- with .Values.queue.deployment.extraEnv }} {{- toYaml . | nindent 12 }} From 8c28842db55e080ab97aa8331a0f11be01dbe75d Mon Sep 17 00:00:00 2001 From: infra Date: Fri, 8 Mar 2024 11:31:22 -0500 Subject: [PATCH 7/7] bump 0.1.19 --- charts/langsmith/Chart.yaml | 2 +- charts/langsmith/README.md | 10 ++++---- charts/langsmith/examples/medium_size.yaml | 27 +++++++++++----------- charts/langsmith/values.yaml | 8 +++---- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/charts/langsmith/Chart.yaml b/charts/langsmith/Chart.yaml index 8d8cac9..61cd4c1 100644 --- a/charts/langsmith/Chart.yaml +++ b/charts/langsmith/Chart.yaml @@ -6,4 +6,4 @@ maintainers: description: Helm chart to deploy the langsmith application and all services it depends on. type: application version: 0.3.6 -appVersion: "0.1.18" +appVersion: "0.1.19" diff --git a/charts/langsmith/README.md b/charts/langsmith/README.md index 6224bee..044903a 100644 --- a/charts/langsmith/README.md +++ b/charts/langsmith/README.md @@ -1,6 +1,6 @@ # langsmith -![Version: 0.3.6](https://img.shields.io/badge/Version-0.3.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.18](https://img.shields.io/badge/AppVersion-0.1.18-informational?style=flat-square) +![Version: 0.3.6](https://img.shields.io/badge/Version-0.3.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.19](https://img.shields.io/badge/AppVersion-0.1.19-informational?style=flat-square) Helm chart to deploy the langsmith application and all services it depends on. @@ -266,20 +266,20 @@ We typically validate deployment using the following quickstart guide: | fullnameOverride | string | `""` | String to fully override `"langsmith.fullname"` | | images.backendImage.pullPolicy | string | `"IfNotPresent"` | | | images.backendImage.repository | string | `"docker.io/langchain/langsmith-backend"` | | -| images.backendImage.tag | string | `"0.1.18"` | | +| images.backendImage.tag | string | `"0.1.19"` | | | images.clickhouseImage.pullPolicy | string | `"Always"` | | | images.clickhouseImage.repository | string | `"docker.io/clickhouse/clickhouse-server"` | | | images.clickhouseImage.tag | string | `"23.9"` | | | images.frontendImage.pullPolicy | string | `"IfNotPresent"` | | | images.frontendImage.repository | string | `"docker.io/langchain/langsmith-frontend"` | | -| images.frontendImage.tag | string | `"0.1.18"` | | +| images.frontendImage.tag | string | `"0.1.19"` | | | images.hubBackendImage.pullPolicy | string | `"IfNotPresent"` | | | images.hubBackendImage.repository | string | `"docker.io/langchain/langhub-backend"` | | -| images.hubBackendImage.tag | string | `"0.1.18"` | | +| images.hubBackendImage.tag | string | `"0.1.19"` | | | images.imagePullSecrets | list | `[]` | Secrets with credentials to pull images from a private registry. Specified as name: value. | | images.playgroundImage.pullPolicy | string | `"IfNotPresent"` | | | images.playgroundImage.repository | string | `"docker.io/langchain/langsmith-playground"` | | -| images.playgroundImage.tag | string | `"0.1.18"` | | +| images.playgroundImage.tag | string | `"0.1.19"` | | | images.postgresImage.pullPolicy | string | `"IfNotPresent"` | | | images.postgresImage.repository | string | `"docker.io/postgres"` | | | images.postgresImage.tag | string | `"14.7"` | | diff --git a/charts/langsmith/examples/medium_size.yaml b/charts/langsmith/examples/medium_size.yaml index e4acae8..f2788e8 100644 --- a/charts/langsmith/examples/medium_size.yaml +++ b/charts/langsmith/examples/medium_size.yaml @@ -11,8 +11,8 @@ backend: deployment: resources: requests: - cpu: 500m - memory: 1000Mi + cpu: "500m" + memory: "1000Mi" autoscaling: enabled: true minReplicas: 1 @@ -23,8 +23,8 @@ hubBackend: deployment: resources: requests: - cpu: 500m - memory: 1000Mi + cpu: "500m" + memory: "1000Mi" autoscaling: enabled: true minReplicas: 1 @@ -35,8 +35,8 @@ frontend: deployment: resources: requests: - cpu: 500m - memory: 1000Mi + cpu: "500m" + memory: "1000Mi" autoscaling: enabled: true minReplicas: 1 @@ -47,8 +47,8 @@ playground: deployment: resources: requests: - cpu: 500m - memory: 1000Mi + cpu: "500m" + memory: "1000Mi" autoscaling: enabled: true minReplicas: 1 @@ -57,12 +57,13 @@ playground: queue: deployment: - requests: - cpu: "1000m" - memory: "4Gi" + resources: + requests: + cpu: "1000m" + memory: "4Gi" autoscaling: enabled: true - minReplicas: 1 + minReplicas: 3 maxReplicas: 10 targetCPUUtilizationPercentage: 50 @@ -81,7 +82,7 @@ redis: # existingSecretName: "redis-secret" Can also put the above into a secret if you want to avoid putting the connection string in the values file. clickhouse: - statefulset: + statefulSet: resources: requests: cpu: "2000m" diff --git a/charts/langsmith/values.yaml b/charts/langsmith/values.yaml index 0d27177..1acce7c 100644 --- a/charts/langsmith/values.yaml +++ b/charts/langsmith/values.yaml @@ -15,19 +15,19 @@ images: backendImage: repository: "docker.io/langchain/langsmith-backend" pullPolicy: IfNotPresent - tag: "0.1.18" + tag: "0.1.19" frontendImage: repository: "docker.io/langchain/langsmith-frontend" pullPolicy: IfNotPresent - tag: "0.1.18" + tag: "0.1.19" hubBackendImage: repository: "docker.io/langchain/langhub-backend" pullPolicy: IfNotPresent - tag: "0.1.18" + tag: "0.1.19" playgroundImage: repository: "docker.io/langchain/langsmith-playground" pullPolicy: IfNotPresent - tag: "0.1.18" + tag: "0.1.19" postgresImage: repository: "docker.io/postgres" pullPolicy: IfNotPresent