Skip to content

Commit

Permalink
Merge pull request #11 from robrakaric/feature-ollama-from-external-c…
Browse files Browse the repository at this point in the history
…hart
  • Loading branch information
tjbck authored May 9, 2024
2 parents 8b18b03 + 2b9336c commit e07c423
Show file tree
Hide file tree
Showing 16 changed files with 235 additions and 349 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
paths:
- "charts/*/Chart.yaml"

jobs:
release:
Expand All @@ -26,6 +28,10 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Add Dependency Repos
run: |
helm repo add ollama https://otwld.github.io/ollama-helm/
- name: Run chart-releaser
uses: helm/[email protected]
with:
Expand Down
6 changes: 6 additions & 0 deletions charts/open-webui/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: ollama
repository: https://otwld.github.io/ollama-helm/
version: 0.24.1
digest: sha256:81e6126e017a7063c0074cf7b38bca8537d220053255f0669c98a6f67e9360e6
generated: "2024-05-07T13:24:36.081504-07:00"
15 changes: 13 additions & 2 deletions charts/open-webui/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: open-webui
version: 1.0.1
version: 2.0.0
appVersion: "latest"

home: https://www.openwebui.com/
Expand All @@ -14,8 +14,19 @@ keywords:

sources:
- https://github.com/open-webui/helm-charts
- https://hub.docker.com/r/ollama/ollama
- https://github.com/open-webui/open-webui/pkgs/container/open-webui
- https://github.com/otwld/ollama-helm/
- https://hub.docker.com/r/ollama/ollama

annotations:
licenses: MIT

dependencies:
- name: ollama
repository: https://otwld.github.io/ollama-helm/
version: ">=0.24.0"
import-values:

