Skip to content

Commit

Permalink
fix comments for pytorch-controller (#1620)
Browse files Browse the repository at this point in the history
Co-authored-by: hackerboy01 <penglei031303@gmail.com>
  • Loading branch information
hackerboy01 and hackerboy01 authored Jun 26, 2022
1 parent 0a0bb0c commit cf266e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/controller.v1/pytorch/pytorchjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (r *PyTorchJobReconciler) UpdateJobStatus(job interface{},
if rtype == kubeflowv1.PyTorchJobReplicaTypeWorker {
// TODO(gaocegege): Support SuccessPolicy
if expected == 0 {
msg := fmt.Sprintf("TFJob %s/%s successfully completed.",
msg := fmt.Sprintf("PyTorchJob %s/%s successfully completed.",
pytorchjob.Namespace, pytorchjob.Name)
r.recorder.Event(pytorchjob, corev1.EventTypeNormal, commonutil.JobSucceededReason, msg)
if jobStatus.CompletionTime == nil {
Expand All @@ -410,17 +410,17 @@ func (r *PyTorchJobReconciler) UpdateJobStatus(job interface{},
err := commonutil.UpdateJobConditions(jobStatus,
commonv1.JobSucceeded, commonutil.JobSucceededReason, msg)
if err != nil {
commonutil.LoggerForJob(pytorchjob).Infof("Append tfjob condition error: %v", err)
commonutil.LoggerForJob(pytorchjob).Infof("Append pytorchjob condition error: %v", err)
return err
}
trainingoperatorcommon.SuccessfulJobsCounterInc(pytorchjob.Namespace, kubeflowv1.PytorchJobFrameworkName)
} else if running > 0 {
// Some workers are still running, leave a running condition.
msg := fmt.Sprintf("TFJob %s/%s is running.",
msg := fmt.Sprintf("PyTorchJob %s/%s is running.",
pytorchjob.Namespace, pytorchjob.Name)
err := commonutil.UpdateJobConditions(jobStatus, commonv1.JobRunning, commonutil.JobRunningReason, msg)
if err != nil {
commonutil.LoggerForJob(pytorchjob).Infof("Append tfjob condition error: %v", err)
commonutil.LoggerForJob(pytorchjob).Infof("Append pytorchjob condition error: %v", err)
return err
}
}
Expand Down Expand Up @@ -457,7 +457,7 @@ func (r *PyTorchJobReconciler) UpdateJobStatus(job interface{},
return nil
}

// ContainsMasterSpec returns true if the tfjob contains master spec.
// ContainsMasterSpec returns true if the pytorchjob contains master spec.
func ContainsMasterSpec(replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec) bool {
if _, ok := replicas[kubeflowv1.PyTorchJobReplicaTypeMaster]; ok {
return true
Expand Down

0 comments on commit cf266e6

Please sign in to comment.