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

ignore tfjob/pytorch job if corresponding CRD not created #335

Merged
merged 5 commits into from
Jan 25, 2019
Merged

ignore tfjob/pytorch job if corresponding CRD not created #335

merged 5 commits into from
Jan 25, 2019

Conversation

hougangliu
Copy link
Member

@hougangliu hougangliu commented Jan 22, 2019

As a short-term solution
Fixes: #317


This change is Reviewable

@hougangliu
Copy link
Member Author

/assign @richardsliu @YujiOshima

@hougangliu
Copy link
Member Author

/assign @johnugeorge

@richardsliu
Copy link
Contributor

@johnugeorge Do we still need this fix based on what we discussed today?

func validateWorkerResource(wkind string) error {
for _, crd := range invalidCRDResources {
if crd == wkind {
return fmt.Errorf("Cannot support %s; If CRD for it installed, please restart studyjob-controller to take effect", wkind)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe specifically say "Please install the CRD and restart studyjob-controller"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! updated

@@ -117,7 +121,8 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
OwnerType: &katibv1alpha1.StudyJob{},
})
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

invalidCRDResources should be updated only when CRD is not installed. We should explicitly check whether CRD exists or not. If watch fails for any other reason(even when CRD is installed), controller should fail by raising error.

You can use crd clientset to check.
https://github.com/kubeflow/tf-operator/blob/master/cmd/tf-operator.v1beta1/app/server.go#L192

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I will handle it

return nil
}

func ignoreWatchError(err error, job string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

The name of the function is a little confusing. Maybe change it to "isFatalWatchError" and return the opposite boolean values?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Done!

@richardsliu
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richardsliu

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 f4026e4 into kubeflow:master Jan 25, 2019
@hougangliu hougangliu deleted the ignore-nonexist-crd branch January 25, 2019 03:10
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

5 participants