Skip to content

Commit

Permalink
Modify the support method of Toleration (#899)
Browse files Browse the repository at this point in the history
* modify set toleration way and add toleration for update serve

* support toleration for update serve

* update charts yaml
  • Loading branch information
AlanFokCo authored Feb 8, 2023
1 parent e11d8f7 commit c3da54d
Show file tree
Hide file tree
Showing 25 changed files with 407 additions and 138 deletions.
64 changes: 44 additions & 20 deletions charts/cron-tfjob/templates/_tfjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ spec:
{{- if ne (len .Values.tfjob.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tfjob.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -349,11 +355,17 @@ spec:
{{- if ne (len .Values.tfjob.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tfjob.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -671,11 +683,17 @@ spec:
{{- if ne (len .Values.tfjob.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tfjob.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -990,11 +1008,17 @@ spec:
{{- if ne (len .Values.tfjob.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tfjob.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down
16 changes: 11 additions & 5 deletions charts/custom-serving/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down
36 changes: 24 additions & 12 deletions charts/etjob/templates/etjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
{{- end }}
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.schedulerName }}
Expand Down Expand Up @@ -326,12 +332,18 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
{{- end }}
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.schedulerName }}
Expand Down
20 changes: 13 additions & 7 deletions charts/etjob/templates/tensorboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ spec:
{{- end }}
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
{{- end }}
{{- range $tolerationKey := .Values.tolerations }}
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
affinity:
Expand Down
16 changes: 11 additions & 5 deletions charts/evaluatejob/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,17 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down
16 changes: 11 additions & 5 deletions charts/modeljob/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down
16 changes: 11 additions & 5 deletions charts/mpijob/templates/mpijob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down
34 changes: 23 additions & 11 deletions charts/pytorchjob/templates/pytorchjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -344,12 +350,18 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
{{- end }}
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.schedulerName }}
Expand Down
20 changes: 13 additions & 7 deletions charts/pytorchjob/templates/tensorboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ spec:
{{- end }}
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
{{- end }}
{{- range $tolerationKey := .Values.tolerations }}
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
affinity:
Expand Down
16 changes: 11 additions & 5 deletions charts/tfjob/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ spec:
{{- if ne (len .Values.tolerations) 0 }}
tolerations:
{{- range $tolerationKey := .Values.tolerations }}
{{- if eq $tolerationKey "all" }}
- operator: "Exists"
{{- else }}
- key: "{{ $tolerationKey }}"
operator: "Exists"
- {{- if $tolerationKey.key }}
key: "{{ $tolerationKey.key }}"
{{- end }}
{{- if $tolerationKey.value }}
value: "{{ $tolerationKey.value }}"
{{- end }}
{{- if $tolerationKey.effect }}
effect: "{{ $tolerationKey.effect }}"
{{- end }}
{{- if $tolerationKey.operator }}
operator: "{{ $tolerationKey.operator }}"
{{- end }}
{{- end }}
{{- end }}
Expand Down
Loading

0 comments on commit c3da54d

Please sign in to comment.