Skip to content

Commit 3e449cd

Browse files
authored
fix overwritten envFrom (#194)
1 parent 4b72d6b commit 3e449cd

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

tools/pytorchjob-generator/chart/templates/_helpers.tpl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,17 @@ resources:
7676

7777

7878
{{- define "mlbatch.env" }}
79+
{{- $envFromList := list }}
80+
{{- if .Values.envFrom }}
81+
{{- $envFromList = .Values.envFrom }}
82+
{{- end }}
7983
{{- if .Values.ncclGdrEnvConfigMap }}
84+
{{- $configMapRef := dict "configMapRef" (dict "name" .Values.ncclGdrEnvConfigMap) }}
85+
{{- $envFromList = append $envFromList $configMapRef }}
86+
{{- end }}
87+
{{- if $envFromList }}
8088
envFrom:
81-
- configMapRef:
82-
name: {{ .Values.ncclGdrEnvConfigMap }}
89+
{{- toYaml $envFromList | nindent 2 }}
8390
{{- end }}
8491
{{- if or .Values.environmentVariables .Values.sshGitCloneConfig .Values.mountNVMe .Values.topologyFileConfigMap ( eq .Values.schedulerName "sakkara" ) }}
8592
env:

tools/pytorchjob-generator/chart/templates/appwrapper.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ spec:
116116
{{- include "mlbatch.volumes" . | indent 38 }}
117117
containers:
118118
- name: pytorch
119-
{{- if .Values.envFrom }}
120-
envFrom:
121-
{{- toYaml .Values.envFrom | nindent 46 }}
122-
{{- end }}
123119
image: {{ required "Please specify a 'containerImage' in the user file" .Values.containerImage }}
124120
imagePullPolicy: {{ .Values.imagePullPolicy | default "IfNotPresent" }}
125121
{{- include "mlbatch.securityContext" . | indent 44 }}
@@ -143,10 +139,6 @@ spec:
143139
{{- include "mlbatch.volumes" . | indent 38 }}
144140
containers:
145141
- name: pytorch
146-
{{- if .Values.envFrom }}
147-
envFrom:
148-
{{- toYaml .Values.envFrom | nindent 46 }}
149-
{{- end }}
150142
image: {{ required "Please specify a 'containerImage' in the user file" .Values.containerImage }}
151143
imagePullPolicy: {{ .Values.imagePullPolicy | default "IfNotPresent" }}
152144
{{- include "mlbatch.securityContext" . | indent 44 }}

0 commit comments

Comments
 (0)