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

feat(leo): Add Leo definition #127

Merged
merged 9 commits into from
Aug 23, 2023
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
2 changes: 1 addition & 1 deletion charts/studio/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: studio
description: A Helm chart for Kubernetes
type: application
version: 0.4.5
version: 0.5.1
appVersion: "v2.29.0"
maintainers:
- name: iterative
Expand Down
28 changes: 24 additions & 4 deletions charts/studio/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# studio

![Version: 0.4.5](https://img.shields.io/badge/Version-0.4.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.29.0](https://img.shields.io/badge/AppVersion-v2.29.0-informational?style=flat-square)
![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.29.0](https://img.shields.io/badge/AppVersion-v2.29.0-informational?style=flat-square)

A Helm chart for Kubernetes

Expand Down Expand Up @@ -136,11 +136,11 @@ A Helm chart for Kubernetes
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `false` | |
| serviceAccount.name | string | `""` | |
| studioBackend | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"},"nameOverride":"","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}},"securityContext":{},"service":{"port":8000,"type":"ClusterIP"},"tolerations":[]}` | Studio Backend settings group |
| studioBackend | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}},"securityContext":{},"service":{"port":8000,"type":"ClusterIP"},"tolerations":[]}` | Studio Backend settings group |
| studioBackend.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to backend pods. |
| studioBackend.envVars | object | `{}` | Additional environment variables for backend pods |
| studioBackend.replicaCount | int | `1` | Number of replicas of backend pods |
| studioBeat | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"fullnameOverride":"","nameOverride":"","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"200m","memory":"256Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"securityContext":{},"tolerations":[]}` | Studio Beat settings group |
| studioBeat | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"200m","memory":"256Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"securityContext":{},"tolerations":[]}` | Studio Beat settings group |
| studioBeat.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to beat pods. |
| studioBeat.envVars | object | `{}` | Additional environment variables for beat pods |
| studioDvcxWorker | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"ephemeralStorage":{"persistentVolumeClaim":{"storageClass":""},"size":"1Gi","type":"emptyDir"},"image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-dvcx-worker"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"8000m","ephemeral-storage":"10Gi","memory":"16Gi"},"requests":{"cpu":"500m","ephemeral-storage":"500Mi","memory":"512Mi"}},"securityContext":{},"tolerations":[]}` | Studio DVCx Worker settings group |
Expand Down Expand Up @@ -168,7 +168,27 @@ A Helm chart for Kubernetes
| studioDvcxWorker.resources.requests | object | `{"cpu":"500m","ephemeral-storage":"500Mi","memory":"512Mi"}` | DVCx worker requests configuration |
| studioDvcxWorker.securityContext | object | `{}` | DVCx worker pod security context configuration |
| studioDvcxWorker.tolerations | list | `[]` | DVCx worker pod tolerations configuration |
| studioUi | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-frontend"},"nameOverride":"","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}},"securityContext":{},"service":{"port":3000,"type":"ClusterIP"},"tolerations":[]}` | Studio UI settings group |
| studioLeo | object | `{"affinity":{},"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/leo-server","tag":"v0.0.13"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"512Mi"}},"securityContext":{},"service":{"port":8181,"type":"ClusterIP"},"tolerations":[]}` | Studio Leo settings group |
| studioLeo.affinity | object | `{}` | Leo affinity configuration |
| studioLeo.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to leo pods. |
| studioLeo.envVars | object | `{}` | Additional environment variables for leo pods |
| studioLeo.image | object | `{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/leo-server","tag":"v0.0.13"}` | Leo image settings |
| studioLeo.image.pullPolicy | string | `"IfNotPresent"` | Leo image pull policy |
| studioLeo.image.repository | string | `"docker.iterative.ai/leo-server"` | Leo image repository |
| studioLeo.image.tag | string | `"v0.0.13"` | Leo image tag |
| studioLeo.nodeSelector | object | `{}` | Leo node selector configuration |
| studioLeo.podAnnotations | object | `{}` | Additional annotations for leo pods |
| studioLeo.podSecurityContext | object | `{}` | Leo pod security context configuration |
| studioLeo.replicaCount | int | `1` | Leo replica count |
| studioLeo.resources | object | `{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"100m","memory":"512Mi"}}` | Leo resources configuration |
| studioLeo.resources.limits | object | `{"cpu":"500m","memory":"1Gi"}` | Leo resource limits |
| studioLeo.resources.requests | object | `{"cpu":"100m","memory":"512Mi"}` | Leo resource requests |
| studioLeo.securityContext | object | `{}` | Leo security context configuration |
| studioLeo.service | object | `{"port":8181,"type":"ClusterIP"}` | Leo service configuration |
| studioLeo.service.port | int | `8181` | Leo service port |
| studioLeo.service.type | string | `"ClusterIP"` | Leo service type |
| studioLeo.tolerations | list | `[]` | Leo tolerations configuration |
| studioUi | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-frontend"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}},"securityContext":{},"service":{"port":3000,"type":"ClusterIP"},"tolerations":[]}` | Studio UI settings group |
| studioUi.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to UI pods. |
| studioUi.envVars | object | `{}` | Additional environment variables for ui pods |
| studioWorker | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"1Gi"},"requests":{"cpu":"500m","memory":"512Mi"}},"securityContext":{},"tolerations":[]}` | Studio worker settings group |
Expand Down
24 changes: 19 additions & 5 deletions charts/studio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

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

{{- define "studio-ui.labels" -}}
helm.sh/chart: {{ include "studio.chart" . }}
{{ include "studio-ui.selectorLabels" . }}
Expand Down Expand Up @@ -106,11 +115,6 @@ app.kubernetes.io/name: {{ include "studio.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "studio-ui.selectorLabels" -}}
app.kubernetes.io/name: studio-ui
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "studio-backend.selectorLabels" -}}
app.kubernetes.io/name: studio-backend
app.kubernetes.io/instance: {{ .Release.Name }}
Expand All @@ -126,6 +130,16 @@ app.kubernetes.io/name: studio-dvcx-worker
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "studio-leo.selectorLabels" -}}
app.kubernetes.io/name: studio-leo
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "studio-ui.selectorLabels" -}}
app.kubernetes.io/name: studio-ui
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "studio-worker.selectorLabels" -}}
app.kubernetes.io/name: studio-worker
app.kubernetes.io/instance: {{ .Release.Name }}
Expand Down
5 changes: 5 additions & 0 deletions charts/studio/templates/configmap-studio-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ data:
{{- with .Values.studioBackend.envVars}}
{{- toYaml . | nindent 2 }}
{{- end }}

LEO_SERVICE_HOST: "{{ .Release.Name }}-leo"
LEO_SERVICE_PORT: "{{ .Values.studioLeo.service.port }}"
LEO_ENCODING: "utf-8"

8 changes: 8 additions & 0 deletions charts/studio/templates/configmap-studio-leo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{.Release.Name}}-leo
data:
{{- with .Values.studioLeo.envVars}}
{{- toYaml . | nindent 2 }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/studio/templates/deployment-studio-dvcx-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ metadata:
{{- include "studio-dvcx-worker.labels" . | nindent 4 }}
spec:
{{- if not .Values.studioDvcxWorker.autoscaling.enabled }}
{{- if ((.Values.dvcx).udfEnabled) }}
replicas: {{ .Values.studioDvcxWorker.replicaCount }}
{{- else }}
replicas: 0
{{- end }}
{{- end }}
selector:
matchLabels:
Expand Down
95 changes: 95 additions & 0 deletions charts/studio/templates/deployment-studio-leo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-leo
labels:
{{- include "studio-leo.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.studioLeo.replicaCount }}
selector:
matchLabels:
{{- include "studio-leo.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/configmap-studio-leo: {{ include (print $.Template.BasePath "/configmap-studio-leo.yaml") . | sha256sum }}
{{- include "studio.checksum" . | indent 8 }}
{{- with .Values.studioLeo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "studio-leo.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "studio.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.studioLeo.podSecurityContext | nindent 8 }}
containers:
- name: studio-leo
securityContext:
{{- toYaml .Values.studioLeo.securityContext | nindent 12 }}
image: "{{ .Values.studioLeo.image.repository }}:{{ .Values.studioLeo.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.studioBackend.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
startupProbe:
tcpSocket:
port: 80
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /leo/debug/version
port: 80
initialDelaySeconds: 5
periodSeconds: 25
successThreshold: 3
timeoutSeconds: 120
resources:
{{- toYaml .Values.studioLeo.resources | nindent 12 }}
envFrom:
- secretRef:
name: studio
- configMapRef:
name: {{ .Release.Name }}-leo
{{- if .Values.global.envFromSecret }}
- secretRef:
name: {{ .Values.global.envFromSecret }}
{{- end }}
{{- if .Values.studioLeo.envFromSecret }}
- secretRef:
name: {{ .Values.studioLeo.envFromSecret }}
{{- end }}
volumeMounts:
{{- if .Values.global.customCaCert }}
- name: studio-ca-certificates
mountPath: /usr/local/share/ca-certificates
{{- end }}
volumes:
{{- if .Values.global.customCaCert }}
- name: studio-ca-certificates
configMap:
name: studio-ca-certificates
{{- end }}
{{- with .Values.studioLeo.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.studioLeo.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.studioLeo.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/studio/templates/hpa-studio-dvcx-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: studio-dvcx-worker
{{- if ((.Values.dvcx).udfEnabled) }}
minReplicas: {{ .Values.studioDvcxWorker.autoscaling.minReplicas }}
maxReplicas: {{ .Values.studioDvcxWorker.autoscaling.maxReplicas }}
{{- else }}
minReplicas: 0
maxReplicas: 0
{{- end}}
metrics:
{{- if .Values.studioDvcxWorker.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
Expand Down
15 changes: 15 additions & 0 deletions charts/studio/templates/service-leo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name}}-studio-leo
labels:
{{- include "studio-leo.labels" . | nindent 4 }}
spec:
type: {{ .Values.studioLeo.service.type }}
ports:
- port: {{ .Values.studioLeo.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "studio-leo.selectorLabels" . | nindent 4 }}
79 changes: 67 additions & 12 deletions charts/studio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,6 @@ studioUi:
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nameOverride: ""

fullnameOverride: ""

podAnnotations: {}

podSecurityContext: {}
Expand Down Expand Up @@ -547,10 +543,6 @@ studioBackend:
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nameOverride: ""

fullnameOverride: ""

jesper7 marked this conversation as resolved.
Show resolved Hide resolved
podAnnotations: {}

podSecurityContext: {}
Expand Down Expand Up @@ -599,15 +591,75 @@ studioBeat:
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nameOverride: ""
podAnnotations: {}

fullnameOverride: ""
podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

nodeSelector: {}

tolerations: []

affinity: {}

# -- Studio Leo settings group
studioLeo:
# -- Leo image settings
image:
# -- Leo image repository
repository: docker.iterative.ai/leo-server
# -- Leo image pull policy
pullPolicy: IfNotPresent
# -- Leo image tag
tag: "v0.0.13"

# -- Additional environment variables for leo pods
envVars: {}
# Example:
# envVars:
# DEBUG: "True"

# -- The name of an existing Secret that contains sensitive environment variables
# passed to leo pods.
envFromSecret: ""

# -- Leo replica count
replicaCount: 1

# -- Leo service configuration
service:
# -- Leo service type
type: ClusterIP
# -- Leo service port
port: 8181

# -- Leo resources configuration
resources:
# -- Leo resource requests
requests:
cpu: 100m
memory: 512Mi
# -- Leo resource limits
limits:
cpu: 500m
memory: 1Gi

# -- Additional annotations for leo pods
podAnnotations: {}

# -- Leo pod security context configuration
podSecurityContext: {}
# fsGroup: 2000

# -- Leo security context configuration
securityContext: {}
# capabilities:
# drop:
Expand All @@ -616,10 +668,13 @@ studioBeat:
# runAsNonRoot: true
# runAsUser: 1000

# -- Leo node selector configuration
nodeSelector: {}

# -- Leo tolerations configuration
tolerations: []

# -- Leo affinity configuration
affinity: {}

# -- Studio worker settings group
Expand Down Expand Up @@ -757,7 +812,7 @@ studioDvcxWorker:

# -- DVCx worker pod security context configuration
podSecurityContext: {}
# fsGroup: 2000
# fsGroup: 2000

# -- DVCx worker pod security context configuration
securityContext: {}
Expand All @@ -766,7 +821,7 @@ studioDvcxWorker:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# runAsUser: 1000

# -- DVCx worker pod node selector configuration
nodeSelector: {}
Expand Down