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 api reader issue #1551

Merged
merged 1 commit into from
Mar 21, 2022
Merged

fix api reader issue #1551

merged 1 commit into from
Mar 21, 2022

Conversation

zw0610
Copy link
Member

@zw0610 zw0610 commented Mar 18, 2022

What this PR does / why we need it:

Function GetJobFromAPIClient is used to get the kubeflow Job from APIServer directly without cache. However, the contemporary implementation is hard to understand and will panic when CacheReader is called: https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/client/split.go#L130

The Manager in controller-runtime offers APIReader which does the work to get job from APIServer.

This PR changes how GetJobFromAPIClient to get job from APIServer by adding APIReader to Reconcilers.

@zw0610
Copy link
Member Author

zw0610 commented Mar 18, 2022

/hold for more comment

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2003571271

  • 15 of 30 (50.0%) changed or added relevant lines in 5 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 36.921%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controller.v1/mpi/mpijob_controller.go 5 6 83.33%
pkg/controller.v1/pytorch/pytorchjob_controller.go 5 6 83.33%
pkg/controller.v1/tensorflow/tfjob_controller.go 5 6 83.33%
pkg/controller.v1/mxnet/mxjob_controller.go 0 6 0.0%
pkg/controller.v1/xgboost/xgboostjob_controller.go 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/controller.v1/mpi/mpijob_controller.go 2 75.35%
Totals Coverage Status
Change from base Build 1996927612: 0.1%
Covered Lines: 2278
Relevant Lines: 6170

💛 - Coveralls

@cheimu
Copy link
Member

cheimu commented Mar 20, 2022

That's awesome! After this pr is merged, the MPIJob panic bug when GetJobFromAPIClient could be solved!

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
/approve

Copy link
Member

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

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

Reuse APIReader from manager makes more sense.

/lgtm

Copy link
Member

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

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

/lgtm

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gaocegege, Jeffwan, terrytangyuan, zw0610

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:
  • OWNERS [Jeffwan,gaocegege,terrytangyuan,zw0610]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zw0610
Copy link
Member Author

zw0610 commented Mar 21, 2022

/unhold

@google-oss-prow google-oss-prow bot merged commit c97a98d into kubeflow:master Mar 21, 2022
@zw0610 zw0610 deleted the apireader branch June 20, 2022 04:41
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.

6 participants