From 48a43ead6b23e267621f9108c85b6d0fcbc279e4 Mon Sep 17 00:00:00 2001 From: sd109 Date: Tue, 3 Dec 2024 11:26:17 +0000 Subject: [PATCH] Add Azimuth Helm chart --- helm-azimuth/.gitignore | 2 + helm-azimuth/.helmignore | 23 +++++++++++ helm-azimuth/Chart.yaml | 30 +++++++++++++++ helm-azimuth/templates/NOTES.txt | 0 helm-azimuth/templates/_helpers.tpl | 51 +++++++++++++++++++++++++ helm-azimuth/templates/client.yaml | 9 +++++ helm-azimuth/templates/reservation.yaml | 13 +++++++ helm-azimuth/values.yaml | 13 +++++++ 8 files changed, 141 insertions(+) create mode 100644 helm-azimuth/.gitignore create mode 100644 helm-azimuth/.helmignore create mode 100644 helm-azimuth/Chart.yaml create mode 100644 helm-azimuth/templates/NOTES.txt create mode 100644 helm-azimuth/templates/_helpers.tpl create mode 100644 helm-azimuth/templates/client.yaml create mode 100644 helm-azimuth/templates/reservation.yaml create mode 100644 helm-azimuth/values.yaml diff --git a/helm-azimuth/.gitignore b/helm-azimuth/.gitignore new file mode 100644 index 00000000000..f791801bcae --- /dev/null +++ b/helm-azimuth/.gitignore @@ -0,0 +1,2 @@ +charts/ +Chart.lock diff --git a/helm-azimuth/.helmignore b/helm-azimuth/.helmignore new file mode 100644 index 00000000000..0e8a0eb36f4 --- /dev/null +++ b/helm-azimuth/.helmignore @@ -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/ diff --git a/helm-azimuth/Chart.yaml b/helm-azimuth/Chart.yaml new file mode 100644 index 00000000000..7863d143ec4 --- /dev/null +++ b/helm-azimuth/Chart.yaml @@ -0,0 +1,30 @@ +apiVersion: v2 +name: ragflow-azimuth +description: A self-service Retrieval-Augmented Generation (RAG) environment for working with Large Language Models. +icon: https://raw.githubusercontent.com/infiniflow/ragflow/refs/heads/main/web/src/assets/logo-with-text.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: "dev" + +dependencies: + - name: ragflow + repository: "file://../helm" + version: 0.1.0 diff --git a/helm-azimuth/templates/NOTES.txt b/helm-azimuth/templates/NOTES.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/helm-azimuth/templates/_helpers.tpl b/helm-azimuth/templates/_helpers.tpl new file mode 100644 index 00000000000..d34f537c98c --- /dev/null +++ b/helm-azimuth/templates/_helpers.tpl @@ -0,0 +1,51 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ragflow-azimuth.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 "ragflow-azimuth.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 "ragflow-azimuth.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ragflow-azimuth.labels" -}} +helm.sh/chart: {{ include "ragflow-azimuth.chart" . }} +{{ include "ragflow-azimuth.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ragflow-azimuth.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ragflow-azimuth.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/helm-azimuth/templates/client.yaml b/helm-azimuth/templates/client.yaml new file mode 100644 index 00000000000..5b40f998e5f --- /dev/null +++ b/helm-azimuth/templates/client.yaml @@ -0,0 +1,9 @@ +apiVersion: zenith.stackhpc.com/v1alpha1 +kind: Client +metadata: + name: {{ include "ragflow-azimuth.fullname" . }} + labels: {{ include "ragflow-azimuth.labels" . | nindent 4 }} +spec: + reservationName: {{ include "ragflow-azimuth.fullname" . }} + upstream: + serviceName: {{ include "ragflow-azimuth.fullname" . }} diff --git a/helm-azimuth/templates/reservation.yaml b/helm-azimuth/templates/reservation.yaml new file mode 100644 index 00000000000..4c612769fa1 --- /dev/null +++ b/helm-azimuth/templates/reservation.yaml @@ -0,0 +1,13 @@ +apiVersion: zenith.stackhpc.com/v1alpha1 +kind: Reservation +metadata: + name: {{ include "ragflow-azimuth.fullname" . }} + labels: {{ include "ragflow-azimuth.labels" . | nindent 4 }} + annotations: + azimuth.stackhpc.com/service-label: {{ quote .Values.zenithClient.label }} + azimuth.stackhpc.com/service-icon-url: {{ .Values.zenithClient.iconUrl }} + {{- with .Values.zenithClient.description }} + azimuth.stackhpc.com/service-description: {{ quote . }} + {{- end }} +spec: + credentialSecretName: {{ include "ragflow-azimuth.fullname" . }}-credential diff --git a/helm-azimuth/values.yaml b/helm-azimuth/values.yaml new file mode 100644 index 00000000000..4b2d43856d8 --- /dev/null +++ b/helm-azimuth/values.yaml @@ -0,0 +1,13 @@ +# Zenith client configuration +zenithClient: + iconUrl: https://raw.githubusercontent.com/infiniflow/ragflow/refs/heads/main/web/public/logo.svg + description: + label: "RAGFlow" + +# RAGflow values +ragflow: + env: + RAGFLOW_IMAGE: infiniflow/ragflow:v0.14.0 + DOC_ENGINE: infinity + +# TODO: Make Azimuth UI schema to generate random passwords