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

Extract reusable codes to common utility #1297

Merged

Conversation

Jeffwan
Copy link
Member

@Jeffwan Jeffwan commented Jul 11, 2021

This PR is part of #1299 kubeflow/common#138

It resolves "2. Extract common methods to utilities which can be shared by all operators."

In Phase I, we merge apis and controller codes into this repo. However, there're lots of duplication and similar methods. In Phase II, we are try to refactor these similar redeclared codes to make them generally usable. This PR is the first one of Phase II.

  1. Remove duplicate FakeWorkQueue in each controller
  2. Refactor OnDependentCreate/Delete handler to job independent and move to common utils
  3. Refactor SatisfiedExpectations to job independent
  4. Fix issues in PyTorch spec - Change PyTorchReplicaType to commonv1.ReplicaType
  5. Move convertServiceList,convertPodList, IsGangSchedulerSet to common utils.

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
Move ConvertPodList, ConvertServiceList to common library

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
Refactor follow methods to job independent and move to common utils
- OnDependentCreateFunc
- OnDependentDeleteFunc

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
@Jeffwan
Copy link
Member Author

Jeffwan commented Jul 11, 2021

/cc @kubeflow/wg-training-leads

@google-oss-robot google-oss-robot requested a review from a team July 11, 2021 17:31
Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
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.

/lgtm
/approve

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gaocegege, 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-robot google-oss-robot merged commit 7604da5 into kubeflow:all-in-one-operator Jul 12, 2021
Jeffwan added a commit that referenced this pull request Aug 5, 2021
* Remove duplicate FakeWorkQueue

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>

* Extract utility to common

Move ConvertPodList, ConvertServiceList to common library

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>

* Move gang scheduing setting to common

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>

* Extract OnDependentCreate/Delete handler to utils

Refactor follow methods to job independent and move to common utils
- OnDependentCreateFunc
- OnDependentDeleteFunc

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>

* Refactor SatisfiedExpectations to a common method

Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
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