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

Fix a bug that XGBoostJob's running condition isn't updated when the job is resumed #1866

Merged

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented Jul 21, 2023

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:

  • Docs included if any changes are user facing

commonutil "github.com/kubeflow/training-operator/pkg/util"
)

func setRunningCondition(logger *logrus.Entry, jobName string, jobStatus *kubeflowv1.JobStatus) error {
Copy link
Member Author

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.

@coveralls
Copy link

coveralls commented Jul 21, 2023

Pull Request Test Coverage Report for Build 5622818786

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 16 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+2.9%) to 36.543%

Files with Coverage Reduction New Missed Lines %
pkg/controller.v1/xgboost/xgboostjob_controller.go 16 57.61%
Totals Coverage Status
Change from base Build 5619754531: 2.9%
Covered Lines: 3571
Relevant Lines: 9772

💛 - Coveralls

Comment on lines +334 to +357
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))
Copy link
Member Author

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.

@tenzen-y tenzen-y force-pushed the implement-supend-test-for-xgboostjob branch 2 times, most recently from 547a2fa to 533d7be Compare July 21, 2023 13:03
…job is resumed

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
@tenzen-y tenzen-y force-pushed the implement-supend-test-for-xgboostjob branch from 533d7be to b2fe124 Compare July 21, 2023 13:22
@tenzen-y
Copy link
Member Author

/assign @terrytangyuan @johnugeorge

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Jul 21, 2023
@tenzen-y
Copy link
Member Author

@terrytangyuan Thanks for the review. Could you give approve to this PR?

@terrytangyuan
Copy link
Member

/approve

@google-oss-prow
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 7a592ec into kubeflow:master Jul 21, 2023
25 checks passed
@tenzen-y tenzen-y deleted the implement-supend-test-for-xgboostjob branch July 21, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants