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

Custom CRD: Set dynamic watch from controller flags #1302

Conversation

andreyvelich
Copy link
Member

Related: #1214.

I added possibility to set trial controller watchers from controller flags.
In controller deployment flags should be in format Kind.version.group.

For example:

args:
  - "-trial-resource=TFJob.v1.kubeflow.org".
  - "-trial-resource=Workflow.v1alpha1.argoproj.io"
  - "-trial-resource=Job.v1.batch"

/assign @gaocegege @sperlingxx @johnugeorge

@kubeflow-bot
Copy link

This change is Reviewable

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

Copy link
Member

@sperlingxx sperlingxx left a comment

Choose a reason for hiding this comment

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

Shall we check whether there exists any overlap between dynamic GVKs and GVKs of SupportedJobList?

@andreyvelich
Copy link
Member Author

Shall we check whether there exists any overlap between dynamic GVKs and GVKs of SupportedJobList?

I think after complete custom CRD implementation we can remove SupportedJobList and by default add few trial-resources in Katib controller deployment for testing/examples.
What do you think @sperlingxx @gaocegege @johnugeorge ?

@sperlingxx
Copy link
Member

sperlingxx commented Aug 20, 2020

Shall we check whether there exists any overlap between dynamic GVKs and GVKs of SupportedJobList?

I think after complete custom CRD implementation we can remove SupportedJobList and by default add few trial-resources in Katib controller deployment for testing/examples.
What do you think @sperlingxx @gaocegege @johnugeorge ?

Maybe we can keep SupportedJobList as a legacy and make current custom CRD implementation as default approach to watch and renconcile in trial level? In this way, old-fashioned SupportedJobList could also be supported as a non-default option. In short, trial-controller will either watch SupportedJobList or custom CRDs, and the later one is default option.

@gaocegege
Copy link
Member

Maybe we can keep SupportedJobList as a legacy and make current custom CRD implementation as default approach to watch and renconcile in trial level? In this way, old-fashioned SupportedJobList could also be supported as a non-default option. In short, trial-controller will either watch SupportedJobList or custom CRDs, and the later one is default option.

SGTM

@andreyvelich
Copy link
Member Author

@sperlingxx Do you mean left SupportedJobList to not specify additional parameters in Trial template for default jobs (e.g. PrimaryPodLabel, PrimaryContainerName, SucceededCondition) ?
Do we have any other cases when SupportedJobList is useful ?

After implementation, Job provider can be used only for custom MutateJob function as we discussed here: #1273 (comment), other functions can be omitted.

@sperlingxx
Copy link
Member

@sperlingxx Do you mean left SupportedJobList to not specify additional parameters in Trial template for default jobs (e.g. PrimaryPodLabel, PrimaryContainerName, SucceededCondition) ?
Do we have any other cases when SupportedJobList is useful ?

After implementation, Job provider can be used only for custom MutateJob function as we discussed here: #1273 (comment), other functions can be omitted.

Yes, I supppose, due to MutateJob function, we should keep the whole stack of SupportedJobList?

@andreyvelich
Copy link
Member Author

@sperlingxx For MutateJob we don't actually need SupportedJobList.
I think for custom MutateJob function you can just check the Kind of unstructured Job and make some changes if it is needed.
What do you think ?

@sperlingxx
Copy link
Member

@sperlingxx For MutateJob we don't actually need SupportedJobList.
I think for custom MutateJob function you can just check the Kind of unstructured Job and make some changes if it is needed.
What do you think ?

Sry for slow reply. But @andreyvelich how do we know which MutateJob function need to be invoked given an unstructured Job ?

@andreyvelich
Copy link
Member Author

@sperlingxx We invoke MutateJob with desiredJob object and we can get Kind of it.
Can we refactor Provider to have MutateJob per Kind?
In that case, users can re-use provider interface to define their own MutateJob function.
I believe all other functionality to handle Trial can be done without Provider.

@sperlingxx
Copy link
Member

@sperlingxx We invoke MutateJob with desiredJob object and we can get Kind of it.
Can we refactor Provider to have MutateJob per Kind?
In that case, users can re-use provider interface to define their own MutateJob function.
I believe all other functionality to handle Trial can be done without Provider.

SGTM

@andreyvelich andreyvelich force-pushed the issue-1214-dynamic-controller-watch branch from 96acaea to 289c655 Compare September 1, 2020 13:12
@k8s-ci-robot k8s-ci-robot removed the lgtm label Sep 1, 2020
@andreyvelich
Copy link
Member Author

@gaocegege @johnugeorge @sperlingxx The test passed, can you approve it again, please?

@johnugeorge
Copy link
Member

After this change, Is supportedJobList required?

@johnugeorge
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge

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

@k8s-ci-robot k8s-ci-robot merged commit ef6557a into kubeflow:master Sep 2, 2020
@andreyvelich andreyvelich deleted the issue-1214-dynamic-controller-watch branch October 3, 2021 00: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