Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 6aa39a4

Browse files
zlcnjuk8s-ci-robot
authored andcommitted
set annotation automatically when EnableGangScheduling is set to true[1032](kubeflow/trainer#1032) (#181)
1 parent 213df9c commit 6aa39a4

File tree

1 file changed

+6
-0
lines changed
  • pkg/controller.v1/pytorch

1 file changed

+6
-0
lines changed

pkg/controller.v1/pytorch/pod.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ func (pc *PyTorchController) createNewPod(job *pyv1.PyTorchJob, rtype pyv1.PyTor
222222
} else {
223223
podTemplate.Spec.SchedulerName = gangSchedulerName
224224
}
225+
226+
if podTemplate.Annotations == nil {
227+
podTemplate.Annotations = map[string]string{}
228+
}
229+
// we create the podGroup with the same name as the pyTorch job
230+
podTemplate.Annotations["scheduling.k8s.io/group-name"] = job.Name
225231
}
226232

227233
err = pc.PodControl.CreatePodsWithControllerRef(job.Namespace, podTemplate, job, controllerRef)

0 commit comments

Comments
 (0)