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

Device constraint checking #4783

Merged
merged 8 commits into from
Oct 15, 2018
Merged

Device constraint checking #4783

merged 8 commits into from
Oct 15, 2018

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Oct 14, 2018

This PR:

  • Adds devices to nodes
  • Enables constraint checking over new Attribute type
  • Adds a device feasibility checker to the stack

Builds on top of #4780

@dadgar dadgar changed the base branch from f-device-attributes to master October 15, 2018 20:38
Copy link
Contributor

@preetapan preetapan left a comment

Choose a reason for hiding this comment

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

small commments otherwise LGTM

},
},
}

Copy link
Contributor

Choose a reason for hiding this comment

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

nice tests

return false
}
return checkRegexpMatch(ctx, ls, rs)
case structs.ConstraintSetContains:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also add support for ConstraintSetContainsAny here? (we've wanted to do so since affinities introduced it, but haven't gotten around to it, might as well do it now.)

NodeDevices: []*structs.NodeDeviceResource{nvidia, intel},
RequestedDevices: []*structs.RequestedDevice{gpuTypeHighCountReq},
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add another test like this with multiple constraints and count > 1

return psstructs.NewStringAttribute(d.Type), true

case strings.HasPrefix(target, "${driver.attr."):
attr := strings.TrimSuffix(strings.TrimPrefix(target, "${driver.attr."), "}")
Copy link
Contributor

Choose a reason for hiding this comment

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

would split this into two lines for readability

@dadgar dadgar merged commit 6fb074e into master Oct 15, 2018
@dadgar dadgar deleted the f-device-scheduling branch October 15, 2018 22:31
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants