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

update persistent agence to only store the argo spec #1634

Merged
merged 6 commits into from
Jul 22, 2019
Merged

Conversation

IronPan
Copy link
Member

@IronPan IronPan commented Jul 17, 2019

Currently when persisting the runs spawned from a job, PersistentAgent stores more information than needed into the pipeline manifest, and also miss the TypeMetadata. This resulted in storing lots of runtime information that's not needed.

Example WorkflowSpec

   "metadata":{
      "name":"fffpw4fh-2-2911767673",
      "namespace":"kubeflow",
      "selfLink":"/apis/argoproj.io/v1alpha1/namespaces/kubeflow/workflows/fffpw4fh-2-2911767673",
      "uid":"de23bd5c-a8c1-11e9-a176-42010a800233",
      "resourceVersion":"3975687",
      "generation":1,
      "creationTimestamp":"2019-07-17T18:37:02Z",
      "labels":{
         "scheduledworkflows.kubeflow.org/isOwnedByScheduledWorkflow":"true",
         "scheduledworkflows.kubeflow.org/scheduledWorkflowName":"fffpw4fh",
         "scheduledworkflows.kubeflow.org/workflowEpoch":"1563388612",
         "scheduledworkflows.kubeflow.org/workflowIndex":"2",
         "workflows.argoproj.io/phase":"Running"
      },
      "ownerReferences":[
         {
            "apiVersion":"kubeflow.org/v1beta1",
            "kind":"ScheduledWorkflow",
            "name":"fffpw4fh",
            "uid":"91039a28-a8c1-11e9-a176-42010a800233",
            "controller":true,
            "blockOwnerDeletion":true
         }
      ]
   },

This change is Reviewable

Currently when persisting the runs spawned from a job, PersistentAgent stores more information than needed into the pipeline manifest, and also miss the TypeMetadata. This resulted in storing lots of runtime information that's not needed.

Example WorkflowSpec
```
   "metadata":{
      "name":"fffpw4fh-2-2911767673",
      "namespace":"kubeflow",
      "selfLink":"/apis/argoproj.io/v1alpha1/namespaces/kubeflow/workflows/fffpw4fh-2-2911767673",
      "uid":"de23bd5c-a8c1-11e9-a176-42010a800233",
      "resourceVersion":"3975687",
      "generation":1,
      "creationTimestamp":"2019-07-17T18:37:02Z",
      "labels":{
         "scheduledworkflows.kubeflow.org/isOwnedByScheduledWorkflow":"true",
         "scheduledworkflows.kubeflow.org/scheduledWorkflowName":"fffpw4fh",
         "scheduledworkflows.kubeflow.org/workflowEpoch":"1563388612",
         "scheduledworkflows.kubeflow.org/workflowIndex":"2",
         "workflows.argoproj.io/phase":"Running"
      },
      "ownerReferences":[
         {
            "apiVersion":"kubeflow.org/v1beta1",
            "kind":"ScheduledWorkflow",
            "name":"fffpw4fh",
            "uid":"91039a28-a8c1-11e9-a176-42010a800233",
            "controller":true,
            "blockOwnerDeletion":true
         }
      ]
   },
```
@IronPan
Copy link
Member Author

IronPan commented Jul 17, 2019

/assign @rileyjbauer

@@ -162,9 +162,11 @@ func (w *Workflow) HasScheduledWorkflowAsParent() bool {
}

func (w *Workflow) GetSpec() *Workflow {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rename this function as well, since it's returning the whole workflow, not just the spec

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. hopefully getworkflowspec can reduce the confusion.

spec := w.DeepCopy()
spec.Status = workflowapi.WorkflowStatus{}
return NewWorkflow(spec)
func (w *Workflow) GetWorkflowSpec() *Workflow {
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to update the references to this in resource_manager.go and resource_manager_test.go

@rileyjbauer
Copy link
Contributor

Thanks for this!
/lgtm

@IronPan
Copy link
Member Author

IronPan commented Jul 22, 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 IronPan merged commit d2ead9e into master Jul 22, 2019
@IronPan IronPan deleted the IronPan-patch-1 branch July 31, 2019 06:28
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.

3 participants