Skip to content

Commit

Permalink
Rename DVCx to DataChain (#431)
Browse files Browse the repository at this point in the history
* Rename DVCx to DataChain

* fixup! Merge remote-tracking branch 'origin/main' into clickhouse

* Rename files as well

* Helm-Docs update

* Update Chart.yaml

* Helm-Docs update

* Helm-Docs update

* Update deployment-studio-datachain-worker.yaml

* Update deployment-studio-datachain-worker.yaml

---------

Co-authored-by: 0x2b3bfa0 <[email protected]>
  • Loading branch information
0x2b3bfa0 and 0x2b3bfa0 authored Jul 2, 2024
1 parent 3873e3a commit a43cf75
Show file tree
Hide file tree
Showing 16 changed files with 215 additions and 216 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.15.7
version: 0.16.0
appVersion: "v2.125.0"
maintainers:
- name: iterative
Expand Down
80 changes: 40 additions & 40 deletions charts/studio/README.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions charts/studio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{- define "studio-dvcx-worker.labels" -}}
{{- define "studio-datachain-worker.labels" -}}
helm.sh/chart: {{ include "studio.chart" . }}
{{ include "studio-dvcx-worker.selectorLabels" . }}
{{ include "studio-datachain-worker.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand Down Expand Up @@ -130,8 +130,8 @@ app.kubernetes.io/name: studio-beat
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

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

Expand Down Expand Up @@ -178,11 +178,11 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{- define "studio-dvcx-worker.serviceAccountName" -}}
{{- if ((.Values.studioDvcxWorker).serviceAccount).create }}
{{- default (printf "%s%s" (include "studio.fullname" .) "-dvcx-worker") .Values.studioDvcxWorker.serviceAccount.name }}
{{- define "studio-datachain-worker.serviceAccountName" -}}
{{- if ((.Values.studioDatachainWorker).serviceAccount).create }}
{{- default (printf "%s%s" (include "studio.fullname" .) "-datachain-worker") .Values.studioDatachainWorker.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.studioDvcxWorker.serviceAccount.name }}
{{- default "default" .Values.studioDatachainWorker.serviceAccount.name }}
{{- end }}
{{- end }}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-datachain-worker
data:
CELERY_LOG_LEVEL: "{{ .Values.studioDatachainWorker.logLevel | default "info" | lower }}"
{{- with .Values.studioDatachainWorker.envVars}}
{{- toYaml . | nindent 2 }}
{{- end }}
9 changes: 0 additions & 9 deletions charts/studio/templates/configmap-studio-dvcx-worker.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions charts/studio/templates/configmap-studio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ data:
SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS: "studio-ui.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioUi.service.port }},studio-backend.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioBackend.service.port }}"
{{- end }}

{{- $dvcx := .Values.global.dvcx | default dict }}
{{- $dvcxClickhouse := $dvcx.clickHouse | default dict }}
DVCX_ENABLED: {{ $dvcx.enabled | default false | quote | title }}
DVCX_UDF_ENABLED: {{ $dvcx.udfEnabled | default false | quote | title }}
{{- $datachain := .Values.global.datachain | default dict }}
{{- $datachainClickhouse := $datachain.clickHouse | default dict }}
DATACHAIN_ENABLED: {{ $datachain.enabled | default false | quote | title }}
DATACHAIN_UDF_ENABLED: {{ $datachain.udfEnabled | default false | quote | title }}
2 changes: 1 addition & 1 deletion charts/studio/templates/deployment-studio-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
./manage.py migrate
{{- if not (hasPrefix "sha-" (.Values.studioBackend.image.tag | default "")) }}
{{- if semverCompare "<=2.103.0" (.Values.studioBackend.image.tag | default .Chart.AppVersion) }}
./manage.py migrate --database dvcx
./manage.py migrate --database dvcx # FIXME: do we really still need this?
{{- end }}
{{- end }}
{{- if and .Release.IsUpgrade (not .Values.ci) }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{.Release.Name}}-dvcx-worker
name: {{.Release.Name}}-datachain-worker
labels:
{{- include "studio-dvcx-worker.labels" . | nindent 4 }}
{{- include "studio-datachain-worker.labels" . | nindent 4 }}
spec:
{{- if not .Values.studioDvcxWorker.autoscaling.enabled }}
{{- if ((.Values.global.dvcx).udfEnabled) }}
replicas: {{ .Values.studioDvcxWorker.replicaCount }}
{{- if not .Values.studioDatachainWorker.autoscaling.enabled }}
{{- if ((.Values.global.datachain).udfEnabled) }}
replicas: {{ .Values.studioDatachainWorker.replicaCount }}
{{- else }}
replicas: 0
{{- end }}
{{- end }}
{{- with .Values.studioDvcxWorker.strategy }}
{{- with .Values.studioDatachainWorker.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "studio-dvcx-worker.selectorLabels" . | nindent 6 }}
{{- include "studio-datachain-worker.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/configmap-studio-dvcx-worker: {{ include (print $.Template.BasePath "/configmap-studio-dvcx-worker.yaml") . | sha256sum }}
checksum/configmap-studio-datachain-worker: {{ include (print $.Template.BasePath "/configmap-studio-datachain-worker.yaml") . | sha256sum }}
{{- include "studio.checksum" . | indent 8 }}
{{- with .Values.studioDvcxWorker.podAnnotations }}
{{- with .Values.studioDatachainWorker.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "studio-dvcx-worker.selectorLabels" . | nindent 8 }}
{{- include "studio-datachain-worker.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "studio-dvcx-worker.serviceAccountName" . }}
serviceAccountName: {{ include "studio-datachain-worker.serviceAccountName" . }}
terminationGracePeriodSeconds: 150
securityContext:
fsGroup: 103
fsGroupChangePolicy: "OnRootMismatch"
{{- with .Values.studioDvcxWorker.podSecurityContext }}
{{- with .Values.studioDatachainWorker.podSecurityContext }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: studio-dvcx-worker
- name: studio-datachain-worker
securityContext:
{{- toYaml .Values.studioDvcxWorker.securityContext | nindent 12 }}
image: "{{ .Values.studioDvcxWorker.image.repository }}:{{ .Values.studioDvcxWorker.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.studioDvcxWorker.image.pullPolicy }}
{{- toYaml .Values.studioDatachainWorker.securityContext | nindent 12 }}
image: "{{ .Values.studioDatachainWorker.image.repository }}:{{ .Values.studioDatachainWorker.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.studioDatachainWorker.image.pullPolicy }}
args: ["/app/bin/run_celery_worker_udf.sh"]
resources:
{{- toYaml .Values.studioDvcxWorker.resources | nindent 12 }}
{{- toYaml .Values.studioDatachainWorker.resources | nindent 12 }}
env:
- name: "NO_MIGRATE_DB"
value: "1"
Expand All @@ -60,24 +60,24 @@ spec:
- configMapRef:
name: studio
- configMapRef:
name: {{ .Release.Name }}-dvcx-worker
name: {{ .Release.Name }}-datachain-worker
- secretRef:
name: studio
{{- if .Values.global.envFromSecret }}
- secretRef:
name: {{ .Values.global.envFromSecret }}
{{- end }}
{{- if .Values.studioDvcxWorker.envFromSecret }}
{{- if .Values.studioDatachainWorker.envFromSecret }}
- secretRef:
name: {{ .Values.studioDvcxWorker.envFromSecret }}
name: {{ .Values.studioDatachainWorker.envFromSecret }}
{{- end }}
livenessProbe:
exec:
command:
- python
- -c
- 'from viewer.utils import sqlalchemy_liveness_probe; sqlalchemy_liveness_probe()'
{{- $livenessProbe := .Values.studioDvcxWorker.livenessProbe | default dict }}
{{- $livenessProbe := .Values.studioDatachainWorker.livenessProbe | default dict }}
initialDelaySeconds: {{ $livenessProbe.initialDelaySeconds | default 10 }}
periodSeconds: {{ $livenessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ $livenessProbe.timeoutSeconds | default 10 }}
Expand All @@ -90,7 +90,7 @@ spec:
mountPath: /usr/local/share/ca-certificates
- name: tmp-ephemeral
mountPath: /tmp/shared
{{- if .Values.studioDvcxWorker.localStorage }}
{{- if .Values.studioDatachainWorker.localStorage }}
- name: tmp-local
mountPath: /tmp/local
{{- end }}
Expand All @@ -104,31 +104,31 @@ spec:
configMap:
name: studio-ca-certificates
- name: tmp-ephemeral
{{- if eq .Values.studioDvcxWorker.ephemeralStorage.type "ephemeral" }}
{{- if eq .Values.studioDatachainWorker.ephemeralStorage.type "ephemeral" }}
ephemeral:
volumeClaimTemplate:
metadata:
labels:
type: {{.Release.Name}}-{{ .Values.studioDvcxWorker.ephemeralStorage.persistentVolumeClaim.claimName }}
type: {{.Release.Name}}-{{ .Values.studioDatachainWorker.ephemeralStorage.persistentVolumeClaim.claimName }}
spec:
accessModes: [ "ReadWriteOnce" ]
{{- if .Values.studioDvcxWorker.ephemeralStorage.persistentVolumeClaim.storageClass }}
storageClassName: {{ .Values.studioDvcxWorker.ephemeralStorage.persistentVolumeClaim.storageClass }}
{{- if .Values.studioDatachainWorker.ephemeralStorage.persistentVolumeClaim.storageClass }}
storageClassName: {{ .Values.studioDatachainWorker.ephemeralStorage.persistentVolumeClaim.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.studioDvcxWorker.ephemeralStorage.size }}
{{- else if eq .Values.studioDvcxWorker.ephemeralStorage.type "pvc" }}
storage: {{ .Values.studioDatachainWorker.ephemeralStorage.size }}
{{- else if eq .Values.studioDatachainWorker.ephemeralStorage.type "pvc" }}
persistentVolumeClaim:
claimName: {{ .Values.studioDvcxWorker.ephemeralStorage.persistentVolumeClaim.claimName }}
{{- else if eq .Values.studioDvcxWorker.ephemeralStorage.type "pvcRWX" }}
claimName: {{ .Values.studioDatachainWorker.ephemeralStorage.persistentVolumeClaim.claimName }}
{{- else if eq .Values.studioDatachainWorker.ephemeralStorage.type "pvcRWX" }}
persistentVolumeClaim:
claimName: {{.Release.Name}}-studio-dvcx-worker-ephemeral-rwx
{{- else if eq .Values.studioDvcxWorker.ephemeralStorage.type "emptyDir"}}
claimName: {{.Release.Name}}-studio-datachain-worker-ephemeral-rwx
{{- else if eq .Values.studioDatachainWorker.ephemeralStorage.type "emptyDir"}}
emptyDir:
sizeLimit: {{ .Values.studioDvcxWorker.ephemeralStorage.size }}
sizeLimit: {{ .Values.studioDatachainWorker.ephemeralStorage.size }}
{{- end }}
{{- with .Values.studioDvcxWorker.localStorage }}
{{- with .Values.studioDatachainWorker.localStorage }}
- name: tmp-local
{{- if eq .type "ephemeral" }}
ephemeral:
Expand All @@ -152,15 +152,15 @@ spec:
sizeLimit: {{ .size }}
{{- end }}
{{- end }}
{{- with .Values.studioDvcxWorker.nodeSelector }}
{{- with .Values.studioDatachainWorker.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.studioDvcxWorker.affinity }}
{{- with .Values.studioDatachainWorker.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.studioDvcxWorker.tolerations }}
{{- with .Values.studioDatachainWorker.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
47 changes: 47 additions & 0 deletions charts/studio/templates/hpa-studio-datachain-worker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{- if .Values.studioDatachainWorker.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{.Release.Name}}-datachain-worker
labels:
{{- include "studio-datachain-worker.labels" . | nindent 4 }}
{{- with .Values.studioDatachainWorker.autoscaling.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{.Release.Name}}-datachain-worker
{{- if ((.Values.global.datachain).udfEnabled) }}
minReplicas: {{ .Values.studioDatachainWorker.autoscaling.minReplicas }}
maxReplicas: {{ .Values.studioDatachainWorker.autoscaling.maxReplicas }}
{{- else }}
minReplicas: 0
maxReplicas: 0
{{- end}}
metrics:
{{- if .Values.studioDatachainWorker.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.studioDatachainWorker.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- if .Values.studioDatachainWorker.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.studioDatachainWorker.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- with .Values.studioDatachainWorker.autoscaling.template }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.studioDatachainWorker.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
47 changes: 0 additions & 47 deletions charts/studio/templates/hpa-studio-dvcx-worker.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions charts/studio/templates/pvc-studio-datachain-worker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if eq .Values.studioDatachainWorker.ephemeralStorage.type "pvcRWX" }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{.Release.Name}}-studio-datachain-worker-ephemeral-rwx
labels:
{{- include "studio-datachain-worker.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteMany
storageClassName: {{ .Values.studioDatachainWorker.ephemeralStorage.persistentVolumeClaim.storageClass }}
resources:
requests:
storage: {{ .Values.studioDatachainWorker.ephemeralStorage.size }}
{{- end }}
15 changes: 0 additions & 15 deletions charts/studio/templates/pvc-studio-dvcx-worker.yaml

This file was deleted.

Loading

0 comments on commit a43cf75

Please sign in to comment.