-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helm Setup #70
Open
Sundarasan
wants to merge
4
commits into
getumbrel:master
Choose a base branch
from
Sujsun:basic-helm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Helm Setup #70
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v2 | ||
name: llamagpt | ||
description: A Helm chart for Kubernetes | ||
icon: https://i.imgur.com/LI59cui.png | ||
|
||
# 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 | ||
|
||
# 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.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "llamagpt.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 "llamagpt.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 "llamagpt.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "llamagpt.labels" -}} | ||
helm.sh/chart: {{ include "llamagpt.chart" . }} | ||
{{ include "llamagpt.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "llamagpt.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "llamagpt.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "llamagpt.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "llamagpt.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "llamagpt.api.openAi.host" -}} | ||
{{- default (printf "%s-api:%v" (include "llamagpt.fullname" .) .Values.api.service.port) .Values.api.openAi.host }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
|
||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ template "llamagpt.fullname" . }}-configmap | ||
labels: | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
data: | ||
DEFAULT_MODEL: {{ .Values.api.defaultModel }} | ||
OPENAI_API_HOST: http://{{ template "llamagpt.api.openAi.host" . }} | ||
OPENAI_API_KEY: {{ .Values.api.openAi.key }} | ||
WAIT_HOSTS: {{ template "llamagpt.api.openAi.host" . }} | ||
WAIT_TIMEOUT: {{ quote .Values.api.openAi.waitTimeout }} | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
service: {{ template "llamagpt.fullname" . }}-api | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
name: {{ template "llamagpt.fullname" . }}-api | ||
spec: | ||
replicas: {{ .Values.api.replicas }} | ||
selector: | ||
matchLabels: | ||
service: {{ template "llamagpt.fullname" . }}-api | ||
template: | ||
metadata: | ||
labels: | ||
service: {{ template "llamagpt.fullname" . }}-api | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
spec: | ||
containers: | ||
- name: {{ template "llamagpt.fullname" . }}-api | ||
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag }}" | ||
env: | ||
- name: MODEL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ template "llamagpt.fullname" . }}-configmap | ||
key: DEFAULT_MODEL | ||
resources: | ||
requests: | ||
memory: {{ .Values.api.resources.memory }} | ||
restartPolicy: {{ .Values.api.restartPolicy }} | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
service: {{ template "llamagpt.fullname" . }}-ui | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
name: {{ template "llamagpt.fullname" . }}-ui | ||
spec: | ||
replicas: {{ .Values.ui.replicas }} | ||
selector: | ||
matchLabels: | ||
service: {{ template "llamagpt.fullname" . }}-ui | ||
template: | ||
metadata: | ||
labels: | ||
service: {{ template "llamagpt.fullname" . }}-ui | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
spec: | ||
containers: | ||
- name: {{ template "llamagpt.fullname" . }}-ui | ||
image: "{{ .Values.ui.image.repository }}:{{ .Values.ui.image.tag }}" | ||
envFrom: | ||
- configMapRef: | ||
name: {{ template "llamagpt.fullname" . }}-configmap | ||
ports: | ||
- containerPort: {{ int .Values.ui.service.internalPort }} | ||
resources: {} | ||
restartPolicy: {{ .Values.ui.restartPolicy }} | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
service: {{ template "llamagpt.fullname" . }} | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
name: {{ template "llamagpt.fullname" . }}-api | ||
spec: | ||
ports: | ||
- name: api | ||
port: {{ .Values.api.service.port }} | ||
targetPort: {{ .Values.api.service.targetPort }} | ||
selector: | ||
service: {{ template "llamagpt.fullname" . }}-api | ||
status: | ||
loadBalancer: {} | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
service: {{ template "llamagpt.fullname" . }}-ui | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
name: {{ template "llamagpt.fullname" . }}-ui | ||
spec: | ||
ports: | ||
- name: ui | ||
port: {{ .Values.ui.service.port }} | ||
targetPort: {{ .Values.ui.service.targetPort }} | ||
selector: | ||
service: {{ template "llamagpt.fullname" . }}-ui | ||
type: {{ .Values.ui.service.type }} | ||
status: | ||
loadBalancer: {} | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ include "llamagpt.fullname" . }}-test-connection" | ||
labels: | ||
{{- include "llamagpt.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": test | ||
spec: | ||
containers: | ||
- name: wget | ||
image: busybox | ||
command: ['wget'] | ||
args: ['{{ template "llamagpt.fullname" . }}-ui:{{ .Values.ui.service.port }}'] | ||
restartPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Default values for llamagpt. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
ui: | ||
replicaCount: 1 | ||
service: | ||
type: ClusterIP | ||
port: 3000 | ||
targetPort: 3000 | ||
internalPort: 3000 | ||
image: | ||
repository: ghcr.io/getumbrel/llama-gpt-ui | ||
tag: 1.0.1 | ||
pullPolicy: IfNotPresent | ||
affinity: {} | ||
restartPolicy: Always | ||
|
||
api: | ||
defaultModel: /models/llama-2-7b-chat.bin | ||
replicaCount: 1 | ||
service: | ||
type: ClusterIP | ||
port: 8000 | ||
targetPort: 8000 | ||
image: | ||
repository: ghcr.io/getumbrel/llama-gpt-api | ||
tag: 1.0.1 | ||
pullPolicy: IfNotPresent | ||
affinity: {} | ||
restartPolicy: Always | ||
resources: | ||
memory: 5Gi | ||
openAi: | ||
host: | ||
key: sk-XXXXXXXXXXXXXXXXXXXX | ||
waitTimeout: 600 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, you have this empty
affinity: {}
default, but I don't see it implemented in either of the deployment template specs. It would be great to get that added, maybe tolerations too, so that people can choose to schedule this api component on higher performance nodes if they want to. That's my usecase anyway.Thanks for adding this BTW.