- child: service
parent: ollama.service
condition: ollama.enabled
99 changes: 42 additions & 57 deletions charts/open-webui/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# open-webui

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
![Version: 2.0.0](https://img.shields.io/badge/Version-2.0.0-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

Open WebUI: A User-Friendly Web Interface for Chat Interactions 👋

**Homepage:** <https://www.openwebui.com/>

## Source Code

* <https://github.com/open-webui/open-webui/tree/main/kubernetes/helm>
* <https://hub.docker.com/r/ollama/ollama>
* <https://github.com/open-webui/helm-charts>
* <https://github.com/open-webui/open-webui/pkgs/container/open-webui>
* <https://github.com/otwld/ollama-helm/>
* <https://hub.docker.com/r/ollama/ollama>

## Installing

Expand All @@ -27,65 +28,49 @@ Now you can install the chart:
helm upgrade --install open-webui open-webui/open-webui
```

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://otwld.github.io/ollama-helm/ | ollama | >=0.24.0 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| annotations | object | `{}` | |
| clusterDomain | string | `"cluster.local"` | Value of cluster domain |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"ghcr.io/open-webui/open-webui"` | |
| image.tag | string | `""` | |
| ingress.annotations | object | `{}` | Use appropriate annotations for your Ingress controller, e.g., for NGINX: nginx.ingress.kubernetes.io/rewrite-target: / |
| ingress.class | string | `""` | |
| ingress.enabled | bool | `false` | |
| ingress.existingSecret | string | `""` | |
| ingress.host | string | `""` | |
| ingress.tls | bool | `false` | |
| nameOverride | string | `""` | |
| ollama.annotations | object | `{}` | |
| ollama.externalHost | string | `""` | |
| ollama.gpu.enabled | bool | `false` | Enable additional ENV values to help Ollama discover GPU usage |
| ollama.image.pullPolicy | string | `"Always"` | |
| ollama.image.repository | string | `"ollama/ollama"` | |
| ollama.image.tag | string | `"latest"` | |
| ollama.nodeSelector | object | `{}` | |
| ollama.persistence.accessModes[0] | string | `"ReadWriteOnce"` | |
| ollama.persistence.annotations | object | `{}` | |
| ollama.persistence.enabled | bool | `true` | |
| ollama.persistence.existingClaim | string | `""` | |
| ollama.persistence.selector | object | `{}` | |
| ollama.persistence.size | string | `"30Gi"` | |
| ollama.persistence.storageClass | string | `""` | |
| ollama.podAnnotations | object | `{}` | |
| ollama.replicaCount | int | `1` | |
| ollama.resources | object | `{}` | |
| ollama.runtimeClassName | string | `""` | If using a special runtime container such as nvidia, set it here. |
| ollama.service.annotations | object | `{}` | |
| ollama.service.containerPort | int | `11434` | |
| ollama.service.port | int | `80` | |
| ollama.service.type | string | `"ClusterIP"` | |
| ollama.tolerations[0].effect | string | `"NoSchedule"` | |
| ollama.tolerations[0].key | string | `"nvidia.com/gpu"` | |
| ollama.tolerations[0].operator | string | `"Exists"` | |
| webui.annotations | object | `{}` | |
| webui.image.pullPolicy | string | `"Always"` | |
| webui.image.repository | string | `"ghcr.io/open-webui/open-webui"` | |
| webui.image.tag | string | `""` | |
| webui.ingress.annotations | object | `{}` | Use appropriate annotations for your Ingress controller, e.g., for NGINX: nginx.ingress.kubernetes.io/rewrite-target: / |
| webui.ingress.class | string | `""` | |
| webui.ingress.enabled | bool | `false` | |
| webui.ingress.existingSecret | string | `""` | |
| webui.ingress.host | string | `""` | |
| webui.ingress.tls | bool | `false` | |
| webui.nodeSelector | object | `{}` | |
| webui.persistence.accessModes | list | `["ReadWriteOnce"]` | If using multiple replicas, you must update accessModes to ReadWriteMany |
| webui.persistence.annotations | object | `{}` | |
| webui.persistence.enabled | bool | `true` | |
| webui.persistence.existingClaim | string | `""` | |
| webui.persistence.selector | object | `{}` | |
| webui.persistence.size | string | `"2Gi"` | |
| webui.persistence.storageClass | string | `""` | |
| webui.podAnnotations | object | `{}` | |
| webui.replicaCount | int | `1` | |
| webui.resources | object | `{}` | |
| webui.service.annotations | object | `{}` | |
| webui.service.containerPort | int | `8080` | |
| webui.service.labels | object | `{}` | |
| webui.service.loadBalancerClass | string | `""` | |
| webui.service.nodePort | string | `""` | |
| webui.service.port | int | `80` | |
| webui.service.type | string | `"ClusterIP"` | |
| webui.tolerations | list | `[]` | |
| nodeSelector | object | `{}` | |
| ollama.enabled | bool | `true` | Automatically install Ollama Helm chart from https://otwld.github.io/ollama-helm/. Use [Helm Values](https://github.com/otwld/ollama-helm/#helm-values) to configure |
| ollamaUrls | list | `[]` | A list of Ollama API endpoints. These can be added in lieu of automatically installing the Ollama Helm chart, or in addition to it. |
| persistence.accessModes | list | `["ReadWriteOnce"]` | If using multiple replicas, you must update accessModes to ReadWriteMany |
| persistence.annotations | object | `{}` | |
| persistence.enabled | bool | `true` | |
| persistence.existingClaim | string | `""` | |
| persistence.selector | object | `{}` | |
| persistence.size | string | `"2Gi"` | |
| persistence.storageClass | string | `""` | |
| podAnnotations | object | `{}` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| service.annotations | object | `{}` | |
| service.containerPort | int | `8080` | |
| service.labels | object | `{}` | |
| service.loadBalancerClass | string | `""` | |
| service.nodePort | string | `""` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| tolerations | list | `[]` | |

----------------------------------------------

Expand Down
Binary file added charts/open-webui/charts/ollama-0.24.1.tgz
Binary file not shown.
29 changes: 23 additions & 6 deletions charts/open-webui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
{{- define "open-webui.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end -}}

{{- define "ollama.name" -}}
ollama
{{- end -}}

{{- define "ollama.url" -}}
{{- if .Values.ollama.externalHost }}
{{- printf .Values.ollama.externalHost }}
{{- else }}
{{- printf "http://%s.%s.svc.cluster.local:%d" (include "ollama.name" .) (.Release.Namespace) (.Values.ollama.service.port | int) }}
{{- define "ollamaUrls" -}}
{{- if .Values.ollamaUrls }}
{{- join ";" .Values.ollamaUrls | trimSuffix "/" }}
{{- end }}
{{- end }}

{{- define "ollamaLocalUrl" -}}
{{- if .Values.ollama.enabled -}}
{{- $clusterDomain := .Values.clusterDomain }}
{{- $ollamaServicePort := .Values.ollama.service.port | toString }}
{{- printf "http://open-webui-%s.%s.svc.%s:%s" (include "ollama.name" .) (.Release.Namespace) $clusterDomain $ollamaServicePort }}
{{- end }}
{{- end }}

{{- define "ollamaBaseUrls" -}}
{{- $ollamaLocalUrl := include "ollamaLocalUrl" . }}
{{- $ollamaUrls := include "ollamaUrls" . }}
{{- if and .Values.ollama.enabled .Values.ollamaUrls }}
{{- printf "%s;%s" $ollamaUrls $ollamaLocalUrl }}
{{- else if .Values.ollama.enabled }}
{{- printf "%s" $ollamaLocalUrl }}
{{- else if .Values.ollamaUrls }}
{{- printf "%s" $ollamaUrls }}
{{- end }}
{{- end }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ metadata:
name: {{ include "open-webui.name" . }}
labels:
{{- include "open-webui.labels" . | nindent 4 }}
{{- with .Values.webui.annotations }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.webui.replicaCount }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "open-webui.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "open-webui.labels" . | nindent 8 }}
{{- with .Values.webui.podAnnotations }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -26,36 +26,36 @@ spec:
automountServiceAccountToken: false
containers:
- name: {{ .Chart.Name }}
{{- with .Values.webui.image }}
{{- with .Values.image }}
image: {{ .repository }}:{{ .tag | default $.Chart.AppVersion }}
imagePullPolicy: {{ .pullPolicy }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.webui.service.containerPort }}
{{- with .Values.webui.resources }}
containerPort: {{ .Values.service.containerPort }}
{{- with .Values.resources }}
resources: {{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- name: data
mountPath: /app/backend/data
env:
- name: OLLAMA_BASE_URL
value: {{ include "ollama.url" . | quote }}
- name: OLLAMA_BASE_URLS
value: {{ include "ollamaBaseUrls" . | quote }}
tty: true
{{- with .Values.webui.nodeSelector }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if and .Values.webui.persistence.enabled .Values.webui.persistence.existingClaim }}
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
claimName: {{ .Values.webui.persistence.existingClaim }}
{{- else if not .Values.webui.persistence.enabled }}
claimName: {{ .Values.persistence.existingClaim }}
{{- else if not .Values.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if and .Values.webui.persistence.enabled (not .Values.webui.persistence.existingClaim) }}
{{- else if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
- name: data
persistentVolumeClaim:
claimName: {{ include "open-webui.name" . }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{{- if .Values.webui.ingress.enabled }}
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "open-webui.name" . }}
labels:
{{- include "open-webui.labels" . | nindent 4 }}
{{- with .Values.webui.ingress.annotations }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.webui.ingress.class }}
{{- with .Values.ingress.class }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.webui.ingress.tls }}
{{- if .Values.ingress.tls }}
tls:
- hosts:
- {{ .Values.webui.ingress.host | quote }}
secretName: {{ default (printf "%s-tls" .Release.Name) .Values.webui.ingress.existingSecret }}
- {{ .Values.ingress.host | quote }}
secretName: {{ default (printf "%s-tls" .Release.Name) .Values.ingress.existingSecret }}
{{- end }}
rules:
- host: {{ .Values.webui.ingress.host }}
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /
Expand Down
26 changes: 0 additions & 26 deletions charts/open-webui/templates/ollama-service.yaml

This file was deleted.

Loading

0 comments on commit e07c423

Please sign in to comment.