-
Notifications
You must be signed in to change notification settings - Fork 698
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
Shared implementation of operator code #773
Conversation
/cc @jlewi /cc @gaocegege |
@johnugeorge: GitHub didn't allow me to request PR reviews from the following users: /cc. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -115,6 +133,75 @@ type JobController struct { | |||
Recorder record.EventRecorder | |||
} | |||
|
|||
func NewJobController( |
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.
The name may conflicts users since Kubernetes has a job controller
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.
How about TrainingJobController or BaseController
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.
Since it is package scoped, is it a problem? I initially thought of putting just "Controller" as the package name. But I felt that it will be confusing as we already have a "Controller" package for v1alpha1.
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.
The new contributors will be confused, maybe. While it is not a big problem, just a nit.
@@ -75,7 +67,7 @@ var ( | |||
// TFJobController is the type for TFJob Controller, which manages | |||
// the lifecycle of TFJobs. | |||
type TFJobController struct { | |||
jobcontroller.JobController | |||
*jobcontroller.JobController |
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.
I am not sure why using pointer here, could you please explain more about it?
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.
No modification. Hence not necessary. I will update it.
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
Generally LGTM 😄 |
/lgtm Waiting for @jlewi 's review |
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.
LGTM after nits. Thanks!
// AdoptFunc used byControlRefManager to get the latest object if UID matches | ||
AdoptFunc(job metav1.Object) func() (metav1.Object, error) | ||
// Returns the Controller name | ||
GetControllerName() string |
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.
nit: I prefer ControllerName()
, GetXxx() is Java style :)
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.
I was thinking the same. But I left it because many interfaces in kubernetes haven't followed it.
https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/v1/meta.go#L33
WDYT?
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.
SGTM.
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.
@ScorpioCPH Added the changes
// orphan. | ||
// for _, tfjob := range tc.getPodJobs(pod) { | ||
// tc.enqueueTFJob(tfjob) | ||
// } |
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.
Why do we need these commented out code?
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.
I will remove them
/lgtm |
/retest |
1 similar comment
/retest |
cluster creation is timing out |
@jlewi Is this a transient issue? |
/retest |
Error log:
|
/retest |
/cc @jlewi |
/assign @ankushagarwal Can you review please? |
/retest |
It's cool |
@jlewi Do you want to review the PR? If not I think we can merge it. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gaocegege, jlewi 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 |
This is a continuation of TF refactoring PR #767
This change is