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

Add terminationPolicy to TfJobSpec #204

Merged
merged 10 commits into from
Dec 11, 2017
Merged

Add terminationPolicy to TfJobSpec #204

merged 10 commits into from
Dec 11, 2017

Conversation

lluunn
Copy link
Contributor

@lluunn lluunn commented Dec 8, 2017

For this issue

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@k8s-ci-robot
Copy link

Hi @lluunn. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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.

@@ -240,6 +253,14 @@ func (c *TfJobSpec) SetDefaults() error {
r.setDefaultPSPodTemplateSpec(c.TfImage)
}
}
if c.TerminationPolicy == nil {
c.TerminationPolicy = &TerminationPolicySpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you setting the default policy here and not in
https://github.com/tensorflow/k8s/blob/master/pkg/spec/tf_job.go#L215?

In validate can we check that termination policy is a valid policy? So right now the only valid policy should be MASTER, index=0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in the SetDefaults(), I guess you thought it's in Validate because the code collapsed.

Added validation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks.
Resolved.

Copy link
Contributor Author

@lluunn lluunn left a comment

Choose a reason for hiding this comment

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

Thanks

@@ -240,6 +253,14 @@ func (c *TfJobSpec) SetDefaults() error {
r.setDefaultPSPodTemplateSpec(c.TfImage)
}
}
if c.TerminationPolicy == nil {
c.TerminationPolicy = &TerminationPolicySpec{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in the SetDefaults(), I guess you thought it's in Validate because the code collapsed.

Added validation.

@@ -240,6 +253,14 @@ func (c *TfJobSpec) SetDefaults() error {
r.setDefaultPSPodTemplateSpec(c.TfImage)
}
}
if c.TerminationPolicy == nil {
c.TerminationPolicy = &TerminationPolicySpec{
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks.
Resolved.

return errors.New("invalid termination policy, Chief cannot be nil")
}
if c.TerminationPolicy.Chief.ReplicaName != "MASTER" || c.TerminationPolicy.Chief.ReplicaIndex != 0 {
return errors.New("invaliad termination policy, Chief should be MASTER:0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Spelling mistake "invaliad" -> "invalid". Also make the error message more explicit e.g.
"Chief should have replicaName=MASTER and index=0".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Thanks,

@jlewi
Copy link
Contributor

jlewi commented Dec 10, 2017

I approved it but please fix the minor issue with the error message.

@jlewi
Copy link
Contributor

jlewi commented Dec 10, 2017

/ok-to-test

@jlewi jlewi merged commit 08ec97f into kubeflow:master Dec 11, 2017
@DjangoPeng
Copy link
Member

@jlewi We have MASTER in tfReplicaType field, while this PR add chiefSpec. I have a slight question: what is the difference between MASTER and chief worker? If they are the same, can we reuse MASTER?

@jlewi
Copy link
Contributor

jlewi commented Dec 12, 2017

@DjangoPeng TensorFlow uses chief so we want to start changing the terminology to be more consistent with what TF uses. MASTER is confusing because every TF replica has a gRPC server called the master that the client talks to.

@DjangoPeng
Copy link
Member

@jlewi Yep. That's what I'm confusing before. In the TensorFlow level, session would create a gRPC client to connect with the gRPC server named MASTER. But chief is the official and exact name of worker#0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants