This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
simplify reconciler #166
Merged
Merged
simplify reconciler #166
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ import ( | |
// recorder or logger | ||
type ReconcilerUtilInterface interface { | ||
// GetReconcilerName SHOULD be overridden if a new Reconciler is defined. The default implementation returns | ||
// "Kubeflow Reconciler" | ||
// "common-reconciler" | ||
GetReconcilerName() string | ||
|
||
// GetRecorder CAN be overridden to customize EventRecorder | ||
|
@@ -48,7 +48,7 @@ type ReconcilerUtilInterface interface { | |
// GangSchedulingInterface defines the abstract interface for gang-scheduling related actions, such like get, create or | ||
// delete PodGroup | ||
type GangSchedulingInterface interface { | ||
// OverrideForGangSchedulingInterface MUST NOT be overridden as it reset ReconcilerUtilInterface | ||
// OverrideForGangSchedulingInterface MUST NOT be overridden as it resets ReconcilerUtilInterface | ||
OverrideForGangSchedulingInterface(ui ReconcilerUtilInterface) | ||
|
||
// GangSchedulingEnabled CAN be overridden if definition of gang-scheduling enabling changes. | ||
|
@@ -239,21 +239,3 @@ type JobInterface interface { | |
// PastActiveDeadline CAN be overridden to customize how to determine if this job has past activate deadline. | ||
PastActiveDeadline(runPolicy *commonv1.RunPolicy, jobStatus *commonv1.JobStatus) bool | ||
} | ||
|
||
// KubeflowReconcilerInterface defines the abstract interface for a base reconciler for kubeflow jobs. | ||
type KubeflowReconcilerInterface interface { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the motivation to move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When writing the test code,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it make sense to me. current testing integration between common and training-operator is a headache. |
||
JobInterface | ||
PodInterface | ||
ServiceInterface | ||
GangSchedulingInterface | ||
ReconcilerUtilInterface | ||
|
||
// OverrideForKubeflowReconcilerInterface MUST NOT be overridden as it reset ReconcilerUtilInterface, PodInterface, ServiceInterface, JobInterface, GangSchedulingInterface | ||
OverrideForKubeflowReconcilerInterface(ji JobInterface, pi PodInterface, si ServiceInterface, gi GangSchedulingInterface, ui ReconcilerUtilInterface) | ||
|
||
// Reconcile CAN be overridden to customize how to handle a request. | ||
Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) | ||
|
||
// SetupWithManager CAN be overridden to customize how to set up the reconciler with the manager. | ||
SetupWithManager(mgr ctrl.Manager, obj client.Object) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What about something like Training or TrainingJob since we are always dealing with model trainings here. Job seems very generic.
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.
TrainingJob
sounds good to me. As the common library is designed for all kinds of controllers, I would suggest renaming theGenericJob
toTrainingJob
in the pull request I mentioned above for tf-operator (kubeflow/training-operator#1398). What do you think?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