Skip to content

Commit

Permalink
Implement suspend semantics to MXJob
Browse files Browse the repository at this point in the history
  • Loading branch information
tenzen-y committed Jul 9, 2023
1 parent 5477410 commit 6c8d1ff
Show file tree
Hide file tree
Showing 4 changed files with 422 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pkg/controller.v1/mxnet/mxjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/kubeflow/training-operator/pkg/controller.v1/control"
"github.com/kubeflow/training-operator/pkg/controller.v1/expectation"
commonutil "github.com/kubeflow/training-operator/pkg/util"
trainutil "github.com/kubeflow/training-operator/pkg/util/train"

"github.com/go-logr/logr"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -351,7 +352,7 @@ func (r *MXJobReconciler) UpdateJobStatus(job interface{}, replicas map[kubeflow
return err
}

if jobStatus.StartTime == nil {
if !trainutil.IsJobSuspended(&mxjob.Spec.RunPolicy) && jobStatus.StartTime == nil {
now := metav1.Now()
jobStatus.StartTime = &now
// enqueue a sync to check if job past ActiveDeadlineSeconds
Expand Down
Loading

0 comments on commit 6c8d1ff

Please sign in to comment.