Skip to content

Commit

Permalink
replace Job with Deployment in the chart
Browse files Browse the repository at this point in the history
  • Loading branch information
baxtree committed Jan 2, 2024
1 parent 131c7bf commit f4d06b1
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 21 deletions.
13 changes: 13 additions & 0 deletions charts/subaligner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Subaligner Helm Chart

This chart needs to be customised with the following parameters:

- **videoDirectory:** The path to the video directory on the host node.
- **subtitleDirectory:** The path to the subtitle directory on the host node.
- **outputDirectory:** The path to the output directory on the host node.


### Installation
```
helm install subaligner . --set videoDirectory=$VIDEO_DIRECTORY,subtitleDirectory=$SUBTITLE_DIRECTORY,outputDirectory=$OUTPUT_DIRECTORY
```
16 changes: 15 additions & 1 deletion charts/subaligner/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
{{ .Release.Name }} is deployed to {{ .Release.Namespace }} namespace.
{{ .Release.Name }} is deployed to {{ .Release.Namespace }} namespace.

Input directories: /videos /subtitles
Output directory: /output

Examples of usage (replace "subaligner-**-*" with the actual pod name):
kubectl exec -it subaligner-**-* -- subaligner -m dual -v /videos/video.mp4 -s /subtitles/subtitle.srt -o /output/subtitle_aligned.srt
kubectl exec -it subaligner-**-* -- subaligner_batch -m dual -vd /videos -sd /subtitles -od /output
kubectl exec -it subaligner-**-* -- subaligner -m transcribe -v /videos/video.mp4 -ml eng -mr whisper -mf small -o /output/subtitle_aligned.srt

More can be found at:
https://subaligner.readthedocs.io/en/latest/usage.html
https://subaligner.readthedocs.io/en/latest/advanced_usage.html

Thank you for installing the Subaligner Helm Chart!
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
apiVersion: batch/v1
kind: Job
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{.Release.Name}}-{{ randAlphaNum 5 | lower }}
name: {{ include "subaligner.fullname" . }}
labels:
{{- include "subaligner.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "subaligner.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
Expand All @@ -14,7 +20,6 @@ spec:
labels:
{{- include "subaligner.selectorLabels" . | nindent 8 }}
spec:
restartPolicy: Never
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
Expand All @@ -26,35 +31,31 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
command: ['/usr/local/bin/subaligner_batch', '-m', '{{ .Values.alignmentMode }}', '-vd', '/subaligner-media/videos', '-sd', '/subaligner-media/subtitles', '-od', '/subaligner-media/output']
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/bash", "-c", "--"]
args: ["tail -f /dev/null"]
volumeMounts:
- name: videos
mountPath: /subaligner-media/videos
mountPath: /videos
- name: subtitles
mountPath: /subaligner-media/subtitles
mountPath: /subtitles
- name: output
mountPath: /subaligner-media/output
mountPath: /output
resources:
{{- toYaml .Values.resources | nindent 12 }}
envFrom:
- secretRef:
name: {{ include "subaligner.fullname" . }}
- configMapRef:
name: {{ include "subaligner.fullname" . }}
volumes:
- name: videos
hostPath:
path: {{ .Values.pathToTheVideoDirectory }}
path: {{ .Values.videoDirectory }}
type: Directory
- name: subtitles
hostPath:
path: {{ .Values.pathToTheSubtitleDirectory }}
path: {{ .Values.subtitleDirectory }}
type: Directory
- name: output
hostPath:
path: {{ .Values.pathToTheOutputDirectory }}
path: {{ .Values.outputDirectory }}
type: Directory
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
17 changes: 13 additions & 4 deletions charts/subaligner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,24 @@ podSecurityContext: {}

securityContext: {}

service:
type: ClusterIP
port: 80

resources: {}

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}

alignmentMode: "dual"
pathToTheVideoDirectory: ""
pathToTheSubtitleDirectory: ""
pathToTheOutputDirectory: ""
videoDirectory: "CHANGE_ME"
subtitleDirectory: "CHANGE_ME"
outputDirectory: "CHANGE_ME"

0 comments on commit f4d06b1

Please sign in to comment.