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

Preemption for system jobs #4794

Merged
merged 38 commits into from
Nov 2, 2018
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5f27e00
structs and API changes to plan and alloc structs needed for preemption
Sep 10, 2018
8004160
REview feedback
Sep 10, 2018
bf7192c
Add number of evictions to DesiredUpdates struct to use in CLI/API
Sep 11, 2018
fc266f7
structs and API changes to plan and alloc structs needed for preemption
Sep 10, 2018
715d869
Implement preemption for system jobs.
Sep 21, 2018
b5cbd73
Fix comment
Sep 24, 2018
13e314c
Fix logic bug, unit test for plan apply method in state store
Sep 24, 2018
fd6bff2
Fix linting and better comments
Sep 24, 2018
51c5bae
Fix linting
Sep 27, 2018
784b96c
Support for new scheduler config API, first use case is to disable pr…
Sep 28, 2018
2143fa2
Use scheduler config from state store to enable/disable preemption
Sep 28, 2018
6966e3c
Make preemption config a struct to allow for enabling based on schedu…
Oct 1, 2018
24b3934
Modify preemption code to use new style of resource structs
Oct 16, 2018
9f35923
fix end to end scheduler test to use new resource structs correctly
Oct 17, 2018
a960cce
comments
Oct 17, 2018
655689a
Preempted allocations should be removed from proposed allocations
Oct 17, 2018
c4e0e66
Restore/Snapshot plus unit tests for scheduler configuration
Oct 18, 2018
c3b8e4f
Add fsm layer tests
Oct 18, 2018
12af2ae
make default config a variable
Oct 18, 2018
c4a04eb
style fixes
Oct 18, 2018
191b862
More review comments
Oct 18, 2018
21432d6
More style and readablity fixes from review
Oct 18, 2018
4cc21fb
more minor cleanup
Oct 18, 2018
35635ba
refactor preemption code to use method recievers and setters for comm…
Oct 29, 2018
8800585
Introduce a response object for scheduler configuration
Oct 29, 2018
17344a7
Introduce interface with multiple implementations for resource distance
Oct 30, 2018
f2b0277
Fix return type in tests after refactor
Oct 30, 2018
22d156f
review comments
Nov 1, 2018
993b6a2
Cleaner way to exit early, and fixed a couple more places reading fro…
Nov 1, 2018
3ad7b3f
More review comments
Nov 1, 2018
06ad182
Plumb alloc resource cache in a few more places.
Nov 1, 2018
35d31f8
more minor review feedback
Nov 1, 2018
b3738a0
unit test plan apply with preemptions
Nov 2, 2018
0015095
Handle static port preemption when there are multiple devices
Nov 2, 2018
8235919
Fix static port preemption to be device aware
Nov 2, 2018
1380acb
dereference safely
Nov 2, 2018
c49a3e2
Fix test setup
Nov 2, 2018
97cf4e1
Address more minor code review feedback
Nov 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style fixes
  • Loading branch information
Preetha Appan committed Oct 30, 2018
commit c4a04eb1b209356b9f613a803458223f84ff70d4
12 changes: 4 additions & 8 deletions nomad/operator_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ func (op *Operator) SchedulerSetConfiguration(args *structs.SchedulerSetConfigRe
rule, err := op.srv.ResolveToken(args.AuthToken)
if err != nil {
return err
}
if rule != nil && !rule.AllowOperatorWrite() {
} else if rule != nil && !rule.AllowOperatorWrite() {
return structs.ErrPermissionDenied
}

Expand All @@ -305,8 +304,7 @@ func (op *Operator) SchedulerSetConfiguration(args *structs.SchedulerSetConfigRe
if err != nil {
op.logger.Error("failed applying Scheduler configuration", "error", err)
return err
}
if respErr, ok := resp.(error); ok {
} else if respErr, ok := resp.(error); ok {
return respErr
}

Expand All @@ -327,17 +325,15 @@ func (op *Operator) SchedulerGetConfiguration(args *structs.GenericRequest, repl
rule, err := op.srv.ResolveToken(args.AuthToken)
if err != nil {
return err
}
if rule != nil && !rule.AllowOperatorRead() {
} else if rule != nil && !rule.AllowOperatorRead() {
return structs.ErrPermissionDenied
}

state := op.srv.fsm.State()
_, config, err := state.SchedulerConfig()
if err != nil {
return err
}
if config == nil {
} else if config == nil {
return fmt.Errorf("scheduler config not initialized yet")
}

Expand Down