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

set annotation automatically when EnableGangScheduling is set to true… #181

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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