Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove duplicate code of add task spec annotation #1839

Merged
merged 1 commit into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions pkg/controller.v1/mpi/mpijob.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ const (
// podTemplateSchedulerNameReason is the warning reason when other scheduler name is set
// in pod templates with gang-scheduling enabled
podTemplateSchedulerNameReason = "SettedPodTemplateSchedulerName"

// volcanoTaskSpecKey task spec key used in pod annotation when EnableGangScheduling is true
volcanoTaskSpecKey = "volcano.sh/task-spec"
)

const (
Expand Down
6 changes: 0 additions & 6 deletions pkg/controller.v1/mpi/mpijob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,6 @@ func (jc *MPIJobReconciler) newWorker(mpiJob *kubeflowv1.MPIJob, name string) *c

rtWorker := strings.ToLower(string(kubeflowv1.MPIJobReplicaTypeWorker))
jc.PodGroupControl.DecoratePodTemplateSpec(podSpec, mpiJob, rtWorker)
if jc.PodGroupControl.GetSchedulerName() == "volcano" {
podSpec.Annotations[volcanoTaskSpecKey] = rtWorker
}
}

return &corev1.Pod{
Expand Down Expand Up @@ -1076,9 +1073,6 @@ func (jc *MPIJobReconciler) newLauncher(mpiJob *kubeflowv1.MPIJob, kubectlDelive

rt := strings.ToLower(string(kubeflowv1.MPIJobReplicaTypeLauncher))
jc.PodGroupControl.DecoratePodTemplateSpec(podSpec, mpiJob, rt)
if jc.PodGroupControl.GetSchedulerName() == "volcano" {
podSpec.Annotations[volcanoTaskSpecKey] = rt
}
}

podSpec.Spec.ServiceAccountName = launcherName
Expand Down
6 changes: 0 additions & 6 deletions pkg/controller.v1/tensorflow/tfjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ const (

controllerName = "tfjob-controller"

// volcanoTaskSpecKey task spec key used in pod annotation when EnableGangScheduling is true
volcanoTaskSpecKey = "volcano.sh/task-spec"

// tfConfig is the environment variable name of TensorFlow cluster spec.
tfConfig = "TF_CONFIG"
// exitedWithCodeReason is the normal reason when the pod is exited because of the exit code.
Expand Down Expand Up @@ -900,9 +897,6 @@ func (r *TFJobReconciler) createNewPod(tfjob *kubeflowv1.TFJob, rt, index string
}

r.PodGroupControl.DecoratePodTemplateSpec(podTemplate, tfjob, rt)
if gangSchedulerName == "volcano" {
podTemplate.Annotations[volcanoTaskSpecKey] = rt
}
}

err = r.PodControl.CreatePodsWithControllerRef(tfjob.Namespace, podTemplate, tfjob, controllerRef)
Expand Down