Skip to content

Commit

Permalink
Merge pull request #61 from langchain-ai/infra/always-use-persistent-…
Browse files Browse the repository at this point in the history
…redis

Use persistent redis for opengpts
  • Loading branch information
langchain-infra authored Jan 30, 2024
2 parents 65e4d66 + 40696b7 commit ae36fdc
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
env:
LANGSMITH_LICENSE_KEY: ${{ secrets.LANGSMITH_LICENSE_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: ct install --target-branch ${{ github.event.repository.default_branch }} --all --helm-extra-set-args "--set=frontend.service.type=ClusterIP --set=config.langsmithLicenseKey=$LANGSMITH_LICENSE_KEY --set=config.openaiApiKey=$OPENAI_API_KEY --set=config.tavilyApiKey=foo --set=config.kayApiKey=foo --set=config.ydcApiKey=foo --set=backend.service.type=ClusterIP"
run: ct install --target-branch ${{ github.event.repository.default_branch }} --all --helm-extra-set-args "--set=frontend.service.type=ClusterIP --set=config.langsmithLicenseKey=$LANGSMITH_LICENSE_KEY --set=config.openaiApiKey=$OPENAI_API_KEY --set=backend.service.type=ClusterIP"
2 changes: 1 addition & 1 deletion charts/open-gpts/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 open-gpts appplication and all services it depends on.
type: application
version: 0.1.0
version: 0.1.1
appVersion: "0.1.0"
17 changes: 11 additions & 6 deletions charts/open-gpts/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# open-gpts

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-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.1.1](https://img.shields.io/badge/Version-0.1.1-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 open-gpts appplication and all services it depends on.

Expand Down Expand Up @@ -136,7 +136,7 @@ the same format as the secret in the corresponding `secrets.yaml` file.
1. How can we upgrade our application?
- To upgrade, you will need to follow the upgrade instructions in the Helm README and run a `helm upgrade open-gpts --values <values file>`
2. How can we backup our application?
- Currently, we rely on PVCs/PV to power storage for our application. We strongly encourage setting up `Persistent Volume` backups or moving to a managed service for `Postgres` to support disaster recovery
- Currently, we rely on PVCs/PV to power storage for our application. We strongly encourage setting up `Persistent Volume` backups or moving to a managed service for `Redis` to support disaster recovery
3. How does load balancing work/ingress work?
- Currently, our application spins up one load balancer using a k8s service of type `LoadBalancer` for our frontend. If you do not want to setup a load balancer you can simply port-forward the frontend and use that as your external ip for the application.
- We also have an option for the chart to provision an ingress resource for the application.
Expand Down Expand Up @@ -180,11 +180,17 @@ the same format as the secret in the corresponding `secrets.yaml` file.

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| config.azureOpenaiApiBase | string | `"placeholder"` | |
| config.azureOpenaiApiKey | string | `"placeholder"` | |
| config.azureOpenaiApiVersion | string | `"placeholder"` | |
| config.azureOpenaiDeploymentName | string | `"placeholder"` | |
| config.existingSecretName | string | `""` | |
| config.kayApiKey | string | `""` | |
| config.kayApiKey | string | `"placeholder"` | |
| config.openaiApiKey | string | `""` | |
| config.tavilyApiKey | string | `""` | |
| config.ydcApiKey | string | `""` | |
| config.robocorpActionServerKey | string | `"dummy-api-key"` | |
| config.robocorpActionServerUrl | string | `"https://dummy-action-server.robocorp.link"` | |
| config.tavilyApiKey | string | `"placeholder"` | |
| config.ydcApiKey | string | `"placeholder"` | |

## Backend

Expand Down Expand Up @@ -259,7 +265,6 @@ the same format as the secret in the corresponding `secrets.yaml` file.
| redis.statefulSet.extraEnv | list | `[]` | |
| redis.statefulSet.labels | object | `{}` | |
| redis.statefulSet.nodeSelector | object | `{}` | |
| redis.statefulSet.persistence.enabled | bool | `false` | |
| redis.statefulSet.persistence.size | string | `"8Gi"` | |
| redis.statefulSet.persistence.storageClassName | string | `""` | |
| redis.statefulSet.podSecurityContext | object | `{}` | |
Expand Down
30 changes: 30 additions & 0 deletions charts/open-gpts/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,36 @@ spec:
secretKeyRef:
name: {{ include "openGPTs.secretsName" . }}
key: ydc_api_key
- name: AZURE_OPENAI_DEPLOYMENT_NAME
valueFrom:
secretKeyRef:
name: {{ include "openGPTs.secretsName" . }}
key: azure_openai_deployment_name
- name: AZURE_OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "openGPTs.secretsName" . }}
key: azure_openai_api_key
- name: AZURE_OPENAI_API_BASE
valueFrom:
secretKeyRef:
name: {{ include "openGPTs.secretsName" . }}
key: azure_openai_api_base
- name: AZURE_OPENAI_API_VERSION
valueFrom:
secretKeyRef:
name: {{ include "openGPTs.secretsName" . }}
key: azure_openai_api_version
- name: ROBOCORP_ACTION_SERVER_URL
valueFrom:
secretKeyRef:
name: {{ include "openGPTs.secretsName" . }}
key: robocorp_action_server_url
- name: ROBOCORP_ACTION_SERVER_KEY
valueFrom:
secretKeyRef:
name: {{ include "openGPTs.secretsName" . }}
key: robocorp_action_server_key
{{- with .Values.backend.deployment.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
2 changes: 0 additions & 2 deletions charts/open-gpts/templates/redis/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ spec:
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.redis.statefulSet.persistence.enabled }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -133,5 +132,4 @@ spec:
{{- if .Values.redis.statefulSet.persistence.storageClassName }}
storageClassName: {{ .Values.redis.statefulSet.persistence.storageClassName }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/open-gpts/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ data:
tavily_api_key: {{ .Values.config.tavilyApiKey | b64enc | quote }}
kay_api_key: {{ .Values.config.kayApiKey | b64enc | quote }}
ydc_api_key: {{ .Values.config.ydcApiKey | b64enc | quote }}
azure_openai_deployment_name: {{ .Values.config.azureOpenaiDeploymentName | b64enc | quote }}
azure_openai_api_key: {{ .Values.config.azureOpenaiApiKey | b64enc | quote }}
azure_openai_api_base: {{ .Values.config.azureOpenaiApiBase | b64enc | quote }}
azure_openai_api_version: {{ .Values.config.azureOpenaiApiVersion | b64enc | quote }}
robocorp_action_server_url: {{ .Values.config.robocorpActionServerUrl | b64enc | quote }}
robocorp_action_server_key: {{ .Values.config.robocorpActionServerKey | b64enc | quote }}
{{- end }}
13 changes: 9 additions & 4 deletions charts/open-gpts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ ingress:
config:
existingSecretName: ""
openaiApiKey: ""
tavilyApiKey: ""
kayApiKey: ""
ydcApiKey: ""
tavilyApiKey: "placeholder"
kayApiKey: "placeholder"
ydcApiKey: "placeholder"
azureOpenaiDeploymentName: "placeholder"
azureOpenaiApiKey: "placeholder"
azureOpenaiApiBase: "placeholder"
azureOpenaiApiVersion: "placeholder"
robocorpActionServerUrl: "https://dummy-action-server.robocorp.link"
robocorpActionServerKey: "dummy-api-key"

backend:
name: "backend"
Expand Down Expand Up @@ -129,7 +135,6 @@ redis:
volumes: []
volumeMounts: []
persistence:
enabled: false
size: 8Gi
storageClassName: ""
service:
Expand Down

0 comments on commit ae36fdc

Please sign in to comment.