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

Use the same reasons for Condition and Event #1854

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

tenzen-y
Copy link
Member

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

What this PR does / why we need it:
Currently, jobs use different reasons for Condition and Event even if the situation is the same. (JobCreated vs TFJobCreated)

For example, the JobController uses JobXXX (XXX is the reason such as Failed), and the pytorchjob-controller uses PyTorchJobXXX like this:

if err := commonutil.UpdateJobConditions(&jobStatus, apiv1.JobFailed, commonutil.JobFailedReason, failureMessage); err != nil {

if err := commonutil.UpdateJobConditions(&pytorchjob.Status, kubeflowv1.JobCreated, "PyTorchJobCreated", msg); err != nil {

So I modified the reasons for Condition and Event so that the Jobs use consistently the same reason format ${KIND}${REASON} like PyTorchJobCreated in the same situation.

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

@tenzen-y tenzen-y marked this pull request as ready for review July 9, 2023 16:03
@tenzen-y tenzen-y force-pushed the use-same-reason branch 2 times, most recently from abcd267 to 04d41e1 Compare July 9, 2023 16:05
@coveralls
Copy link

coveralls commented Jul 9, 2023

Pull Request Test Coverage Report for Build 5500774399

  • 33 of 98 (33.67%) changed or added relevant lines in 11 files are covered.
  • 12 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.05%) to 32.96%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controller.v1/tensorflow/tfjob_controller.go 9 11 81.82%
pkg/controller.v1/common/job.go 0 3 0.0%
pkg/util/status.go 0 3 0.0%
pkg/controller.v1/common/pod.go 0 4 0.0%
pkg/controller.v1/mpi/mpijob_controller.go 15 21 71.43%
pkg/controller.v1/pytorch/pytorchjob_controller.go 5 13 38.46%
pkg/controller.v1/xgboost/xgboostjob_controller.go 0 9 0.0%
pkg/controller.v1/mxnet/mxjob_controller.go 0 10 0.0%
pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go 3 13 23.08%
pkg/reconciler.v1/common/job.go 0 10 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/controller.v1/mpi/mpijob.go 3 91.06%
pkg/controller.v1/mpi/mpijob_controller.go 4 79.17%
pkg/controller.v1/common/job.go 5 6.78%
Totals Coverage Status
Change from base Build 5468257726: -0.05%
Covered Lines: 3176
Relevant Lines: 9636

💛 - Coveralls

@tenzen-y
Copy link
Member Author

tenzen-y commented Jul 9, 2023

Go Test / Test (1.25.0) (pull_request) is a flaky test: #1821

@tenzen-y
Copy link
Member Author

tenzen-y commented Jul 9, 2023

/assign @johnugeorge @terrytangyuan

@johnugeorge
Copy link
Member

Thanks Yuki
/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Jul 10, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge, tenzen-y

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 9e084ff into kubeflow:master Jul 10, 2023
@tenzen-y tenzen-y deleted the use-same-reason branch July 10, 2023 19:16
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.

4 participants