-
Notifications
You must be signed in to change notification settings - Fork 143
fix(job_test) test case should not include worker service #231
Conversation
Hi @leileiwan. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @richardsliu |
/ok-to-test |
can you do a rebase? |
Generate Kubeflow PyTorchJob SDK (kubeflow#227)
@@ -200,7 +201,9 @@ func (f *FakeServiceControl) CreateServicesWithControllerRef(namespace string, s | |||
func (f *FakeServiceControl) DeleteService(namespace string, serviceID string, object runtime.Object) error { | |||
f.Lock() | |||
defer f.Unlock() | |||
f.DeleteServiceName = append(f.DeleteServiceName, serviceID) | |||
if strings.Contains(serviceID, "master"){ |
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.
It's a little hack. I am wondering if we need 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.
Because function "deletePodsAndServices" will delete all the services of pod, so if we don not change the function "deletePodsAndServices"(only delete the master service), maybe it's difficult to pass the test case without change the function DeleteService(FakeServiceControl)
func (pc *PyTorchController) deletePodsAndServices(job *pyv1.PyTorchJob, pods []*v1.Pod) error {
if len(pods) == 0 {
return nil
}
// Delete nothing when the cleanPodPolicy is None or Running.
if *job.Spec.CleanPodPolicy == common.CleanPodPolicyNone ||
*job.Spec.CleanPodPolicy == common.CleanPodPolicyRunning {
return nil
}
for _, pod := range pods {
if err := pc.PodControl.DeletePod(pod.Namespace, pod.Name, job); err != nil {
return err
}
// Pod and service have the same name, thus the service could be deleted using pod's name.
if err := pc.ServiceControl.DeleteService(pod.Namespace, pod.Name, job); err != nil {
return err
}
}
return nil
}
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.
Gotcha. SGTM. I think it is a potential issue in our code base. We can have another PR to avoid deleting unexisting worker services.
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.
yes, it will be better to avoid deleting unexisting worker services.
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.
Can you take this cleanup in a separate PR?
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.
@leileiwan can you create an issue to track this
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.
@johnugeorge ,ok
/lgtm Thanks for your contribution! 🎉 👍 Waiting for johnu's approval. |
Thanks for your contribution. |
[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 |
fix(job_test) test case should not include worker service (kubeflow#231)
hi,
the code fix the issue #228