Skip to content
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 chart refactoring #3797

Merged
merged 5 commits into from
Feb 3, 2025
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
22 changes: 3 additions & 19 deletions .github/workflows/pr-helm-chart-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.14.4
version: v3.17.0

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
uses: helm/chart-testing-action@v2.7.0

# even though we specify chart-dirs in ct.yaml, it isn't used by ct for the list-changed command...
- name: Run chart-testing (list-changed)
Expand All @@ -37,22 +37,6 @@ jobs:
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

# rkuo: I don't think we need python?
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.11'
# cache: 'pip'
# cache-dependency-path: |
# backend/requirements/default.txt
# backend/requirements/dev.txt
# backend/requirements/model_server.txt
# - run: |
# python -m pip install --upgrade pip
# pip install --retries 5 --timeout 30 -r backend/requirements/default.txt
# pip install --retries 5 --timeout 30 -r backend/requirements/dev.txt
# pip install --retries 5 --timeout 30 -r backend/requirements/model_server.txt

# lint all charts if any changes were detected
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
Expand All @@ -62,7 +46,7 @@ jobs:

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.10.0
uses: helm/kind-action@v1.12.0

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion deployment/helm/charts/onyx/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sources:
- "https://github.com/onyx-dot-app/onyx"
type: application
version: 0.2.1
appVersion: "latest"
appVersion: latest
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The appVersion maps to the onyx version for the apps. A user can set this value to deploy and pin the specific version of onyx.

