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

fix: Revert node creation logic #1818

Merged
merged 6 commits into from
Jan 2, 2020

Conversation

simster7
Copy link
Member

@simster7 simster7 commented Dec 5, 2019

Revert node creation back to execute* methods (as it was before #1552). The code flow should be the same as it is now, however this change allows individual execute* methods to control returning after a node is created once.

In particular, execute{Container, Script, Resource} now return after a node has already been created in order to avoid calling createWorkflowPod more than once. This should fix #1720.

@dtaniwaki Since this code is mostly from your changes please review.

pkg/apis/workflow/v1alpha1/workflow_types.go Outdated Show resolved Hide resolved
workflow/controller/operator.go Outdated Show resolved Hide resolved
Copy link
Member Author

@simster7 simster7 left a comment

Choose a reason for hiding this comment

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

Thanks @dtaniwaki, I readded TemplateScope. Do you have any comments regarding the rest of the implementation? Is there a reason as to why you moved node creation before execute* that I should be aware of?

Copy link
Member

@dtaniwaki dtaniwaki left a comment

Choose a reason for hiding this comment

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

@simster7 Thank you for fixing the problem. The reason why I moved the initialization code to executeTemplate is that I didn't want to pass orgTmpl to each concrete executions and wanted to make sure a given node exists in the concrete execution. However, I now realized the behavior of some of the concrete execution is different from the others as you fixed here.
Is it possible to make some unit tests to avoid future regressions? If it's too hard, we can make it in a future task.

workflow/controller/workflowpod_test.go Show resolved Hide resolved
@simster7
Copy link
Member Author

Will wait for #1836 to be merged before merging this

@dtaniwaki
Copy link
Member

dtaniwaki commented Dec 13, 2019

@simster7 Could you use a concrete template over & wfv1.Template{} for other test cases you modified?

@benabineri
Copy link

It would be great to get this moving again if possible so we can upgrade without hitting our resource limits! Thanks :)

@simster7
Copy link
Member Author

simster7 commented Jan 2, 2020

@benabineri We're planning on releasing this on v2.5, the pre-release for that should be January 15th. It'll be done by then :)

@alexec alexec added this to the v2.5 milestone Jan 2, 2020
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

Conditional approval - please check that this is covered by some tests?

@simster7 simster7 changed the title Revert node creation logic fix: Revert node creation logic Jan 2, 2020
@codecov
Copy link

codecov bot commented Jan 2, 2020

Codecov Report

Merging #1818 into master will increase coverage by <.01%.
The diff coverage is 69.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1818      +/-   ##
==========================================
+ Coverage   11.14%   11.15%   +<.01%     
==========================================
  Files          35       35              
  Lines       23536    23537       +1     
==========================================
+ Hits         2624     2625       +1     
+ Misses      20576    20575       -1     
- Partials      336      337       +1
Impacted Files Coverage Δ
workflow/controller/steps.go 59.83% <60%> (+0.33%) ⬆️
workflow/controller/operator.go 56.29% <68.57%> (-0.11%) ⬇️
workflow/controller/dag.go 51.12% <87.5%> (+0.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 160a794...8de2384. Read the comment docs.

@simster7 simster7 merged commit 6526b6c into argoproj:master Jan 2, 2020
func (woc *wfOperationCtx) executeDAG(nodeName string, tmplCtx *templateresolution.Context, templateScope string, tmpl *wfv1.Template, orgTmpl wfv1.TemplateHolder, boundaryID string) (*wfv1.NodeStatus, error) {
node := woc.getNodeByName(nodeName)
if node == nil {
node = woc.initializeExecutableNode(nodeName, wfv1.NodeTypeSteps, templateScope, tmpl, orgTmpl, boundaryID, wfv1.NodeRunning)
Copy link
Member

Choose a reason for hiding this comment

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

The node type is not correct here.
I fixed it in this commit.
396faa0

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.

Workflow controller repeatedly attempts to create pods that already exist
4 participants