Commit Graph

10928 Commits

Author SHA1 Message Date
Michael Schurter
4efbc349a4 rpcapi: remove; unused 2018-03-21 16:51:45 -07:00
Alex Dadgar
98935b82e0 fix race in drain integration tests 2018-03-21 16:51:45 -07:00
Michael Schurter
08c9116f2d Refactor assertOps into a helper func 2018-03-21 16:51:45 -07:00
Michael Schurter
e003b0534b Remove debug prints 2018-03-21 16:51:45 -07:00
Michael Schurter
8ef7863bed Deregister garbage collected jobs 2018-03-21 16:51:45 -07:00
Michael Schurter
74dc8fd460 JobNs -> NamespacedID
Also drop the New func as it's easy to swap the order of arguments since
they're both strings.
2018-03-21 16:51:45 -07:00
Michael Schurter
8217ebf11e drainer: RegisterJob -> RegisterJobs
Test job watcher
2018-03-21 16:51:45 -07:00
Michael Schurter
0a1f1d2c56 Fix deadline heap triggering
Chan must be buffered to avoid skipping triggering altogether

Also made timing in a test a bit more lenient
2018-03-21 16:51:45 -07:00
Michael Schurter
e669e8213a Improve drain log messages
Also delay "node complete" after the node has been marked complete to
capture a few more alloc events. There are other ways to implement this
that could trade off correctness for responsiveness as technically a
node is considered drained when all of its allocs have been marked to
stop and not when they've actually stopped (which may not happen for a
long time).
2018-03-21 16:51:45 -07:00
Michael Schurter
11d0eae5ed Monitor node drains until completion in CLI
allow -detach like other commands
2018-03-21 16:51:45 -07:00
Michael Schurter
6347baec55 Add DesiredTransition.ShouldMigrate to api pkg 2018-03-21 16:51:45 -07:00
Michael Schurter
fb6c821526 Fix node eligibility test 2018-03-21 16:51:45 -07:00
Alex Dadgar
270699bab2 fix comment 2018-03-21 16:51:45 -07:00
Alex Dadgar
5324e56e1c sharding 2018-03-21 16:51:44 -07:00
Alex Dadgar
ad2f211712 Batch drain update 2018-03-21 16:51:44 -07:00
Alex Dadgar
45e7e88558 Fix deadline handling 2018-03-21 16:51:44 -07:00
Michael Schurter
efb6601129 Switch to drainerv2 impl 2018-03-21 16:51:44 -07:00
Alex Dadgar
d15371405f Toggle Drain allows resetting eligibility
This PR allows marking a node as eligible for scheduling while toggling
drain. By default the `nomad node drain -disable` commmand will mark it
as eligible but the drainer will maintain in-eligibility.
2018-03-21 16:51:44 -07:00
Alex Dadgar
5b36af9860 code review 2018-03-21 16:51:44 -07:00
Alex Dadgar
bd701979b8 spelling fixes 2018-03-21 16:51:44 -07:00
Alex Dadgar
4b4e234516 Comments 2018-03-21 16:51:44 -07:00
Alex Dadgar
fb40e8babe handle empty node case 2018-03-21 16:51:44 -07:00
Alex Dadgar
c0354223c2 integration test and basic fixes 2018-03-21 16:51:44 -07:00
Alex Dadgar
cec2c5a726 Drainer 2018-03-21 16:51:44 -07:00
Alex Dadgar
0e51b20657 job watcher 2018-03-21 16:51:44 -07:00
Alex Dadgar
d45532d038 Node's being untracked or having updated deadlines, updates the deadliner 2018-03-21 16:51:44 -07:00
Alex Dadgar
da368105e6 node watcher 2018-03-21 16:51:44 -07:00
Alex Dadgar
e566fcdf5f drain heap 2018-03-21 16:51:44 -07:00
Alex Dadgar
6026af2a8a Initial design 2018-03-21 16:51:44 -07:00
Alex Dadgar
c00c02df62 System test runs on mac 2018-03-21 16:51:44 -07:00
Alex Dadgar
a027016b87 Fix file names 2018-03-21 16:51:44 -07:00
Alex Dadgar
7f989499ff Correct defaulting 2018-03-21 16:51:44 -07:00
Michael Schurter
478209807e refactor main drainloop into 2 more methods 2018-03-21 16:51:44 -07:00
Michael Schurter
1f73cd5d42 drainer: refactor newStopAllocs, applyMigrations 2018-03-21 16:51:44 -07:00
Michael Schurter
3ca9cdfadc client: don't monitor health of non-service jobs
Also fix system job draining; won't work without deadline fixes
2018-03-21 16:51:44 -07:00
Alex Dadgar
3fe3c6eff7 Improve DeadlineTime helper 2018-03-21 16:51:44 -07:00
Michael Schurter
3b25f784be drainer: convert fsm errors to go errors 2018-03-21 16:51:44 -07:00
Michael Schurter
678fbe1755 drainer: factor job & node watchers out of drainer.go 2018-03-21 16:51:44 -07:00
Michael Schurter
f2de735cdc Restart every time SetEnabled(true) is called 2018-03-21 16:51:44 -07:00
Michael Schurter
57c0335940 Remove unused context 2018-03-21 16:51:44 -07:00
Michael Schurter
9de890899a drainer: drainer should shutdown with server 2018-03-21 16:51:44 -07:00
Michael Schurter
5be3263204 refactor drainer into a subpkg 2018-03-21 16:51:44 -07:00
Alex Dadgar
7d58209927 code review 2018-03-21 16:51:44 -07:00
Alex Dadgar
d65ae92dfa Small refactor and cleanups 2018-03-21 16:51:44 -07:00
Alex Dadgar
a96c3374e2 Fix retaining the drain 2018-03-21 16:51:44 -07:00
Alex Dadgar
451b77d5d7 Unblock evals once eligible 2018-03-21 16:51:44 -07:00
Alex Dadgar
d6399cb733 Add eligibility to node view 2018-03-21 16:51:44 -07:00
Alex Dadgar
378c566294 node eligibility command 2018-03-21 16:51:44 -07:00
Alex Dadgar
0fb9ba7732 HTTP and API 2018-03-21 16:51:44 -07:00
Alex Dadgar
dcafa8b460 RPC/FSM/State Store for Eligibility 2018-03-21 16:51:44 -07:00