-
Notifications
You must be signed in to change notification settings - Fork 706
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
Fix a bug that XGBoostJob's running condition isn't updated when the job is resumed #1866
Fix a bug that XGBoostJob's running condition isn't updated when the job is resumed #1866
Conversation
commonutil "github.com/kubeflow/training-operator/pkg/util" | ||
) | ||
|
||
func setRunningCondition(logger *logrus.Entry, jobName string, jobStatus *kubeflowv1.JobStatus) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't need since we can do the same process using the commonutil.UpdateJobConditions
.
Pull Request Test Coverage Report for Build 5622818786
💛 - Coveralls |
By("Checking if the XGBoostJob has resumed conditions") | ||
Eventually(func() []kubeflowv1.JobCondition { | ||
Expect(testK8sClient.Get(ctx, jobKey, created)).Should(Succeed()) | ||
return created.Status.Conditions | ||
}, testutil.Timeout, testutil.Interval).Should(BeComparableTo([]kubeflowv1.JobCondition{ | ||
{ | ||
Type: kubeflowv1.JobCreated, | ||
Status: corev1.ConditionTrue, | ||
Reason: commonutil.NewReason(kubeflowv1.XGBoostJobKind, commonutil.JobCreatedReason), | ||
Message: fmt.Sprintf("XGBoostJob %s is created.", name), | ||
}, | ||
{ | ||
Type: kubeflowv1.JobSuspended, | ||
Reason: commonutil.NewReason(kubeflowv1.XGBoostJobKind, commonutil.JobResumedReason), | ||
Message: fmt.Sprintf("XGBoostJob %s is resumed.", name), | ||
Status: corev1.ConditionFalse, | ||
}, | ||
{ | ||
Type: kubeflowv1.JobRunning, | ||
Status: corev1.ConditionTrue, | ||
Reason: commonutil.NewReason(kubeflowv1.XGBoostJobKind, commonutil.JobRunningReason), | ||
Message: fmt.Sprintf("XGBoostJob %s is running.", name), | ||
}, | ||
}, testutil.IgnoreJobConditionsTimes)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before applying this PR fixing, this case failed.
547a2fa
to
533d7be
Compare
…job is resumed Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
533d7be
to
b2fe124
Compare
/assign @terrytangyuan @johnugeorge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm
@terrytangyuan Thanks for the review. Could you give |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tenzen-y, terrytangyuan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
I fixed a bug that XGBoostJob's running condition isn't updated when the job is resumed.
Also, I implemented integration test for XGBoostJob related to suspend semantics.
follow-up: #1859
Which issue(s) this PR fixes (optional, in
Fixes #<issue number>, #<issue number>, ...
format, will close the issue(s) when PR gets merged):Fixes #
Checklist: