-
Notifications
You must be signed in to change notification settings - Fork 700
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 cleanpod policy for v1alpha2 #691
Conversation
Signed-off-by: Ce Gao <gaoce@caicloud.io>
Signed-off-by: Ce Gao <gaoce@caicloud.io>
Signed-off-by: Ce Gao <gaoce@caicloud.io>
@gaocegege: GitHub didn't allow me to request PR reviews from the following users: yph152. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
Signed-off-by: Ce Gao <gaoce@caicloud.io>
Signed-off-by: Ce Gao <gaoce@caicloud.io>
Travis tests have failedHey @gaocegege, 2nd Buildgometalinter --config=linter_config.json --vendor ./...
3rd Buildgometalinter --config=linter_config.json --vendor ./...
|
@@ -70,6 +75,16 @@ type TFReplicaSpec struct { | |||
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` | |||
} | |||
|
|||
// CleanPodPolicy describes how to deal with pods when the TFJob is finished. |
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.
TFJob is finished that include succeeded and failed ?
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.
Yeah, restarting is the internal state, thus succeeded and failed are the states to indicate that the TFJob is terminated.
/assign @jlewi |
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.
Thanks for the quick fix!
@@ -88,9 +88,19 @@ func setTypeNameToCamelCase(tfJob *TFJob, typ TFReplicaType) { | |||
|
|||
// SetDefaults_TFJob sets any unspecified values to defaults. | |||
func SetDefaults_TFJob(tfjob *TFJob) { | |||
// Set default cleanpod policy to All. | |||
if tfjob.Spec.CleanPodPolicy == 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.
I think a more sensible default would be to only delete running pods. That seems like the most useful policy because it preserves logs and doesn't consume resources.
Its also consistent with behavior of K8s job.
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.
Then we will delete ps and keep workers, make sense to me. But maybe look weird. I will implement it now.
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.
Thanks. I agree its weird but the logs of the workers and the chief are probably what you care about anyway and this way users will have logs available by default.
Signed-off-by: Ce Gao <gaoce@caicloud.io>
PTAL @jlewi |
Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jlewi 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 |
/test all |
/retest |
* *: Support cleanpod policy Signed-off-by: Ce Gao <gaoce@caicloud.io> * Gopkg: Keep code-generator Signed-off-by: Ce Gao <gaoce@caicloud.io> * vendor: Update Signed-off-by: Ce Gao <gaoce@caicloud.io> * test: Fix test cases Signed-off-by: Ce Gao <gaoce@caicloud.io> * test: Fix Signed-off-by: Ce Gao <gaoce@caicloud.io> * test: Fix style Signed-off-by: Ce Gao <gaoce@caicloud.io> * defaults: Update Signed-off-by: Ce Gao <gaoce@caicloud.io>
/cc @yph152 @jlewi
This change is