Alex Dadgar
7fb1b37e09
Fix vet errors
2017-05-11 13:08:08 -07:00
Alex Dadgar
d11ca57705
Merge pull request #2610 from hashicorp/f-bolt-db
...
Client persist state using bolt-db and more efficient write patterns
2017-05-09 13:01:36 -07:00
Alex Dadgar
997390b04c
Fix test
2017-05-09 11:35:48 -07:00
Michael Schurter
92b19c441a
Ignore Consul deregister errors on executors
...
Errors here only occur if Consul is not running when Nomad is restarted.
Errors here are only an issue if:
* Consul is being used but is down or misbehaving
* The executor is old (<0.6)
* The task has services
* The services hit a pre-0.6 consul.Syncer bug
If all of those conditions are met the pre-0.6 bugs will persist for
this task until Nomad is restarted.
2017-05-09 11:28:27 -07:00
Alex Dadgar
e47be9f771
Merge branch 'master' into f-bolt-db
2017-05-09 11:11:55 -07:00
Alex Dadgar
3f1ccf7278
Respond to comments
2017-05-09 10:50:24 -07:00
Michael Schurter
78af600070
Update consul/api to support unix socket addrs
...
Fixes #2594
2017-05-08 11:57:04 -07:00
Michael Schurter
499ada5a64
Merge pull request #2585 from hashicorp/b-2554-container-exec
...
Execute exec/java script checks in containers
2017-05-05 10:31:18 -07:00
Michael Schurter
a39eef0f11
Test pre06ScriptCheck
2017-05-04 16:49:00 -07:00
Michael Schurter
9012357414
Oops, remove dev logging
2017-05-04 16:27:04 -07:00
Michael Schurter
426c696404
Reuse ExecScript implementation
2017-05-04 16:21:40 -07:00
Alex Dadgar
3642434293
Fix tests
2017-05-03 15:14:19 -07:00
Kate Taggart
82d60ce670
fix test.
2017-05-03 12:45:59 -07:00
Kate Taggart
6ea156b565
responding to feedback on PR: remove Region from Node struct, some grammatical niceties.
2017-05-03 12:45:59 -07:00
Kate Taggart
4a4417d556
I think I did it.
2017-05-03 12:45:59 -07:00
Kate Taggart
530cf03177
allow region to also be interpolated, like datacenter.
2017-05-03 12:45:59 -07:00
Kate Taggart
d10bfb46c1
just found out dc and region are going to be a bit different, as Region didn't previously exist in the Node struct.
2017-05-03 12:45:59 -07:00
Kate Taggart
a5c4663efb
add helper functions to set and clear dc, region names.
2017-05-03 12:45:59 -07:00
Kate Taggart
aeec7b3591
add dc and region to task env building function. flipped order of a couple functions to be consistent with the ordering of the rest of that section.
2017-05-03 12:45:59 -07:00
Kate Taggart
cf1b298f72
starting the jelly bean trail for two new env vars
2017-05-03 12:45:59 -07:00
Alex Dadgar
098b02d5bf
Helpful comment
2017-05-03 11:27:33 -07:00
Alex Dadgar
5952dae3e0
Fix tests
2017-05-03 11:15:30 -07:00
Alex Dadgar
e22393aeb8
Restore state + upgrade path
2017-05-02 18:21:49 -07:00
Alex Dadgar
85a81f47de
Revert "metrics"
...
This reverts commit 4d6a012c6f .
2017-05-02 09:28:11 -07:00
Alex Dadgar
1d20b11297
Async and sync saving of client state
2017-05-01 16:16:53 -07:00
Alex Dadgar
7dee8ae534
perf
2017-05-01 16:01:50 -07:00
Alex Dadgar
4d6a012c6f
metrics
2017-05-01 14:51:27 -07:00
Alex Dadgar
5aa6e18807
Use batching
2017-05-01 14:50:34 -07:00
Alex Dadgar
7614feddbd
boltDB database for client state
2017-05-01 14:50:34 -07:00
Alex Dadgar
9def7e1a14
Don't deepcopy job when retrieving copy of Alloc
...
This PR removes deepcopying of the job attached to the allocation in the
alloc runner. This operation is called very often so removing reflect
from the code path and the potentially large number of mallocs need to
create a job reduced memory and cpu pressure.
2017-05-01 14:50:34 -07:00
Pete Wildsmith
aa2da9ea50
address feedback
2017-04-28 10:27:37 +01:00
Pete Wildsmith
06f3aac9de
clean up consul earlier when destroying a task
2017-04-27 23:29:30 +01:00
Michael Schurter
2cc492c95e
Test pre-0.6 script check upgrade path
2017-04-25 11:41:03 -07:00
Michael Schurter
8f518c4c1f
Test env+cgroups for exec driver checks
2017-04-25 11:13:06 -07:00
Michael Schurter
29f222d461
Change raw_exec to use simplified exec wrapper
2017-04-21 16:50:20 -07:00
Michael Schurter
90f5e232a5
Switch java/exec to use Exec in Executor
2017-04-21 16:25:49 -07:00
Michael Schurter
fe2b3e382d
Restart tasks on upgrade with script checks and old executors
2017-04-21 16:25:49 -07:00
Michael Schurter
fb3b30bba9
Fix Windows build.
2017-04-19 13:16:48 -07:00
Michael Schurter
b9ea2765ec
Thanks go vet!
2017-04-19 13:05:41 -07:00
Michael Schurter
8e0c97e52f
Unregister from Consul when waiting for restart
2017-04-19 12:42:48 -07:00
Michael Schurter
4f224132ad
Remove stale comment
2017-04-19 12:42:47 -07:00
Michael Schurter
db8aabe1c3
Fix circular test imports
2017-04-19 12:42:47 -07:00
Michael Schurter
0e0845e94b
Use a DriverAbility to expose Exec functionality
2017-04-19 12:42:47 -07:00
Michael Schurter
fd69d48244
Move removal from Consul into TaskRunner cleanup
2017-04-19 12:42:47 -07:00
Michael Schurter
63a8307255
Move ScriptExecutor to driver
2017-04-19 12:42:47 -07:00
Michael Schurter
b6937912d8
Add UpdateTask method instead of Remove/Add
2017-04-19 12:42:47 -07:00
Michael Schurter
10cb924b2c
Refactor Consul Syncer into new ServiceClient
...
Fixes #2478 #2474 #1995 #2294
The new client only handles agent and task service advertisement. Server
discovery is mostly unchanged.
The Nomad client agent now handles all Consul operations instead of the
executor handling task related operations. When upgrading from an
earlier version of Nomad existing executors will be told to deregister
from Consul so that the Nomad agent can re-register the task's services
and checks.
Drivers - other than qemu - now support an Exec method for executing
abritrary commands in a task's environment. This is used to implement
script checks.
Interfaces are used extensively to avoid interacting with Consul in
tests that don't assert any Consul related behavior.
2017-04-19 12:42:47 -07:00
Michael Schurter
17471bf7c0
Set ownership on directories in chroot
...
Also support getOwner on all Unixes as they all have `Stat_t.{U,G}id`
2017-04-17 12:41:33 -07:00
Michael Schurter
1cffc7310e
Don't disable hardlinking!
2017-04-17 11:03:15 -07:00
Michael Schurter
2fe3de16be
Chown files when copying into chroot
...
Fixes #2552
Not needed when hardlinking. Only adds Linux support but other OS's may
be easy.
2017-04-17 11:03:15 -07:00