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

Argo workflow GC #5

Closed
rushtehrani opened this issue Nov 20, 2019 · 1 comment
Closed

Argo workflow GC #5

rushtehrani opened this issue Nov 20, 2019 · 1 comment
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@rushtehrani
Copy link
Contributor

rushtehrani commented Nov 20, 2019

Argo workflows should be cleaned up after completion and their logs and data archived.

The steps to make this work:

  1. Setup S3 or equivalent store for Artifacts, see this doc
  2. Set archiveLogs: true under this line. See configmap, also see feat!(logging): Always archive logs if in config. Closes #1790 argoproj/argo-workflows#1860 that fixes an issue with this flag.
  3. Set Garbage collection in workflow. See this issue regarding setting global defaults for workflows.
@rushtehrani rushtehrani added the kind/enhancement New feature or request label Nov 20, 2019
@rushtehrani rushtehrani added this to the v0.1 milestone Nov 20, 2019
@rushtehrani rushtehrani mentioned this issue Jan 9, 2020
@rushtehrani
Copy link
Contributor Author

rushtehrani commented Jan 10, 2020

For 3, we'll have to inject the strategy here, this should be passed in as an option with the strategy potentially being read from an env var, example diff:

@@ -17,6 +17,8 @@ type Workflow = wfv1.Workflow
 
 type WorkflowParameter = wfv1.Parameter
 
+type PodGCStrategy = wfv1.PodGCStrategy
+
 type WorkflowOptions struct {
        Name           string
        GeneratedName  string
@@ -25,6 +27,7 @@ type WorkflowOptions struct {
        ServiceAccount string
        Labels         *map[string]string
        ListOptions    *ListOptions
+       PodGCStrategy  *PodGCStrategy
 }
 
 func unmarshalWorkflows(wfBytes []byte, strict bool) (wfs []Workflow, err error) {
@@ -81,6 +84,11 @@ func (c *Client) create(namespace string, wf *Workflow, opts *WorkflowOptions) (
        if opts.Labels != nil {
                wf.ObjectMeta.Labels = *opts.Labels
        }
+       if wf.Spec.PodGC != nil {
+               wf.Spec.PodGC = &wfv1.PodGC{
+                       Strategy: *opts.PodGCStrategy,
+               }
+       }
 
        createdWorkflow, err = c.ArgoprojV1alpha1().Workflows(namespace).Create(wf)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants