Commit Graph

3299 Commits

Author SHA1 Message Date
Michael Schurter
7ca41a89c4 Implement alloc updates in arv2
Updates are applied asynchronously but sequentially
2018-10-16 16:53:30 -07:00
Michael Schurter
97dbf99d3f call handle.Network() instead of storing it 2018-10-16 16:53:30 -07:00
Michael Schurter
cea2b879e4 Add Network method to Handle interface
Should probably be moved to an Inspect method in the Driver Plugin world
2018-10-16 16:53:30 -07:00
Michael Schurter
76194c7414 consul service hook
Deregistration works but difficult to test due to terminal updates not
being fully implemented in the new client/ar/tr.
2018-10-16 16:53:29 -07:00
Michael Schurter
bb273896b5 restore vault client 2018-10-16 16:53:29 -07:00
Michael Schurter
3bca9472f0 log before killing tasks 2018-10-16 16:53:29 -07:00
Michael Schurter
a744845ac7 no need to TaskStateUpdated to return an error
also updated comments
2018-10-16 16:53:29 -07:00
Alex Dadgar
52ae83d4d5 Update state with server 2018-10-16 16:53:29 -07:00
Alex Dadgar
ebf1aa0952 Define and thread through state updating interface 2018-10-16 16:53:29 -07:00
Michael Schurter
fae947419d tr: add validate task hook 2018-10-16 16:53:29 -07:00
Michael Schurter
b09b552ae5 missed locking around c.allocs access 2018-10-16 16:53:29 -07:00
Alex Dadgar
4f2d6415ca wip 2018-10-16 16:53:29 -07:00
Alex Dadgar
cdabf425b9 Fix deadlock 2018-10-16 16:53:29 -07:00
Alex Dadgar
bbcc916030 Remove SetState from interface 2018-10-16 16:53:29 -07:00
Alex Dadgar
9c04ed379c compile 2018-10-16 16:53:29 -07:00
Michael Schurter
457250b687 wip split event emitting and state transitions 2018-10-16 16:53:29 -07:00
Michael Schurter
7e60f0ba77 client: implement all-or-nothing alloc restoration
Restoring calls NewAR -> Restore -> Run

NewAR now calls NewTR
AR.Restore calls TR.Restore
AR.Run calls TR.Run
2018-10-16 16:53:29 -07:00
Alex Dadgar
80303412de Implement lifecycle hooks on the task runner 2018-10-16 16:53:29 -07:00
Alex Dadgar
c19ea97011 comments 2018-10-16 16:53:29 -07:00
Alex Dadgar
912d3613ec Hook renames 2018-10-16 16:53:29 -07:00
Alex Dadgar
05a0565040 remove comment 2018-10-16 16:53:29 -07:00
Alex Dadgar
711d09e1be Template hook 2018-10-16 16:53:29 -07:00
Alex Dadgar
781c498070 address comments 2018-10-16 16:53:29 -07:00
Alex Dadgar
427eab563a vault hook 2018-10-16 16:53:29 -07:00
Michael Schurter
fdd3bb63d4 tr: improve skip log line 2018-10-16 16:53:29 -07:00
Michael Schurter
eea820ecf1 tr: pass context to hooks 2018-10-16 16:53:29 -07:00
Michael Schurter
d3d590f175 tr: fix setting done in existing hooks 2018-10-16 16:53:29 -07:00
Michael Schurter
bfbc95e258 fix hclog level 2018-10-16 16:53:29 -07:00
Michael Schurter
4107afdbf6 reimplement success state for tr hooks and state persistence
splits apart local and remote persistence

removes some locking *for now*
2018-10-16 16:53:29 -07:00
Michael Schurter
370d92ff2e pass statedb into allocrunnerv2 2018-10-16 16:53:29 -07:00
Michael Schurter
6250509a76 remove unused allocrunner shim 2018-10-16 16:53:29 -07:00
Michael Schurter
07d5bacee8 tr: cleanup main loop and shutdown hook impl 2018-10-16 16:53:29 -07:00
Michael Schurter
1e24cd6cfc tr: skip error/success saving
All hooks only need to be run once.
Since only one hook can fail per run there's no need to
track errors on a per hook basis.
2018-10-16 16:53:29 -07:00
Michael Schurter
256bc5a14c tr: don't lock for immutable fields 2018-10-16 16:53:29 -07:00
Michael Schurter
124ad51944 tr: start update/shutdown logic 2018-10-16 16:53:29 -07:00
Michael Schurter
2d90ec63f3 Copy TR.Config vals to TR
I think I like this pattern better as some Config vals are mutable
(Alloc) and some aren't and some are used to derive other values and
never used directly.

Promoting them onto the TR struct is a little more work but is hopefully
more clear as to how each value is used.
2018-10-16 16:53:29 -07:00
Michael Schurter
53a4b3fe99 example redis job "runs" on arv2! see below
Tons left to do and lots of churn:
1. No state saving
2. No shutdown or gc
3. Removed AR factory *for now*
4. Made all "Config" structs local to the package they configure
5. Added allocID to GC to avoid a lookup

Really hating how many things use *structs.Allocation. It's not bad
without state saving, but if AllocRunner starts updating its copy things
get racy fast.
2018-10-16 16:53:29 -07:00
Michael Schurter
0892aca3fc begin adding AllocRunner.Update 2018-10-16 16:53:29 -07:00
Michael Schurter
15c0731096 artifact task hook 2018-10-16 16:53:29 -07:00
Alex Dadgar
deede95117 Initial V2 alloc runner 2018-10-16 16:53:28 -07:00
Alex Dadgar
5e67b37aad use int64 2018-10-16 15:34:32 -07:00
Preetha Appan
3ca71ae935 Change CPU/Disk/MemoryMB to int everywhere in new resource structs 2018-10-16 16:21:42 -05:00
Christian Winther
5314bfcd34 fix: increase log rotator line scan limit
In case where gelf/json logging is used, its fairly easy to exceed the 16k limit, resulting in json output being cut up into multiple strings

the result is invalid json lines which can create all kind of badness in the logging server

This fixes https://github.com/hashicorp/nomad/issues/4699

Signed-off-by: Christian Winther <jippignu@gmail.com>
2018-10-09 18:57:18 +02:00
Alex Dadgar
e30b20e65e renames 2018-10-04 14:57:25 -07:00
Alex Dadgar
0f2f4797cb fixing tests 2018-10-04 14:26:19 -07:00
Alex Dadgar
49c2d4f775 Scheduler uses allocated resources 2018-10-02 17:08:25 -07:00
Alex Dadgar
f969298854 Node reserved resources 2018-09-29 18:44:55 -07:00
Alex Dadgar
b310a54aa6 Node resources on client 2018-09-29 17:23:41 -07:00
Alex Dadgar
58c889aa94 yamux 2018-09-17 14:22:40 -07:00
Alex Dadgar
32f9da9e07 small fixes 2018-09-15 16:42:38 -07:00