Commit Graph

2278 Commits

Author SHA1 Message Date
Michael Schurter
6db35013d2 Add PortMap to struct returned by Driver.Prestart
Moves env.Builder out of drivers entirely so one less thing to worry
about when implementing driver plugins.
2017-05-23 13:53:34 -07:00
Michael Schurter
37c1cbc9cf Move env template handling into consul_template.go 2017-05-23 13:53:34 -07:00
Michael Schurter
96753dcbcb Improve PortMap handling and simplify Builder creation 2017-05-23 13:53:34 -07:00
Michael Schurter
3b24980680 Move path building to task dir initialization 2017-05-23 13:53:34 -07:00
Michael Schurter
ace00980a1 Refactor TaskEnvironment into Builder and TaskEnv 2017-05-23 13:53:33 -07:00
Michael Schurter
7dac668adf Functional consul template env file support 2017-05-23 13:45:14 -07:00
Brandon Fulljames
dc95acdcc6 Fix for test 2017-05-19 16:59:07 -07:00
Brandon Fulljames
b0304477a2 Add SecurityOpt as a config field in Docker driver 2017-05-19 16:18:49 -07:00
Alex Dadgar
42801072ff Merge branch 'master' of github.com:hashicorp/nomad 2017-05-17 14:46:03 -07:00
Alex Dadgar
aa15ad51d1 Fix nil job on allocation
The way the copying was happening on the alloc_runner was by temporarily
setting the alloc.Job to nil, copying and then restoring it. This
created an issue in which when the alloc was shared (which it is in
server/client mode and between alloc_runner/task_runner) there were race
conditions that could create a panic.

Fixes https://github.com/hashicorp/nomad/issues/2605
2017-05-17 14:07:06 -04: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
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
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
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
92535496b4 Properly interpolate services on updated tasks
Previously was interpolating the original task's services again.

Fixes #2180

Also fixes a slight memory leak in the new consul agent. Script check
handles weren't being deleted after cancellation.
2017-04-26 11:22:01 -07: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