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

feat: support dag and steps level scheduling constraints. Fixes: #12568 #12700

Merged
merged 4 commits into from
Mar 15, 2024

Conversation

shuangkun
Copy link
Member

@shuangkun shuangkun commented Feb 26, 2024

Fixes #12568

Motivation

I want to Take effect dag and steps level scheduling constraints. Not just workflow level and template level.

Modifications

Find the pod's bounaryID's Template and add the scheduling constraints to pod if exists.

Verification

ut and e2e test

Signed-off-by: shuangkun <tsk2013uestc@163.com>
Signed-off-by: shuangkun <tsk2013uestc@163.com>
Signed-off-by: shuangkun <tsk2013uestc@163.com>
@shuangkun shuangkun marked this pull request as draft February 26, 2024 14:34
@shuangkun shuangkun marked this pull request as ready for review February 26, 2024 15:59
@shuangkun shuangkun added area/controller Controller issues, panics prioritized-review For members of the Sustainability Effort labels Feb 26, 2024
@Joibel Joibel self-assigned this Mar 6, 2024
Copy link
Member

@Joibel Joibel left a comment

Choose a reason for hiding this comment

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

This is good stuff.

I'd just like to rework some of the function calls here to allow a bit more code reuse.

@@ -815,6 +826,28 @@ func addSchedulingConstraints(pod *apiv1.Pod, wfSpec *wfv1.WorkflowSpec, tmpl *w
}
}

// GetBoundaryTemplate get a template through the node's BoundaryID.
func (woc *wfOperationCtx) GetBoundaryTemplate(nodeName string) (*wfv1.Template, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Can something like this function also be used from

boundaryNode, err := woc.wf.Status.Nodes.Get(boundaryID)

The two bits of code are very similar to each other, and it's good to extract common functionality whilst we're doing this kind of work.

This function could take a *NodeStatus instead

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I will try it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have made some reuses, please take a look,Thanks.

workflow/controller/workflowpod.go Show resolved Hide resolved
Signed-off-by: shuangkun <tsk2013uestc@163.com>
@shuangkun shuangkun requested a review from Joibel March 9, 2024 01:22
Copy link
Member

@Joibel Joibel left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @shuangkun

workflow/controller/workflowpod.go Show resolved Hide resolved
@juliev0 juliev0 merged commit a678294 into argoproj:main Mar 15, 2024
27 checks passed
@agilgur5 agilgur5 added this to the v3.6.0 milestone May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Controller issues, panics area/templates/dag area/templates/steps prioritized-review For members of the Sustainability Effort
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workflow ignoring nodeSelector and tolerations when defined in WorkflowTemplate
4 participants