-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
There was a problem hiding this 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
}, | ||
}, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice tests
scheduler/feasible.go
Outdated
return false | ||
} | ||
return checkRegexpMatch(ctx, ls, rs) | ||
case structs.ConstraintSetContains: |
There was a problem hiding this comment.
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}, | ||
}, | ||
{ |
There was a problem hiding this comment.
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
scheduler/feasible.go
Outdated
return psstructs.NewStringAttribute(d.Type), true | ||
|
||
case strings.HasPrefix(target, "${driver.attr."): | ||
attr := strings.TrimSuffix(strings.TrimPrefix(target, "${driver.attr."), "}") |
There was a problem hiding this comment.
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
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. |
This PR:
Builds on top of #4780