summaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/applications/charts/sample-horovod-app/templates/job.yaml
diff options
context:
space:
mode:
authorRajamohan Raj <rajamohan.raj@intel.com>2019-04-11 00:36:20 +0000
committerRajamohan Raj <rajamohan.raj@intel.com>2019-04-11 00:36:20 +0000
commit9d98267fe7046c304a71f98e89de6774d09f094e (patch)
tree7e93353e9eff19a11e01a73ff5c176ec78513237 /vnfs/DAaaS/applications/charts/sample-horovod-app/templates/job.yaml
parent6fca0bf437c0917096a0105292514633c0ec3db3 (diff)
Add helm charts for horovod based app
Tasks in this patch: Create sample Tensorflow MNIST application using horovod: https://jira.onap.org/browse/ONAPARC-450 Change-Id: I50827a47f7c48574944cde28fca32f265b649b59 Issue-ID: ONAPARC-450 Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com>
Diffstat (limited to 'vnfs/DAaaS/applications/charts/sample-horovod-app/templates/job.yaml')
-rw-r--r--vnfs/DAaaS/applications/charts/sample-horovod-app/templates/job.yaml126
1 files changed, 126 insertions, 0 deletions
diff --git a/vnfs/DAaaS/applications/charts/sample-horovod-app/templates/job.yaml b/vnfs/DAaaS/applications/charts/sample-horovod-app/templates/job.yaml
new file mode 100644
index 00000000..4e59b277
--- /dev/null
+++ b/vnfs/DAaaS/applications/charts/sample-horovod-app/templates/job.yaml
@@ -0,0 +1,126 @@
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: {{ template "horovod.fullname" . }}
+ labels:
+ app: {{ template "horovod.name" . }}
+ chart: {{ template "horovod.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+ role: master
+spec:
+ template:
+ metadata:
+ labels:
+ app: {{ template "horovod.name" . }}
+ release: {{ .Release.Name }}
+ role: master
+ spec:
+ {{- if .Values.useHostNetwork }}
+ hostNetwork: {{ .Values.useHostNetwork }}
+ dnsPolicy: ClusterFirstWithHostNet
+ {{- end }}
+ {{- if .Values.useHostPID }}
+ hostPID: {{ .Values.useHostPID }}
+ {{- end }}
+ restartPolicy: OnFailure
+ volumes:
+ - name: {{ template "horovod.fullname" . }}-cm
+ configMap:
+ name: {{ template "horovod.fullname" . }}
+ items:
+ - key: hostfile.config
+ path: hostfile
+ mode: 438
+ - key: master.waitWorkerReady
+ path: waitWorkersReady.sh
+ mode: 365
+ - key: master.run
+ path: run.sh
+ mode: 365
+ {{- if .Values.ssh.useSecrets }}
+ - name: {{ template "horovod.fullname" . }}-secret
+ secret:
+ secretName: {{ template "horovod.fullname" . }}
+ defaultMode: 448
+ items:
+ - key: host-key
+ path: id_rsa
+ - key: host-key-pub
+ path: authorized_keys
+ {{- end }}
+{{- if .Values.volumes }}
+{{ toYaml .Values.volumes | indent 6 }}
+{{- end }}
+ containers:
+ - name: horovod-master
+ image: "{{ .Values.master.image.repository }}:{{ .Values.master.image.tag }}"
+ imagePullPolicy: {{ .Values.master.image.pullPolicy }}
+ env:
+ - name: SSHPORT
+ value: "{{ .Values.ssh.port }}"
+ {{- if .Values.ssh.useSecrets }}
+ - name: USESECRETS
+ value: "{{ .Values.ssh.useSecrets }}"
+ {{- end }}
+ {{- if .Values.master.env }}
+ {{- range $key, $value := .Values.master.env }}
+ - name: "{{ $key }}"
+ value: "{{ $value }}"
+ {{- end }}
+ {{- end }}
+{{- if .Values.master.privileged }}
+ securityContext:
+ privileged: true
+{{- end }}
+ ports:
+ - containerPort: {{ .Values.ssh.port }}
+ volumeMounts:
+ - name: {{ template "horovod.fullname" . }}-cm
+ mountPath: /horovod/generated
+ {{- if .Values.ssh.useSecrets }}
+ - name: {{ template "horovod.fullname" . }}-secret
+ readOnly: true
+ mountPath: "/etc/secret-volume"
+ {{- end }}
+{{- if .Values.volumeMounts }}
+{{ toYaml .Values.volumeMounts | indent 8 }}
+{{- end }}
+ command:
+ - /horovod/generated/run.sh
+ args:
+{{ toYaml .Values.master.args | indent 10 }}
+ resources:
+{{ toYaml .Values.resources | indent 10 }}
+{{- if .Values.ssh.useSecrets }}
+ initContainers:
+ - name: wait-workers
+ image: "{{ .Values.master.image.repository }}:{{ .Values.master.image.tag }}"
+ imagePullPolicy: {{ .Values.master.image.pullPolicy }}
+ env:
+ - name: SSHPORT
+ value: "{{ .Values.ssh.port }}"
+ {{- if .Values.ssh.useSecrets }}
+ - name: USESECRETS
+ value: "{{ .Values.ssh.useSecrets }}"
+ {{- end }}
+ {{- if .Values.master.env }}
+ {{- range $key, $value := .Values.master.env }}
+ - name: "{{ $key }}"
+ value: "{{ $value }}"
+ {{- end }}
+ {{- end }}
+ command:
+ - /horovod/generated/waitWorkersReady.sh
+ args:
+ - /horovod/generated/hostfile
+ volumeMounts:
+ - name: {{ template "horovod.fullname" . }}-cm
+ mountPath: /horovod/generated
+ {{- if .Values.ssh.useSecrets }}
+ - name: {{ template "horovod.fullname" . }}-secret
+ readOnly: true
+ mountPath: "/etc/secret-volume"
+ {{- end }}
+{{- end }}