Skip to content

Commit

Permalink
Merge pull request #187 from MinaFoundation/PM-1438-gpt-survey-summar…
Browse files Browse the repository at this point in the history
…izer-chart

PM-1438 Gpt survey summarizer helm chart
  • Loading branch information
Smorci authored Apr 26, 2024
2 parents fe4f606 + 38cebeb commit d6507db
Show file tree
Hide file tree
Showing 12 changed files with 485 additions and 0 deletions.
23 changes: 23 additions & 0 deletions gpt-survey-summarizer/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions gpt-survey-summarizer/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 19.1.0
digest: sha256:b2ddb067b6e67858251f669ac0bc8dc4d443bda71306779b5462bd3aaa5c917d
generated: "2024-04-17T11:00:40.052246745+01:00"
30 changes: 30 additions & 0 deletions gpt-survey-summarizer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v2
name: gpt-survey-summarizer
description: A helm chart for the gptSuverySummarizer
home: "https://github.com/MinaFoundation/gptSuverySummarizer"
sources: ["https://github.com/MinaFoundation/gptSuverySummarizer"]
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
maintainers:
- email: marton.szekely@minaprotocol.com
name: Marton Szekely
dependencies:
- name: redis
version: "19.1.0"
repository: "https://charts.bitnami.com/bitnami"
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
60 changes: 60 additions & 0 deletions gpt-survey-summarizer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# gpt-survey-summarizer

![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: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)

A helm chart for the gptSuverySummarizer

**Homepage:** <https://github.com/MinaFoundation/gptSuverySummarizer>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| Marton Szekely | <marton.szekely@minaprotocol.com> | |

## Source Code

