Commit Graph

1088 Commits

Author SHA1 Message Date
Michael Schurter
17d9e8e189 Remove outdated comment 2017-01-17 16:05:21 -08:00
Michael Schurter
4dcba012f4 Return error from Prestart 2017-01-17 16:04:09 -08:00
Michael Schurter
b100293a06 Try to get test passing in Travis 2017-01-17 12:51:19 -08:00
Michael Schurter
1f35e97510 Use Image ID instead of Image Name 2017-01-13 16:53:58 -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
Alex Dadgar
9206446a8d Support setting class_path and class name.
This PR enhances the java driver to allow setting the class path and
class name to run. It also fixes an issue that would make the Java
driver attempt to chroot regardless of operating system (this never
effected a released version of Nomad).
2017-01-13 16:03:11 -08:00
Michael Schurter
b82c69886d Add ID to output 2017-01-13 12:46:55 -08:00
Michael Schurter
1ec5c930a6 Return errors from cleanup and let TaskRunner retry 2017-01-12 17:21:54 -08:00
Diptanu Choudhury
a066d90313 Added executorconfig 2017-01-12 15:47:58 -08:00
Diptanu Choudhury
84137b02c5 Filter executor log messages 2017-01-12 11:54:19 -08:00
Michael Schurter
cace868288 Stop being so confusing 2017-01-12 11:17:35 -08:00
Michael Schurter
33c015bcc7 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
Cameron Davison
d4b8fc953a using new ctx instead of getting both params back 2017-01-10 16:54:01 -06:00
Cameron Davison
2d6e7e7b57 fixing typo in comment 2017-01-10 16:54:01 -06:00
Cameron Davison
e2a09752b5 add force_pull to docker driver 2017-01-10 16:54:01 -06:00
Michael Schurter
8b80c7d15a Merge pull request #2174 from hashicorp/b-fix-executor-test
Switch to a less timing dependent test command
2017-01-10 13:45:12 -08:00
Michael Schurter
1bb4806ab4 Fix missing value in test failure message 2017-01-10 13:39:05 -08:00
Michael Schurter
34cc7a70ad Switch to a less timing dependent test command
`/usr/bin/yes` could produce output very quickly (100s of MBps on my
laptop) and therefore could cause log files to roll over.

A bash loop with a sleep avoids that issue. The test is slower but
should be much more resilient to the massive timing differences between
workstations and Travis.
2017-01-09 15:40:53 -08:00
Alex Dadgar
fa7db8cdd4 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
Michael Schurter
a087a8be79 Fix inconsistent task env setting
Consolidate task environment building in GetTaskEnv since it can
determine what kind of filesystem isolation is used.

This means drivers no longer have to manipulate task environment paths.
2017-01-06 12:19:32 -08:00
Michael Schurter
ed8b3cd37d Fix executor tests 2017-01-06 11:39:18 -08:00
Michael Schurter
59c501f474 Driver is now required in test tasks 2017-01-06 11:39:17 -08:00
Michael Schurter
12915c30bf Remove debug logging 2017-01-05 16:31:56 -08:00
Michael Schurter
86db19407e Remove task name prefix from executor logs 2017-01-05 16:31:56 -08:00
Michael Schurter
e25274b775 Put a logger in AllocDir/TaskDir 2017-01-05 16:31:56 -08:00
Michael Schurter
e7f6986eb2 Test tasks now require driver name 2017-01-05 16:31:55 -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
248c069652 Merge pull request #2128 from hashicorp/f-dispatch
Nomad Constructor Jobs and Dispatch
2017-01-06 05:22:49 +08:00
Michael Schurter
fccf115c56 Merge pull request #2054 from hashicorp/f-prestart
Add Driver.Prestart method
2016-12-20 16:18:56 -08:00
Michael Schurter
904543ef1b Remove unneeded env building 2016-12-20 16:14:42 -08:00
Michael Schurter
decee19978 Fix tests broken by TaskEnv change 2016-12-20 14:37:35 -08:00
Michael Schurter
630812bbdd lxc: Set image local env vars 2016-12-20 14:37:18 -08:00
Michael Schurter
5ad7eeaed5 Remove unneeded waitClient field 2016-12-20 14:29:57 -08:00
Michael Schurter
aaa70ab7b8 Append host env vars on every task env 2016-12-20 12:24:24 -08:00
Michael Schurter
6702813233 Fix formatting of downloading image message 2016-12-20 11:57:26 -08:00
Michael Schurter
bbcc27ef1b Use startContainer wrapper 2016-12-20 11:55:40 -08:00
Michael Schurter
50934da2c4 Emit "Downloading image" event 2016-12-20 11:40:34 -08:00
Alex Dadgar
e420d17bfb Small cleanups 2016-12-19 14:22:08 -08:00
Alex Dadgar
feb6f53a53 Merge pull request #1980 from dmexe/network-aliases
Add network_aliases for docker driver
2016-12-19 14:17:48 -08:00
Alex Dadgar
f36ccccdc2 Fix Docker Logging Type interpolation
This PR fixes an issue that made Logging.Type un-interpretable in the
docker driver.
2016-12-19 13:42:58 -08:00
Alex Dadgar
a51adaf609 Merge pull request #2063 from tmichaud314/fix-docker-driver-auth-interpolation
Fixes docker-driver Auth-config interpolation
2016-12-19 13:41:27 -08:00
Alex Dadgar
c2cb2cc11f Fix test and prevent job with payload from being submitted 2016-12-18 16:32:14 -08:00
Alex Dadgar
cb10b277eb Use new combined meta data function in env 2016-12-16 10:45:09 -08:00
Alex Dadgar
92dc04e335 Fix mapstructure tag formatting for lxc driver 2016-12-16 10:24:17 -08:00
Tom Michaud
a3dcd24894 Fixes docker-driver Auth-config interpolation 2016-12-06 13:30:23 -07:00
Michael Schurter
ee17940dfe 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
c72600efd1 Make errors starting a container recoverable
This PR makes errors starting a container recoverable and tries to
optimistically handle 500 errors.
2016-11-30 15:59:47 -08:00
Diptanu Choudhury
a6012560db Merge pull request #2045 from hashicorp/b-docker-create-container
Returning a container if it exists instead of creating a new one
2016-11-29 17:55:33 -08:00
Diptanu Choudhury
3f825bf746 Returning a container if it exists instead of creating a new one 2016-11-29 17:52:19 -08:00
Alex Dadgar
e01e02e7cf add debugging 2016-11-29 14:29:37 -08:00