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

Garbage collect the completed workflow after persisted to database #1802

Merged
merged 11 commits into from
Aug 13, 2019

Conversation

IronPan
Copy link
Member

@IronPan IronPan commented Aug 10, 2019

fix #1706
with this change this issue seems no longer relevent #1708


This change is Reviewable

@IronPan
Copy link
Member Author

IronPan commented Aug 10, 2019

/assign @hongye-sun

@IronPan
Copy link
Member Author

IronPan commented Aug 11, 2019

/test kubeflow-pipeline-e2e-test

@@ -122,4 +124,5 @@ func init() {
flag.StringVar(&mlPipelineAPIServerBasePath, mlPipelineAPIServerBasePathFlagName,
"/apis/v1beta1", "The base path for the ML pipeline API server.")
flag.StringVar(&namespace, namespaceFlagName, "", "The namespace name used for Kubernetes informers to obtain the listers.")
flag.Int64Var(&ttlSecondsAfterWorkflowFinish, ttlSecondsAfterWorkflowFinishFlagName, 3600, "The TTL for Argo workflow to persist after workflow finish.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we should make it to longer like 7 days to not cause surprise to existing users?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@IronPan
Copy link
Member Author

IronPan commented Aug 12, 2019

/test kubeflow-pipeline-e2e-test


// IsInFinalState whether the workflow is in a final state.
func (w *Workflow) IsInFinalState() bool {
if w.Status.Phase == workflowapi.NodeSucceeded || w.Status.Phase == workflowapi.NodeFailed {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you also need add Skip state here.

Copy link
Contributor

Choose a reason for hiding this comment

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

And Error state

Copy link
Member Author

Choose a reason for hiding this comment

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

discussed offline for now we only treat succeeded or failed workflow as final.

if _, ok :=w.GetLabels()[LabelKeyWorkflowPersistedFinalState]; ok {
// If the label exist, workflow final state has being persisted.
return true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
_, ok = w.GetLabels()[LabelKeyWorkflowPersistedFinalState]
return ok

@hongye-sun
Copy link
Contributor

/lgtm

@IronPan
Copy link
Member Author

IronPan commented Aug 13, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: IronPan

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

@IronPan
Copy link
Member Author

IronPan commented Aug 13, 2019

Verified the travis tests passed. only coverall failed.

@IronPan IronPan merged commit 6189681 into kubeflow:master Aug 13, 2019
@PhoenixLuo2
Copy link

execuse, i use 0.6.2 branch persistent agent image, Garbage collection funtion works immediately, it will not wait 7 days. so is I lacking any config ?

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.

Stop persisting completed/failed workflow
4 participants