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

Commit

Permalink
set annotation automatically when EnableGangScheduling is set to true…
Browse files Browse the repository at this point in the history
  • Loading branch information
zlcnju authored and k8s-ci-robot committed Jun 27, 2019
1 parent 213df9c commit 6aa39a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller.v1/pytorch/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ func (pc *PyTorchController) createNewPod(job *pyv1.PyTorchJob, rtype pyv1.PyTor
} else {
podTemplate.Spec.SchedulerName = gangSchedulerName
}

if podTemplate.Annotations == nil {
podTemplate.Annotations = map[string]string{}
}
// we create the podGroup with the same name as the pyTorch job
podTemplate.Annotations["scheduling.k8s.io/group-name"] = job.Name
}

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

0 comments on commit 6aa39a4

Please sign in to comment.