annotations:
category: Productivity
licenses: MIT
Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/charts/onyx/templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ spec:
- |
alembic upgrade head &&
echo "Starting Onyx Api Server" &&
uvicorn onyx.main:app --host 0.0.0.0 --port 8080
uvicorn onyx.main:app --host 0.0.0.0 --port {{ .Values.api.containerPorts.server }}
ports:
- name: api-server-port
containerPort: {{ .Values.api.service.port }}
containerPort: {{ .Values.api.containerPorts.server }}
protocol: TCP
resources:
{{- toYaml .Values.api.resources | nindent 12 }}
Expand Down
6 changes: 3 additions & 3 deletions deployment/helm/charts/onyx/templates/api-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ metadata:
spec:
type: {{ .Values.api.service.type }}
ports:
- port: {{ .Values.api.service.port }}
targetPort: api-server-port
- port: {{ .Values.api.service.servicePort }}
targetPort: {{ .Values.api.service.targetPort }}
protocol: TCP
name: api-server-port
name: {{ .Values.api.service.portName }}
selector:
{{- include "onyx-stack.selectorLabels" . | nindent 4 }}
{{- if .Values.api.deploymentLabels }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
{{- include "onyx-stack.labels" . | nindent 4 }}
spec:
replicas: 1
replicas: {{ .Values.indexCapability.replicaCount }}
selector:
matchLabels:
{{- include "onyx-stack.selectorLabels" . | nindent 6 }}
Expand All @@ -25,12 +25,14 @@ spec:
{{- end }}
spec:
containers:
- name: indexing-model-server
image: onyxdotapp/onyx-model-server:latest
imagePullPolicy: IfNotPresent
command: [ "uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "9000", "--limit-concurrency", "10" ]
- name: {{ .Values.indexCapability.name }}
image: "{{ .Values.indexCapability.image.repository }}:{{ .Values.indexCapability.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.indexCapability.image.pullPolicy }}
command: [ "uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "{{ .Values.indexCapability.containerPorts.server }}", "--limit-concurrency", "{{ .Values.indexCapability.limitConcurrency }}" ]
ports:
- containerPort: 9000
- name: model-server
containerPort: {{ .Values.indexCapability.containerPorts.server }}
protocol: TCP
envFrom:
- configMapRef:
name: {{ .Values.config.envConfigMapName }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ kind: PersistentVolumeClaim
metadata:
name: {{ .Values.indexCapability.indexingModelPVC.name }}
spec:
storageClassName: {{ .Values.persistent.storageClassName }}
accessModes:
- {{ .Values.indexCapability.indexingModelPVC.accessMode | quote }}
resources:
requests:
storage: {{ .Values.indexCapability.indexingModelPVC.storage | quote }}
storage: {{ .Values.indexCapability.indexingModelPVC.storage | quote }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
{{- toYaml .Values.indexCapability.deploymentLabels | nindent 4 }}
{{- end }}
ports:
- name: {{ .Values.indexCapability.service.name }}
- name: {{ .Values.indexCapability.service.portName }}
protocol: TCP
port: {{ .Values.indexCapability.service.port }}
targetPort: {{ .Values.indexCapability.service.port }}
type: {{ .Values.indexCapability.service.type }}
port: {{ .Values.indexCapability.service.servicePort }}
targetPort: {{ .Values.indexCapability.service.targetPort }}
type: {{ .Values.indexCapability.service.type }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ kind: Deployment
metadata:
name: {{ include "onyx-stack.fullname" . }}-inference-model
labels:
{{- range .Values.inferenceCapability.deployment.labels }}
{{- range .Values.inferenceCapability.labels }}
{{ .key }}: {{ .value }}
{{- end }}
spec:
replicas: {{ .Values.inferenceCapability.deployment.replicas }}
replicas: {{ .Values.inferenceCapability.replicaCount }}
selector:
matchLabels:
{{- range .Values.inferenceCapability.deployment.labels }}
{{- range .Values.inferenceCapability.labels }}
{{ .key }}: {{ .value }}
{{- end }}
template:
Expand All @@ -21,24 +21,26 @@ spec:
{{- end }}
spec:
containers:
- name: {{ .Values.inferenceCapability.service.name }}
image: {{ .Values.inferenceCapability.deployment.image.repository }}:{{ .Values.inferenceCapability.deployment.image.tag }}
imagePullPolicy: {{ .Values.inferenceCapability.deployment.image.pullPolicy }}
command: {{ toYaml .Values.inferenceCapability.deployment.command | nindent 14 }}
- name: model-server-inference
image: "{{ .Values.inferenceCapability.image.repository }}:{{ .Values.inferenceCapability.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.inferenceCapability.image.pullPolicy }}
command: [ "uvicorn", "model_server.main:app", "--host", "0.0.0.0", "--port", "{{ .Values.inferenceCapability.containerPorts.server }}" ]
ports:
- containerPort: {{ .Values.inferenceCapability.service.port }}
- name: model-server
containerPort: {{ .Values.inferenceCapability.containerPorts.server }}
protocol: TCP
envFrom:
- configMapRef:
name: {{ .Values.config.envConfigMapName }}
env:
{{- include "onyx-stack.envSecrets" . | nindent 12}}
volumeMounts:
{{- range .Values.inferenceCapability.deployment.volumeMounts }}
{{- range .Values.inferenceCapability.volumeMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- end }}
volumes:
{{- range .Values.inferenceCapability.deployment.volumes }}
{{- range .Values.inferenceCapability.volumes }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .persistentVolumeClaim.claimName }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: PersistentVolumeClaim
metadata:
name: {{ .Values.inferenceCapability.pvc.name }}
spec:
storageClassName: {{ .Values.persistent.storageClassName }}
accessModes:
{{- toYaml .Values.inferenceCapability.pvc.accessModes | nindent 4 }}
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
spec:
type: {{ .Values.inferenceCapability.service.type }}
ports:
- port: {{ .Values.inferenceCapability.service.port }}
targetPort: {{ .Values.inferenceCapability.service.port }}
- port: {{ .Values.inferenceCapability.service.servicePort}}
targetPort: {{ .Values.inferenceCapability.service.targetPort }}
protocol: TCP
name: {{ .Values.inferenceCapability.service.name }}
name: {{ .Values.inferenceCapability.service.portName }}
selector:
{{- range .Values.inferenceCapability.deployment.labels }}
{{- range .Values.inferenceCapability.labels }}
{{ .key }}: {{ .value }}
{{- end }}
4 changes: 2 additions & 2 deletions deployment/helm/charts/onyx/templates/nginx-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
data:
nginx.conf: |
upstream api_server {
server {{ include "onyx-stack.fullname" . }}-api-service:{{ .Values.api.service.port }} fail_timeout=0;
server {{ include "onyx-stack.fullname" . }}-api-service:{{ .Values.api.service.servicePort }} fail_timeout=0;
}

upstream web_server {
server {{ include "onyx-stack.fullname" . }}-webserver:{{ .Values.webserver.service.port }} fail_timeout=0;
server {{ include "onyx-stack.fullname" . }}-webserver:{{ .Values.webserver.service.servicePort }} fail_timeout=0;
}

server {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ spec:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "onyx-stack.fullname" . }}-webserver:{{ .Values.webserver.service.port }}']
args: ['{{ include "onyx-stack.fullname" . }}-webserver:{{ .Values.webserver.service.servicePort }}']
restartPolicy: Never
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
imagePullPolicy: {{ .Values.webserver.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.webserver.service.port }}
containerPort: {{ .Values.webserver.containerPorts.server }}
protocol: TCP
resources:
{{- toYaml .Values.webserver.resources | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/charts/onyx/templates/webserver-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ metadata:
spec:
type: {{ .Values.webserver.service.type }}
ports:
- port: {{ .Values.webserver.service.port }}
targetPort: http
- port: {{ .Values.webserver.service.servicePort }}
targetPort: {{ .Values.webserver.service.targetPort }}
protocol: TCP
name: http
selector:
Expand Down
Loading
Loading