-
Notifications
You must be signed in to change notification settings - Fork 359
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
chore: check task config policies against slots and max_slots #10015
Conversation
✅ Deploy Preview for determined-ui canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10015 +/- ##
==========================================
- Coverage 54.58% 54.57% -0.02%
==========================================
Files 1259 1259
Lines 157233 157236 +3
Branches 3619 3619
==========================================
- Hits 85831 85816 -15
- Misses 71269 71287 +18
Partials 133 133
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -153,7 +153,7 @@ func (a *apiServer) getCommandLaunchParams(ctx context.Context, req *protoComman | |||
// Check submitted config against task config policies. | |||
valid, err := configpolicy.CheckNTSCConstraints(ctx, int(cmdSpec.Metadata.WorkspaceID), config, a.m.rm) | |||
if !valid { | |||
return nil, nil, err | |||
return nil, nil, status.Errorf(codes.InvalidArgument, "failed constraint check: %v", err) |
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.
@amandavialva01 I had %w
here at first, but the formatting was super weird. I was reminded of the conversation we had about %v
vs. %w
in fmt.Errorf
. Eventually I'll (hopefully) keep it straight! 😆
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.
Loll same! 😄 It's definitely a matter of trial and error 😆
config.Resources.Slots = *config.Resources.MaxSlots | ||
config.Resources.MaxSlots = nil // ensure only slots is set |
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.
I like this setup! Makes the test function explicit
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.
LGTM! Awesome work
Ticket
CM-551
Description
Need to check both
resources.max_slots
andresources.slots
when checking if a NTSC workload requests is within constraints.Test Plan
Covered by automated tests.
Checklist
docs/release-notes/
See Release Note for details.