Commit Graph

208 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Michael Schurter
4d3c571859 Merge pull request #2482 from hashicorp/f-2289-better-artifact-err
Improve artifact download error message
2017-03-28 12:48:22 -07:00
Alex Dadgar
87474b7c37 Merge pull request #2495 from hashicorp/b-vault-stop-renew
Stop Vault token renew on task exit
2017-03-28 11:14:18 -07:00
Alex Dadgar
c6a796e67f Stop Vault token renew on task exit
This PR fixes an oversight in which the client would attempt to renew a
token even after the task exits.

Fixes https://github.com/hashicorp/nomad/issues/2475
2017-03-28 10:53:15 -07:00
Michael Schurter
76c909bc9e Add WrapRecoverable helper 2017-03-27 15:37:15 -07:00
Alex Dadgar
564367fa71 Proper reference counting through task restarts
This PR fixes an issue in which the reference count on a Docker image
would become inflated through task restarts.
2017-03-25 17:05:53 -07:00
Michael Schurter
774cb8dd9b Improve artifact download error message
Fixes #2289

Unfortunately took more RecoverableError hijinx than I would have liked.
There might be a better way.
2017-03-24 15:26:05 -07:00
Alex Dadgar
0021961361 Fix vet 2017-03-24 12:24:47 -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
637aff7819 Handle git ssh artifacts
This PR adds handling for downloading git artifacts using ssh with the
format git@github.com:hashicorp/go-getter.git

Fixes https://github.com/hashicorp/nomad/issues/2430
2017-03-11 15:12:41 -08:00
Alex Dadgar
fbfeecb486 Fix TestAllocRunner_SaveRestoreState 2017-03-02 20:45:46 -08:00
Alex Dadgar
833b4bd4dc Merge branch 'master' into b-remount 2017-03-02 19:23:13 -08:00
Michael Schurter
ad4559d019 Safely ensure {dev,proc,alloc} are mounted
If they're unmounted by a reboot they'll be properly remounted.
2017-03-02 13:21:34 -08:00
Alex Dadgar
2a683cddea Update go-getter and add support for git and hg
Fixes https://github.com/hashicorp/nomad/issues/2042
2017-03-01 14:46:04 -08:00
Alex Dadgar
4826d8464e Fix two issues during client restore state
This PR fixes two issues:

1) A close of a nil stopCollection channel when restoring and prestart
fails. The failure will cause the killCh to be triggered which will
close collection before it has been initialized.

2) Fixes a deadlock in which the handleWaitCh is never triggered since
it is not initialized when there is an error in prestart and the killCh
is triggered.

Both fixes are by maintaining the loop invariant that the two channels
are valid after there is a handle.
2017-02-28 10:29:12 -08:00
Alex Dadgar
7447ccd7e4 Fix tests and docs 2017-02-22 18:28:07 -08:00
Diptanu Choudhury
c80bdd9f5f Adding a task event for setup 2017-02-22 18:28:07 -08:00
Michael Schurter
a760fbcea6 Use getters & setters with nil guards 2017-02-09 17:44:58 -08:00
Michael Schurter
c961e751ec Fix upgrade path for created resources
This *might* be a fix for #2295 -- I've been unable to reproduce the
bug. However, this guard seems wise regardless. I should never be
overwriting an intialized created resources with a nil.
2017-02-09 13:54:33 -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
314435261d Rename dispatch_input to dispatch_payload 2017-01-25 21:27:44 -08:00
Michael Schurter
78c9c00ba8 Fix index we get allocs by 2017-01-20 16:30:40 -08:00
Michael Schurter
783118b34d Update created resources before exiting cleanup 2017-01-19 16:48:23 -08:00
Michael Schurter
828151ea38 Exit early when cleanup succeeds 2017-01-19 15:07:01 -08:00
Michael Schurter
cf0157af89 Fix incorrect lock usage 2017-01-19 11:39:18 -08:00
Michael Schurter
db096b23b5 Switch to use recoverable errors from Cleanup
TaskRunner handles retrying but Cleanup handles all of CreatedResources.
2017-01-13 16:46:08 -08:00
Michael Schurter
1ec5c930a6 Return errors from cleanup and let TaskRunner retry 2017-01-12 17:21:54 -08:00