Alex Dadgar
f72bbaa370
Client watches for allocation health using task state and Consul checks
...
This PR adds watching of allocation health at the client. The client can
watch for health based on the tasks running on time and also based on
the consul checks passing.
2017-07-07 12:10:04 -07:00
Michael Schurter
236ef21489
Merge pull request #2636 from hashicorp/f-gc-alloc-limit
...
Add new gc_max_allocs tuneable
2017-05-30 16:14:09 -07:00
Michael Schurter
1295f88d03
Handle Driver.Prestart returning nil, nil
2017-05-23 13:53:34 -07:00
Michael Schurter
70fdc46abc
Merge pull request #2591 from hashicorp/b-2180-script-updates
...
Properly interpolate services on updated tasks
2017-05-17 09:09:01 -07:00
Michael Schurter
cc11d9a563
Add new gc_max_allocs tuneable
...
More than gc_max_allocs may be running on a node, but terminal allocs
will be garbage collected to try to keep the total number below the
limit.
2017-05-11 17:18:02 -07:00
Alex Dadgar
e47be9f771
Merge branch 'master' into f-bolt-db
2017-05-09 11:11:55 -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
3999b57e7d
Build new env from new alloc before interpolating
2017-05-04 15:06:15 -07:00
Alex Dadgar
3642434293
Fix tests
2017-05-03 15:14:19 -07:00
Alex Dadgar
5952dae3e0
Fix tests
2017-05-03 11:15:30 -07:00
Michael Schurter
2cc492c95e
Test pre-0.6 script check upgrade path
2017-04-25 11:41:03 -07:00
Michael Schurter
8e0c97e52f
Unregister from Consul when waiting for restart
2017-04-19 12:42:48 -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
Alex Dadgar
1458d9b35a
Split task runner tests
2017-04-04 15:02:09 -07:00
Alex Dadgar
4596542197
Fix variable capture and add tests
...
This PR fixes token revocation and adds tests to make sure it is
working. The 0.5.6 RC1's token revocation does not work becasue the
token's value is captured at the instantiation of the deferred
stoprenewal statement rather than its exectution.
2017-03-29 13:17:50 -07:00
Alex Dadgar
9cf4bcab71
Fix panic when restarting non-running task
...
This PR fixes an issue that is hit when running templates with restart
mode in which the client could panic when the handle is not running.
Fixes https://github.com/hashicorp/nomad/issues/2479
2017-03-24 12:04:22 -07:00
Alex Dadgar
94974152fd
Mkdir -> MkdirAll to avoid error when folder already exists
2017-03-02 19:35:31 -08:00
Michael Schurter
6535aa8d95
Fix API breaks in tests
2017-03-02 15:50:18 -08:00
Alex Dadgar
07f7e19578
Fix vet script and fix vet problems
...
This PR fixes our vet script and fixes all the missed vet changes.
It also fixes pointers being printed in `nomad stop <job>` and `nomad
node-status <node>`.
2017-02-27 16:00:19 -08:00
Alex Dadgar
7447ccd7e4
Fix tests and docs
2017-02-22 18:28:07 -08:00
Michael Schurter
c6e78e2939
Fix test to assert new never-nil behavior
2017-02-10 10:11:15 -08:00
Michael Schurter
2822dd760c
Handle createdResourcs=nil
...
Combined with b522c472fd this fixes #2256
Without these two commits in place upgrades to 0.5.3 panics.
2017-01-31 10:51:32 -08:00
Alex Dadgar
8e5d2dd817
slightly more verbose test
2017-01-30 16:16:26 -08:00
Alex Dadgar
3c7e018438
up timing
2017-01-26 13:25:37 -08:00
Alex Dadgar
314435261d
Rename dispatch_input to dispatch_payload
2017-01-25 21:27:44 -08:00
Alex Dadgar
2c48e93963
More timing fixes
2017-01-25 11:57:38 -08:00
Alex Dadgar
db446bbabf
Fix flaky test
2017-01-24 09:40:13 -08:00
Alex Dadgar
0b46f7c237
Fix template test
2017-01-23 16:42:02 -08:00
Michael Schurter
269b3c7e14
Merge pull request #2186 from hashicorp/f-driver-cleanup
...
Add Cleanup method to Driver interface
2017-01-20 13:02:14 -08:00
Michael Schurter
1a845561dd
Rename Constructor -> Parameterized Job
2017-01-20 12:43:10 -08:00
Michael Schurter
1ec5c930a6
Return errors from cleanup and let TaskRunner retry
2017-01-12 17:21:54 -08:00
Michael Schurter
6235122b55
Fix tests post rebase
2017-01-06 11:39:13 -08:00
Michael Schurter
e25274b775
Put a logger in AllocDir/TaskDir
2017-01-05 16:31:56 -08:00
Michael Schurter
de7351b959
Move chroot building into TaskRunner
...
* Refactor AllocDir to have a TaskDir struct per task.
* Drivers expose filesystem isolation preference
* Fix lxc mounting of `secrets/`
2017-01-05 16:31:49 -08:00
Alex Dadgar
d1ecd38c25
Client writes payload to disk
2016-12-16 15:11:56 -08:00
Alex Dadgar
e64875f4cd
Merge pull request #1941 from hashicorp/b-complete-transistion
...
Task state "dead" is terminal
2016-11-04 17:16:10 -07:00
Alex Dadgar
c5b7a08807
Test fix
2016-11-04 17:15:58 -07:00
Alex Dadgar
0ce8a21fe2
Fix tests
2016-11-04 15:10:18 -07:00
Alex Dadgar
f2fd8f0413
Download artifacts before templates
2016-10-31 11:29:26 -07:00
Alex Dadgar
d70fd7e426
Fix passing of recoverable error from docker pull
2016-10-28 17:49:46 -07:00
Michael Schurter
144d91cf51
Adjust timings to try to get test passing in Travis
2016-10-26 17:08:53 -07:00
Alex Dadgar
5087836a0a
Fix Validate_UserEnforcement
2016-10-26 15:03:41 -07:00
Alex Dadgar
7c3a2d08a3
Merge pull request #1848 from hashicorp/f-vault-error
...
Thread through whether DeriveToken error is recoverable or not
2016-10-24 15:01:18 -07:00
Alex Dadgar
51831f92dd
Merge pull request #1840 from hashicorp/f-kill-fail
...
Change how we mark tasks as failed and allow consul-template to fail tasks
2016-10-24 13:40:52 -07:00
Alex Dadgar
42f7bc8e81
Thread through whether DeriveToken error is recoverable or not
2016-10-22 18:08:30 -07:00
Michael Schurter
4d3187bc7e
Remove disk usage enforcement
...
Many thanks to @iverberk for the original PR (#1609 ), but we ended up
not wanting to ship this implementation with 0.5.
We'll come back to it after 0.5 and hopefully find a way to leverage
filesystem accounting and quotas, so we can skip the expensive polling.
2016-10-21 13:55:51 -07:00
Alex Dadgar
f130c8a894
Change how we mark tasks as failed and allow consul-template to fail tasks
2016-10-20 17:27:16 -07:00
Alex Dadgar
ae288a3ee6
Tests
2016-10-18 11:24:20 -07:00
Alex Dadgar
e34902ae8a
Large refactor of task runner and Vault token rehandling
2016-10-18 11:24:20 -07:00