Skip to content

Commit

Permalink
feat(workers): Add Support for Ephemeral volumes on /tmp in workers (
Browse files Browse the repository at this point in the history
…#409)

Studio Worker is failing on parsing larger repositories, when node is running out ot ephemeral storage.

Co-authored-by: Marcin Jasion <[email protected]>
  • Loading branch information
mjasion and mjasion authored May 29, 2024
1 parent 219a191 commit 48df148
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 5 deletions.
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.13.29
version: 0.14.0
appVersion: "v2.119.2"
maintainers:
- name: iterative
Expand Down
12 changes: 9 additions & 3 deletions charts/studio/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# studio

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

A Helm chart for Kubernetes

Expand Down Expand Up @@ -144,7 +144,7 @@ A Helm chart for Kubernetes
| studioDvcxWorker.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to DVCx worker pods. |
| studioDvcxWorker.envVars | object | `{}` | Additional environment variables for DVCx worker pods |
| studioDvcxWorker.ephemeralStorage | object | `{"persistentVolumeClaim":{"claimName":"dvcx-worker","storageClass":""},"size":"20Gi","type":"ephemeral"}` | Ephemeral storage configuration |
| studioDvcxWorker.ephemeralStorage.persistentVolumeClaim | object | `{"claimName":"dvcx-worker","storageClass":""}` | Persistent Volume Claim configuration for ephemeral storage |
| studioDvcxWorker.ephemeralStorage.persistentVolumeClaim | object | `{"claimName":"dvcx-worker","storageClass":""}` | Persistent Volume Claim configuration for ephemeral storage (if type is set `pvc`) |
| studioDvcxWorker.ephemeralStorage.persistentVolumeClaim.claimName | string | `"dvcx-worker"` | Persistent Volume Claim name, to mount externally managed PVC (`ephemeralStorage.type` has to be set to `pvc`) |
| studioDvcxWorker.ephemeralStorage.persistentVolumeClaim.storageClass | string | `""` | Persistent Volume Claim `storageClass` name, by default it will use the default `storageClass`(not used when `pvc` is set as type) |
| studioDvcxWorker.ephemeralStorage.size | string | `"20Gi"` | Ephemeral Storage size |
Expand All @@ -165,7 +165,7 @@ A Helm chart for Kubernetes
| 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":{"memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}},"securityContext":{},"service":{"port":3000,"type":"ClusterIP"},"strategy":{"rollingUpdate":{"maxSurge":1,"maxUnavailable":0}},"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":{"annotations":{},"behavior":{},"enabled":false,"maxReplicas":5,"minReplicas":1,"template":[]},"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"},"logLevel":"info","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"memory":"1Gi"},"requests":{"cpu":"500m","memory":"512Mi"}},"securityContext":{},"serviceAccount":{"annotations":{},"create":false,"name":""},"strategy":{"rollingUpdate":{"maxSurge":1,"maxUnavailable":0}},"tolerations":[]}` | Studio worker settings group |
| studioWorker | object | `{"affinity":{},"autoscaling":{"annotations":{},"behavior":{},"enabled":false,"maxReplicas":5,"minReplicas":1,"template":[]},"envFromSecret":"","envVars":{},"ephemeralStorage":{"persistentVolumeClaim":{"claimName":"worker","storageClass":""},"size":"1Gi","type":"ephemeral"},"image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"},"logLevel":"info","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"memory":"1Gi"},"requests":{"cpu":"500m","memory":"512Mi"}},"securityContext":{},"serviceAccount":{"annotations":{},"create":false,"name":""},"strategy":{"rollingUpdate":{"maxSurge":1,"maxUnavailable":0}},"tolerations":[]}` | Studio worker settings group |
| studioWorker.affinity | object | `{}` | Worker affinity |
| studioWorker.autoscaling | object | `{"annotations":{},"behavior":{},"enabled":false,"maxReplicas":5,"minReplicas":1,"template":[]}` | Worker autoscaling configuration |
| studioWorker.autoscaling.annotations | object | `{}` | Worker autoscaling annotation |
Expand All @@ -176,6 +176,12 @@ A Helm chart for Kubernetes
| studioWorker.autoscaling.template | list | `[]` | Worker Custom or additional autoscaling metrics Custom or additional autoscaling metrics ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics |
| studioWorker.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to worker pods. |
| studioWorker.envVars | object | `{}` | Additional environment variables for worker pods |
| studioWorker.ephemeralStorage | object | `{"persistentVolumeClaim":{"claimName":"worker","storageClass":""},"size":"1Gi","type":"ephemeral"}` | Ephemeral storage configuration |
| studioWorker.ephemeralStorage.persistentVolumeClaim | object | `{"claimName":"worker","storageClass":""}` | Persistent Volume Claim configuration for ephemeral storage (if type is set `pvc`) |
| studioWorker.ephemeralStorage.persistentVolumeClaim.claimName | string | `"worker"` | Persistent Volume Claim name, to mount externally managed PVC (`ephemeralStorage.type` has to be set to `pvc`) |
| studioWorker.ephemeralStorage.persistentVolumeClaim.storageClass | string | `""` | Persistent Volume Claim `storageClass` name, by default it will use the default `storageClass`(not used when `pvc` is set as type) |
| studioWorker.ephemeralStorage.size | string | `"1Gi"` | Ephemeral Storage size |
| studioWorker.ephemeralStorage.type | string | `"ephemeral"` | Ephemeral Storage type. Possible values: `emptyDir`, `ephemeral`, `pvc`, `pvcRWX` |
| studioWorker.image | object | `{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"}` | Studio worker image settings |
| studioWorker.image.pullPolicy | string | `"IfNotPresent"` | Studio worker image pull policy |
| studioWorker.image.repository | string | `"docker.iterative.ai/studio-backend"` | Studio worker image repository |
Expand Down
27 changes: 27 additions & 0 deletions charts/studio/templates/deployment-studio-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ spec:
{{- end }}
- name: studio-ca-certificates
mountPath: /usr/local/share/ca-certificates
- name: tmp-ephemeral
mountPath: /tmp
volumes:
{{- if not .Values.global.blobvault.bucket }}
- name: blobvault
Expand All @@ -83,6 +85,31 @@ spec:
- name: studio-ca-certificates
configMap:
name: studio-ca-certificates
- name: tmp-ephemeral
{{- if eq .Values.studioWorker.ephemeralStorage.type "ephemeral" }}
ephemeral:
volumeClaimTemplate:
metadata:
labels:
type: {{.Release.Name}}-{{ .Values.studioWorker.ephemeralStorage.persistentVolumeClaim.claimName }}
spec:
accessModes: [ "ReadWriteOnce" ]
{{- if .Values.studioWorker.ephemeralStorage.persistentVolumeClaim.storageClass }}
storageClassName: {{ .Values.studioWorker.ephemeralStorage.persistentVolumeClaim.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.studioWorker.ephemeralStorage.size }}
{{- else if eq .Values.studioWorker.ephemeralStorage.type "pvc" }}
persistentVolumeClaim:
claimName: {{ .Values.studioWorker.ephemeralStorage.persistentVolumeClaim.claimName }}
{{- else if eq .Values.studioWorker.ephemeralStorage.type "pvcRWX" }}
persistentVolumeClaim:
claimName: {{.Release.Name}}-studio-worker-ephemeral-rwx
{{- else if eq .Values.studioWorker.ephemeralStorage.type "emptyDir"}}
emptyDir:
sizeLimit: {{ .Values.studioWorker.ephemeralStorage.size }}
{{- end }}
{{- with .Values.studioWorker.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
15 changes: 14 additions & 1 deletion charts/studio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,19 @@ studioWorker:
# If not set and create is true, a name is generated using the fullname template
name: ""

# -- Ephemeral storage configuration
ephemeralStorage:
# -- Ephemeral Storage type. Possible values: `emptyDir`, `ephemeral`, `pvc`, `pvcRWX`
type: ephemeral
# -- Ephemeral Storage size
size: 1Gi
# -- Persistent Volume Claim configuration for ephemeral storage (if type is set `pvc`)
persistentVolumeClaim:
# -- Persistent Volume Claim name, to mount externally managed PVC (`ephemeralStorage.type` has to be set to `pvc`)
claimName: "worker"
# -- Persistent Volume Claim `storageClass` name, by default it will use the default `storageClass`(not used when `pvc` is set as type)
storageClass: ""


# -- Studio DVCx Worker settings group
studioDvcxWorker:
Expand Down Expand Up @@ -664,7 +677,7 @@ studioDvcxWorker:
type: ephemeral
# -- Ephemeral Storage size
size: 20Gi
# -- Persistent Volume Claim configuration for ephemeral storage
# -- Persistent Volume Claim configuration for ephemeral storage (if type is set `pvc`)
persistentVolumeClaim:
# -- Persistent Volume Claim name, to mount externally managed PVC (`ephemeralStorage.type` has to be set to `pvc`)
claimName: "dvcx-worker"
Expand Down

0 comments on commit 48df148

Please sign in to comment.