Skip to content

Commit

Permalink
fix(backend): pass correct ParentDagID to iterator DAG
Browse files Browse the repository at this point in the history
- Passthrough ParentDagID rather than DriverExecutionID to iterator such
  that iteration item correctly detects dependentTasks.
- Remove depends from iterator DAG as it is already handled by
  root-level task
- Update Iterator template names/nomenclature for clarity
- Update tests accordingly

Signed-off-by: Giulio Frasca <[email protected]>
  • Loading branch information
gmfrasca committed Sep 6, 2024
1 parent 3a2ab90 commit 19d9198
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 99 deletions.
13 changes: 6 additions & 7 deletions backend/src/v2/compiler/argocompiler/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,9 @@ func (c *workflowCompiler) iteratorTask(name string, task *pipelinespec.Pipeline
// Set up Loop Control Template
loopDriverArgoName := name + "-loop-driver"
loopDriverInputs := dagDriverInputs{
component: componentSpecPlaceholder,
parentDagID: parentDagID,
task: taskJson, // TODO(Bobgy): avoid duplicating task JSON twice in the template.
iterationIndex: "0",
component: componentSpecPlaceholder,
parentDagID: parentDagID,
task: taskJson, // TODO(Bobgy): avoid duplicating task JSON twice in the template.
}
loopDriver, loopDriverOutputs, err := c.dagDriverTask(loopDriverArgoName, loopDriverInputs)
if err != nil {
Expand Down Expand Up @@ -305,7 +304,7 @@ func (c *workflowCompiler) iteratorTask(name string, task *pipelinespec.Pipeline
loopTmpl.Parallelism = &parallellism_limit
}

loopTmplName, err := c.addTemplate(loopTmpl, componentName+"-loop-"+name)
loopTmplName, err := c.addTemplate(loopTmpl, fmt.Sprintf("%s-loop-iterator", componentName))
if err != nil {
return nil, err
}
Expand All @@ -325,7 +324,7 @@ func (c *workflowCompiler) iteratorTask(name string, task *pipelinespec.Pipeline
Parameters: []wfapi.Parameter{
{
Name: paramParentDagID,
Value: wfapi.AnyStringPtr(loopDriverOutputs.executionID),
Value: wfapi.AnyStringPtr(parentDagID),
},
},
},
Expand Down Expand Up @@ -382,7 +381,7 @@ func (c *workflowCompiler) iterationItemTask(name string, task *pipelinespec.Pip
Tasks: iterationTasks,
},
}
iterationsTmplName, err := c.addTemplate(iterationsTmpl, componentName+"-"+name)
iterationsTmplName, err := c.addTemplate(iterationsTmpl, componentName+"-iteration")
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit 19d9198

Please sign in to comment.