Commit Graph

1139 Commits

Author SHA1 Message Date
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
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
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
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
7614feddbd boltDB database for client state 2017-05-01 14:50:34 -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
fb3b30bba9 Fix Windows build. 2017-04-19 13:16:48 -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
63a8307255 Move ScriptExecutor to driver 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
8d07bd8f9c Add ExtraHosts to Docker driver
This PR allows job submitters to add extra hosts to the containers
/etc/hosts file.

Fixes https://github.com/hashicorp/nomad/issues/2546
2017-04-11 10:52:41 -07:00
Clint Armstrong
5f4716b4ea Allow specifying container IP with docker driver 2017-04-07 11:56:07 -04:00
Alex Dadgar
1dbd63ad2a Split driver tests 2017-04-04 15:12:14 -07:00
Robert Neumayer
46dcbc5c5e Fix typo and be consistent in naming 2017-03-29 09:33:54 +02: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
Michael Schurter
ae9d49502a Recoverable struct field must be exported 2017-03-28 12:18:57 -07:00
Michael Schurter
7f2bbe70c1 Merge branch 'master' into b-2491-task-env 2017-03-28 11:28:00 -07:00
Alex Dadgar
d698288f3a Merge pull request #2461 from hashicorp/b-groups
Various fixes for setting user/group of task
2017-03-28 11:13:27 -07:00
Alex Dadgar
3750f97ac6 Merge pull request #2488 from hashicorp/f-node-values-template
Access Node Meta and Attrs in template
2017-03-28 11:10:29 -07:00
Alex Dadgar
d1562194a9 feedback 2017-03-28 11:10:11 -07:00
Michael Schurter
1ead3cae6e Make test more accurate and add changelog entry 2017-03-28 10:53:26 -07:00
Michael Schurter
24d27fce83 Don't take a reference a var in a loop
Fixes #2491
2017-03-28 10:16:27 -07:00
Michael Schurter
6a4e1d1709 Recoverable is a method now, not a field 2017-03-27 15:41:35 -07:00
Michael Schurter
76c909bc9e Add WrapRecoverable helper 2017-03-27 15:37:15 -07:00
Alex Dadgar
63978511be Access Node Meta and Attrs in template
This PR allows accessing the Node's attributes and metadata as in a
template.

```
template {
    data = "{{ env \"attr.unique.network.ip-address\" }}"
    destination = "local/out"
}
```
2017-03-27 15:15:33 -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
67c07c9932 Various fixes for setting user/group of task
This PR fixes two issues:
* Folder permissions in -dev mode were incorrect and not suitable for
running as a particular user.
* Was not setting the group membership properly for the launched
process.

Fixes https://github.com/hashicorp/nomad/issues/2160
2017-03-20 14:21:13 -07:00
Michael Schurter
693d89d51c Fix test by adding new env vars 2017-03-14 17:15:12 -07:00
Alex Dadgar
0e61a36564 return the recoverable err 2017-03-14 16:33:36 -07:00
Alex Dadgar
a6067d5667 Docker doesn't need to init the stats helper 2017-03-14 13:41:57 -07:00
Alex Dadgar
36dc330737 Various fixes
This PR:
* Uses Go 1.8 executable lookup
* Stores any err message from stats init method
* Allows overriding of Cpu Compute for hosts where it can't be detected
2017-03-14 12:56:31 -07:00
Michael Schurter
7605d9a406 Merge pull request #2408 from hashicorp/b-2358-rkt-volume-name
Replace `_` with `-` in task names for rkt volumes
2017-03-14 10:10:00 -07:00
Michael Schurter
cae20ba1d1 Add NOMAD_{IP,PORT}_<task>_<label> env vars 2017-03-10 12:17:43 -08:00
Michael Schurter
2452f32476 Round two of env var cleaning
Should bring us into conformance with IEEE Std 1003.1, 2004 Edition:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

1 alloc/op and ~80ns/op on my machine.
2017-03-08 16:46:13 -08:00
Michael Schurter
07b85bb8d8 Replace _ with - in task names for rkt volumes
Fixes #2358
2017-03-07 14:34:57 -08:00