* <https://github.com/MinaFoundation/gptSuverySummarizer>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://charts.bitnami.com/bitnami | redis | 19.1.0 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity rules |
| bot.args | list | `["bot"]` | Arguments for the bot container |
| bot.extraEnvVars | list | `[]` | Extra Environment Variables |
| bot.replicaCount | int | `1` | The number of pods to be deployed for bot |
| config.discord.clientId | string | `""` | Discord Application ID |
| config.discord.guildId | string | `""` | Discord Guild/Server ID |
| config.discord.token | string | `""` | Discord API Token |
| config.openAiApiKey | string | `""` | Openai API Key |
| config.summarizeFrequencySeconds | int | `3600` | Summarize Frequency Seconds |
| fullnameOverride | string | `""` | The full release name override |
| image.pullPolicy | string | `"IfNotPresent"` | The pullPolicy used when pulling the image |
| image.repository | string | `"673156464838.dkr.ecr.us-west-2.amazonaws.com/gpt-survey-summarizer"` | The repository of the image |
| image.tag | string | `"latest"` | The tag of the iamge. Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | The secrets used to pull the image |
| nameOverride | string | `""` | The release name override |
| nodeSelector | object | `{}` | Node selector labels |
| podAnnotations | object | `{}` | Annotations to add to the pods |
| podSecurityContext | object | `{}` | SecurityContext used for the pods |
| redis.architecture | string | `"standalone"` | The redis architecture (accepted values are: standalone, replication) |
| redis.auth.password | string | `""` | Redis password |
| resources | object | `{}` | Resource limitations for the pods |
| securityContext | object | `{}` | SecurityContext |
| server.args | list | `["summarizer"]` | Arguments for the server container |
| server.extraEnvVars | list | `[]` | Extra Environment Variables |
| server.replicaCount | int | `1` | The number of pods to be deployed for server |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| tolerations | list | `[]` | Tolerations |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Binary file added gpt-survey-summarizer/charts/redis-19.1.0.tgz
Binary file not shown.
66 changes: 66 additions & 0 deletions gpt-survey-summarizer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "gpt-survey-summarizer.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "gpt-survey-summarizer.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "gpt-survey-summarizer.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "gpt-survey-summarizer.labels" -}}
helm.sh/chart: {{ include "gpt-survey-summarizer.chart" . }}
{{ include "gpt-survey-summarizer.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "gpt-survey-summarizer.selectorLabels" -}}
app.kubernetes.io/name: {{ include "gpt-survey-summarizer.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "gpt-survey-summarizer.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "gpt-survey-summarizer.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "redisUrl" -}}
redis://:{{ .Values.redis.auth.password }}@{{ include "gpt-survey-summarizer.fullname" . }}-redis-master:6379
{{- end -}}
87 changes: 87 additions & 0 deletions gpt-survey-summarizer/templates/deployment_bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "gpt-survey-summarizer.fullname" . }}-bot
labels:
{{- include "gpt-survey-summarizer.labels" . | nindent 4 }}-bot
spec:
replicas: {{ .Values.bot.replicaCount }}
selector:
matchLabels:
{{- include "gpt-survey-summarizer.selectorLabels" . | nindent 6 }}-bot
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "gpt-survey-summarizer.selectorLabels" . | nindent 8 }}-bot
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "gpt-survey-summarizer.serviceAccountName" . }}-bot
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: bot
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- toYaml .Values.bot.args | nindent 12 }}
env:
- name: DISCORD_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "gpt-survey-summarizer.fullname" . }}
key: discordToken
- name: CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ include "gpt-survey-summarizer.fullname" . }}
key: discordClientId
- name: GUILD_ID
valueFrom:
secretKeyRef:
name: {{ include "gpt-survey-summarizer.fullname" . }}
key: discordGuildId
- name: REDIS_URL
valueFrom:
secretKeyRef:
name: {{ include "gpt-survey-summarizer.fullname" . }}
key: redisUrl
- name: SUMMARIZE_FREQUENCY_SECONDS
value: {{ .Values.config.summarizeFrequencySeconds | quote }}
{{- if .Values.bot.extraEnvVars }}
{{- toYaml .Values.bot.extraEnvVars | nindent 12 }}
{{- end }}
{{- with .Values.ports }}
ports:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
77 changes: 77 additions & 0 deletions gpt-survey-summarizer/templates/deployment_server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "gpt-survey-summarizer.fullname" . }}-server
labels:
{{- include "gpt-survey-summarizer.labels" . | nindent 4 }}-server
spec:
replicas: {{ .Values.server.replicaCount }}
selector:
matchLabels:
{{- include "gpt-survey-summarizer.selectorLabels" . | nindent 6 }}-server
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "gpt-survey-summarizer.selectorLabels" . | nindent 8 }}-server
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "gpt-survey-summarizer.serviceAccountName" . }}-server
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: server
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- toYaml .Values.server.args | nindent 12 }}
env:
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "gpt-survey-summarizer.fullname" . }}
key: openAiApiKey
- name: REDIS_URL
valueFrom:
secretKeyRef:
name: {{ include "gpt-survey-summarizer.fullname" . }}
key: redisUrl
- name: SUMMARIZE_FREQUENCY_SECONDS
value: {{ .Values.config.summarizeFrequencySeconds | quote }}
{{- if .Values.server.extraEnvVars }}
{{- toYaml .Values.server.extraEnvVars | nindent 12 }}
{{- end }}
{{- with .Values.ports }}
ports:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
10 changes: 10 additions & 0 deletions gpt-survey-summarizer/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "gpt-survey-summarizer.fullname" . }}
data:
openAiApiKey: {{ .Values.config.openAiApiKey | b64enc }}
discordClientId: {{ .Values.config.discord.clientId | b64enc }}
discordGuildId: {{ .Values.config.discord.guildId | b64enc }}
discordToken: {{ .Values.config.discord.token | b64enc }}
redisUrl: {{ include "redisUrl" . | b64enc }}
12 changes: 12 additions & 0 deletions gpt-survey-summarizer/templates/serviceaccount_bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "gpt-survey-summarizer.serviceAccountName" . }}-bot
labels:
{{- include "gpt-survey-summarizer.labels" . | nindent 4 }}-bot
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions gpt-survey-summarizer/templates/serviceaccount_server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "gpt-survey-summarizer.serviceAccountName" . }}-server
labels:
{{- include "gpt-survey-summarizer.labels" . | nindent 4 }}-server
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Loading

0 comments on commit d6507db

Please sign in to comment.