Skip to content

Commit

Permalink
Merge pull request #76 from langchain-ai/infra/bump-charts-fixes
Browse files Browse the repository at this point in the history
Infra/bump charts fixes
  • Loading branch information
langchain-infra authored Mar 8, 2024
2 parents d05d06e + 8c28842 commit 04b15dc
Show file tree
Hide file tree
Showing 18 changed files with 302 additions and 136 deletions.
4 changes: 2 additions & 2 deletions 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.3.5
appVersion: "0.1.0"
version: 0.3.6
appVersion: "0.1.19"
52 changes: 23 additions & 29 deletions charts/langsmith/README.md
Original file line number Diff line number Diff line change
@@ -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.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.

Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -104,11 +104,7 @@ config:
postgres:
external:
enabled: true
host: <host>
port: 5432
user: <user>
password: <password>
database: <database>
connectionUrl: "postgresql://<username>:<password>@<url>:5432/<dbname>"
redis:
external:
enabled: true
Expand All @@ -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)
Expand Down Expand Up @@ -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"` | |
Expand Down Expand Up @@ -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.tag | string | `"d2c7513"` | |
| images.backendImage.repository | string | `"docker.io/langchain/langsmith-backend"` | |
| 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/langchainplus-frontend-dynamic"` | |
| images.frontendImage.tag | string | `"d2c7513"` | |
| images.frontendImage.repository | string | `"docker.io/langchain/langsmith-frontend"` | |
| images.frontendImage.tag | string | `"0.1.19"` | |
| images.hubBackendImage.pullPolicy | string | `"IfNotPresent"` | |
| images.hubBackendImage.repository | string | `"docker.io/langchain/langchainhub-backend"` | |
| images.hubBackendImage.tag | string | `"d2c7513"` | |
| images.hubBackendImage.repository | string | `"docker.io/langchain/langhub-backend"` | |
| 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/langchainplus-playground"` | |
| images.playgroundImage.tag | string | `"d2c7513"` | |
| images.playgroundImage.repository | string | `"docker.io/langchain/langsmith-playground"` | |
| 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"` | |
Expand Down Expand Up @@ -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 | `{}` | |
Expand All @@ -590,19 +594,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 | `{}` | |
Expand Down
10 changes: 4 additions & 6 deletions charts/langsmith/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] 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).
Expand Down Expand Up @@ -104,11 +104,7 @@ config:
postgres:
external:
enabled: true
host: <host>
port: 5432
user: <user>
password: <password>
database: <database>
connectionUrl: "postgresql://<username>:<password>@<url>:5432/<dbname>"
redis:
external:
enabled: true
Expand All @@ -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:

Expand Down
62 changes: 62 additions & 0 deletions charts/langsmith/examples/autoscaling_config.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions charts/langsmith/examples/basic_config.yaml
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 14 additions & 0 deletions charts/langsmith/examples/basic_external.yaml
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions charts/langsmith/examples/basic_oauth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config:
langsmithLicenseKey: "YOUR_LICENSE_KEY"
oauth:
enabled: true
oauthClientId: "YOUR_CLIENT_ID"
oauthIssuerUrl: "YOUR_ISSUER_URL"
91 changes: 91 additions & 0 deletions charts/langsmith/examples/medium_size.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
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:
resources:
requests:
cpu: "1000m"
memory: "4Gi"
autoscaling:
enabled: true
minReplicas: 3
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"
5 changes: 5 additions & 0 deletions charts/langsmith/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Expand Down
41 changes: 41 additions & 0 deletions charts/langsmith/templates/api_ingress.yaml
Original file line number Diff line number Diff line change
@@ -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 }}/api/v1
pathType: Prefix
backend:
service:
name: {{ include "langsmith.fullname" . }}-{{ .Values.backend.name }}
port:
number: {{ .Values.backend.service.port }}
- path: /{{ .Values.apiIngress.subdomain }}/api-hub/v1
pathType: Prefix
backend:
service:
name: {{ include "langsmith.fullname" . }}-{{ .Values.hubBackend.name }}
port:
number: {{ .Values.backend.service.port }}
{{- end }}
Loading

0 comments on commit 04b15dc

Please sign in to comment.