Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish Helm Chart

on:
push:
branches:
- main
- dev
paths:
- "charts/**"
env:
HELM_REGISTRY: ghcr.io
HELM_ORG: linagora

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4

- name: Set chart version
run: |
BASE_VERSION=$(yq '.version' charts/openrag-stack/Chart.yaml)

if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
# Keep version as-is for stable
CHART_VERSION="$BASE_VERSION"
else
# Append branch for dev builds
CHART_VERSION="${BASE_VERSION}-dev"
yq -i ".version = \"${CHART_VERSION}\"" charts/openrag-stack/Chart.yaml
fi

echo "CHART_VERSION=$CHART_VERSION" >> $GITHUB_ENV
echo "Using chart version: $CHART_VERSION"

- name: Helm dependency update
run: helm dependency update charts/openrag-stack

- name: Package chart
run: helm package charts/openrag-stack --destination .

- name: Login to GHCR
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login $HELM_REGISTRY -u ${{ github.actor }} --password-stdin

- name: Push chart
run: |
helm push openrag-stack-${CHART_VERSION}.tgz oci://$HELM_REGISTRY/$HELM_ORG
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ services/*
*.json
*.csv
*.pkl

#helm
charts/openrag-stack/charts/*.tgz
5 changes: 3 additions & 2 deletions Dockerfile.ray
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y \
make \
ssh \
rsync \
wget \
libpq-dev python3-dev \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -35,7 +36,7 @@ COPY pyproject.toml uv.lock ./
RUN pip3 install uv && \
uv python install 3.12.7 && \
uv python pin 3.12.7
# && \uv sync --no-dev
# && \uv sync --no-dev
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

Expand All @@ -46,10 +47,10 @@ WORKDIR /app/openrag
COPY openrag/ .

# Copy assests & config
COPY public/ /app/public/
COPY prompts/ /app/prompts/
COPY .hydra_config/ /app/.hydra_config/

RUN apt install -y
RUN ln -s /app/.venv/bin/ray /usr/local/bin/ray

ENV PYTHONPATH=/app/openrag/
23 changes: 23 additions & 0 deletions charts/openrag-stack/.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/
15 changes: 15 additions & 0 deletions charts/openrag-stack/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dependencies:
- name: kuberay-operator
repository: https://ray-project.github.io/kuberay-helm/
version: 1.4.0
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 15.5.23
- name: milvus
repository: https://zilliztech.github.io/milvus-helm/
version: 5.0.0
- name: vllm-stack
repository: https://vllm-project.github.io/production-stack
version: 0.1.7
digest: sha256:eb9f465f19be0d6d6c563c4eda6dc0f7b8e9331209420f14f01587f2ca29f965
generated: "2025-09-04T13:28:20.5556128Z"
39 changes: 39 additions & 0 deletions charts/openrag-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v2
name: openrag-stack
description: A Helm chart for Kubernetes

# 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.2.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.2.0"

dependencies:
- name: kuberay-operator
version: "1.4.0"
repository: "https://ray-project.github.io/kuberay-helm/"
- name: postgresql
version: "15.5.23"
repository: "https://charts.bitnami.com/bitnami"
- name: milvus
version: "5.0.0"
repository: "https://zilliztech.github.io/milvus-helm/"
- name: vllm-stack
alias: vllm
version: ">=0.1.7"
repository: "https://vllm-project.github.io/production-stack"
62 changes: 62 additions & 0 deletions charts/openrag-stack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "openrag-stack.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 "openrag-stack.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 "openrag-stack.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "openrag-stack.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "openrag-stack.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/openrag-stack/templates/configmap-env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: rag-env
data:
{{- range $key, $value := .Values.env.config }}
{{ $key }}: "{{ tpl (printf "%v" $value) $ }}"
{{- end }}
60 changes: 60 additions & 0 deletions charts/openrag-stack/templates/infinity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-reranker
labels:
app.kubernetes.io/name: reranker
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
replicas: {{ .Values.reranker.replicas }}
selector:
matchLabels:
app.kubernetes.io/name: reranker
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: reranker
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
runtimeClassName: {{ .Values.reranker.runtimeClassName }}
containers:
- name: reranker
image: "{{ .Values.reranker.image.repository }}:{{ .Values.reranker.image.tag }}"
args:
- "v2"
- "--model-id"
- "{{ .Values.reranker.model.id }}"
- "--port"
- "{{ .Values.reranker.service.port }}"
ports:
- containerPort: {{ .Values.reranker.service.port }}
resources:
{{- toYaml .Values.reranker.resources | nindent 12 }}
volumeMounts:
- name: hf-cache
mountPath: /app/.cache/huggingface
envFrom:
- configMapRef:
name: rag-env
volumes:
- name: hf-cache
persistentVolumeClaim:
claimName: rag-model-weights
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-reranker
labels:
app.kubernetes.io/name: reranker
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
selector:
app.kubernetes.io/name: reranker
app.kubernetes.io/instance: {{ .Release.Name }}
ports:
- protocol: TCP
port: {{ .Values.reranker.service.port }}
targetPort: {{ .Values.reranker.service.port }}
type: {{ .Values.reranker.service.type }}
26 changes: 26 additions & 0 deletions charts/openrag-stack/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "openrag-stack.fullname" . }}-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: {{ .Values.ingress.className | quote }}
rules:
- http:
paths:
{{- if .Values.ingress.paths.openrag.enabled }}
- path: /(.*)
pathType: ImplementationSpecific
backend:
service:
name: raycluster-head-svc
port:
number: {{ .Values.env.config.RAY_SERVE_PORT }}
{{- end }}
{{- with .Values.ingress.host }}
host: {{ . | quote }}
{{- end }}
{{- end }}
Loading