1 {{- $workerNum := .Values.worker.number -}}
2 {{- $name := include "horovod.fullname" . }}
4 {{- if index .Values.resources "nvidia.com/gpu" }}
5 {{- $slots := index .Values.resources "nvidia.com/gpu" }}
10 name: {{ template "horovod.fullname" . }}
12 heritage: {{ .Release.Service | quote }}
13 release: {{ .Release.Name | quote }}
14 chart: {{ template "horovod.chart" . }}
15 app: {{ template "horovod.fullname" . }}
18 {{ $name }}-master slots={{ $slots }}
19 {{- range $i, $none := until (int $workerNum) }}
20 {{ $name }}-{{ $i }}.{{ $name }} slots={{ $slots }}
32 rm -f /root/.ssh/config
33 touch /root/.ssh/config
35 if [ "$USESECRETS" == "true" ];then
37 yes | cp /etc/secret-volume/id_rsa /root/.ssh/id_rsa
38 yes | cp /etc/secret-volume/authorized_keys /root/.ssh/authorized_keys
42 if [ -n "$SSHPORT" ]; then
43 echo "Port $SSHPORT" > /root/.ssh/config
44 sed -i "s/^Port.*/Port $SSHPORT /g" /etc/ssh/sshd_config
46 echo "StrictHostKeyChecking no" >> /root/.ssh/config
55 master.waitWorkerReady: |
58 function updateSSHPort() {
60 rm -f /root/.ssh/config
61 touch /root/.ssh/config
63 if [ -n "$SSHPORT" ]; then
64 echo "Port $SSHPORT" > /root/.ssh/config
65 echo "StrictHostKeyChecking no" >> /root/.ssh/config
69 function runCheckSSH() {
70 if [[ "$USESECRETS" == "true" ]];then
72 yes | cp /etc/secret-volume/id_rsa /root/.ssh/id_rsa
73 yes | cp /etc/secret-volume/authorized_keys /root/.ssh/authorized_keys
77 for i in `cat $1 | awk '{print $(1)}'`;do
78 if [[ "$i" != *"master" ]];then
79 retry 30 ssh -o ConnectTimeout=2 -q $i exit
86 local n=0;local try=$1
89 echo "Usage $0 <retry_number> <Command>";
92 until [[ $n -ge $try ]]
97 echo "retry $n :: [$cmd]"
102 if [ $? -ne 0 ]; then
114 rm -f /root/.ssh/config
115 touch /root/.ssh/config
117 if [[ "$USESECRETS" == "true" ]];then
119 yes | cp /etc/secret-volume/id_rsa /root/.ssh/id_rsa
120 yes | cp /etc/secret-volume/authorized_keys /root/.ssh/authorized_keys
124 if [ -n "$SSHPORT" ]; then
125 echo "Port $SSHPORT" > /root/.ssh/config
126 sed -i "s/^Port.*/Port $SSHPORT /g" /etc/ssh/sshd_config
128 echo "StrictHostKeyChecking no" >> /root/.ssh/config