Alex Dadgar
cef7882827
Fix tests and docs
2017-02-22 18:28:07 -08:00
Diptanu Choudhury
98921575af
Adding a task event for setup
2017-02-22 18:28:07 -08:00
Michael Schurter
51e4fe9915
Use getters & setters with nil guards
2017-02-09 17:44:58 -08:00
Michael Schurter
37e7e7a3e5
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
aef3c2e380
Handle createdResourcs=nil
...
Combined with b522c472fdf 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
8196a58c4c
Rename dispatch_input to dispatch_payload
2017-01-25 21:27:44 -08:00
Michael Schurter
054ee8df59
Fix index we get allocs by
2017-01-20 16:30:40 -08:00
Michael Schurter
c5f222e4a6
Update created resources before exiting cleanup
2017-01-19 16:48:23 -08:00
Michael Schurter
a93d43a9cf
Exit early when cleanup succeeds
2017-01-19 15:07:01 -08:00
Michael Schurter
85f68aa00c
Fix incorrect lock usage
2017-01-19 11:39:18 -08:00
Michael Schurter
a3a3656dbb
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
dc68aa1a5a
Return errors from cleanup and let TaskRunner retry
2017-01-12 17:21:54 -08:00
Michael Schurter
4d081490e6
Add Cleanup method to Driver interface
...
Cleanup can be used for cleaning up resources created by drivers to run
a task. Initially the Docker driver is the only user (to remove
downloaded images).
2017-01-11 17:23:33 -08:00
Alex Dadgar
4127a3ea9d
Merge pull request #2173 from hashicorp/b-stats
...
Don't retrieve Driver Stats if unsupported
2017-01-10 13:32:03 -08:00
Alex Dadgar
2be221d664
Don't retrieve Driver Stats if unsupported
...
This PR makes us only try to collect stats once if the Driver doesn't
support collecting stats.
Fixes https://github.com/hashicorp/nomad/issues/1986
2017-01-09 13:47:06 -08:00
Alex Dadgar
26e2c5bb74
Merge pull request #2164 from hashicorp/b-dispatch
...
Create Task directory structure in the Run method
2017-01-09 11:24:46 -08:00
Alex Dadgar
2a5fd85e3b
Move to Run()
2017-01-08 13:55:12 -08:00
Alex Dadgar
2affef2972
Create task directory during Prestart()
2017-01-08 13:55:12 -08:00
Alex Dadgar
4ffd9a69e5
Send Driver events to servers immediately
...
This PR causes driver events to be sent to the server immediately rather
than waiting for Prestart() to finish.
2017-01-08 13:54:43 -08:00
Michael Schurter
3ea09ba16a
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
8d5f0fea69
Merge pull request #2128 from hashicorp/f-dispatch
...
Nomad Constructor Jobs and Dispatch
2017-01-06 05:22:49 +08:00
Michael Schurter
ea92cd102a
Append host env vars on every task env
2016-12-20 12:24:24 -08:00
Michael Schurter
2aa235f8f2
Rename InitializationMessage to DriverMessage
2016-12-20 11:51:09 -08:00
Alex Dadgar
159c819e08
Client writes payload to disk
2016-12-16 15:11:56 -08:00
Michael Schurter
770ed703d0
Add Driver.Prestart method
...
The Driver.Prestart method currently does very little but lays the
foundation for where lifecycle plugins can interleave execution _after_
task environment setup but _before_ the task starts.
Currently Prestart does two things:
* Any driver specific task environment building
* Download Docker images
This change also attaches a TaskEvent emitter to Drivers, so they can
emit events during task initialization.
2016-12-02 11:03:48 -08:00
Alex Dadgar
960424f086
Merge pull request #1941 from hashicorp/b-complete-transistion
...
Task state "dead" is terminal
2016-11-04 17:16:10 -07:00
Alex Dadgar
e6465e138b
More precise marking of dead
2016-11-04 17:11:07 -07:00
Alex Dadgar
0fb7742c3c
Task state "dead" is terminal
2016-11-04 16:57:24 -07:00
Alex Dadgar
8b7adb20e9
Fix tests
2016-11-04 15:10:18 -07:00
Alex Dadgar
4e8d39d674
Unique task
2016-11-04 14:53:37 -07:00
Alex Dadgar
4741a4b129
Create container much more robust
2016-11-04 14:39:56 -07:00
Alex Dadgar
cd1791ed09
Download artifacts before templates
2016-10-31 11:29:26 -07:00
Alex Dadgar
6618f7a03d
Fix passing of recoverable error from docker pull
2016-10-28 17:49:46 -07:00
Alex Dadgar
fde7a24865
Consul-template fixes + PreviousAlloc in api
2016-10-28 15:50:35 -07:00
Alex Dadgar
4082732d3a
Interpolate and then validate services
2016-10-25 14:27:49 -07:00
Alex Dadgar
da8b05ba17
Fix merge
2016-10-24 17:04:10 -07:00
Alex Dadgar
03eba049ed
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
ede3a814ba
Small fixes
2016-10-22 18:20:50 -07:00
Alex Dadgar
0070178741
Thread through whether DeriveToken error is recoverable or not
2016-10-22 18:08:30 -07:00
Alex Dadgar
46a7d1a0d7
Change how we mark tasks as failed and allow consul-template to fail tasks
2016-10-20 17:27:16 -07:00
Alex Dadgar
b384bff053
Feedback
2016-10-18 15:01:04 -07:00
Alex Dadgar
ba0b3963ef
Comments
2016-10-18 11:36:04 -07:00
Alex Dadgar
4f8bfd7b18
Tests
2016-10-18 11:24:20 -07:00
Alex Dadgar
36cfe6e89e
Large refactor of task runner and Vault token rehandling
2016-10-18 11:24:20 -07:00
Alex Dadgar
53eeec9bc1
Merge pull request #1801 from hashicorp/f-signals
...
Consul-template signal change mode
2016-10-18 11:23:47 -07:00
Ben Barnard
83f647ed84
Replace "the the" with "the" in documentation and comments
2016-10-11 15:31:40 -04:00
Alex Dadgar
bc35eaee21
Task runner sends signals
2016-10-10 15:09:00 -07:00
Alex Dadgar
e2d49eb4a2
Comments
2016-10-06 15:21:59 -07:00
Alex Dadgar
68c5fe78f8
Tests
2016-10-06 15:17:34 -07:00
Alex Dadgar
8fb07bb083
Fix handling of restart in TaskEvents
2016-10-06 15:06:54 -07:00