Michael Schurter
caf317e3f2
Use a DriverAbility to expose Exec functionality
2017-04-19 12:42:47 -07:00
Alex Dadgar
4ecebe7d8c
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
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
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
Michael Schurter
4a9a574d9d
Merge pull request #2054 from hashicorp/f-prestart
...
Add Driver.Prestart method
2016-12-20 16:18:56 -08:00
Michael Schurter
0d90e96925
lxc: Set image local env vars
2016-12-20 14:37:18 -08:00
Alex Dadgar
7778339f03
Fix mapstructure tag formatting for lxc driver
2016-12-16 10:24:17 -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
Ranjib Dey
0b29ad8787
Fix error message. Pass on template args
2016-11-21 20:12:59 -08:00
Michael Schurter
b84d8212ff
Add LXC docs and enable by default for lxc builds
2016-11-01 10:18:16 -07:00
Michael Schurter
f430203505
Put lxc support behind a flag
...
Since lxc support requires linking to a C lib at compile and runtime
I'm putting it behind a build flag to avoid forcing all nomad users to
install liblxc (lxc-dev for development).
2016-10-26 14:55:54 -07:00
Michael Schurter
98600b5943
Fix LXC driver interface impls
2016-10-26 10:06:03 -07:00
Diptanu Choudhury
b5cc153d54
Added lxc related dependencies
2016-10-25 15:17:02 -07:00
Michael Schurter
d937d3aede
Fix comment form
2016-10-21 16:56:33 -07:00
Michael Schurter
34f7cbd10f
Disable lxc by default
2016-10-13 13:22:12 -07:00
Michael Schurter
1dbb2b7164
Cleanup comments/whitespace
2016-10-13 13:05:55 -07:00
Michael Schurter
38b2020291
Mount secret dir
2016-10-13 12:45:33 -07:00
Diptanu Choudhury
4e86a5f906
throwing an error if stats line can't be converted to k/v pair
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
ea5d9d959a
Bind mounting alloc dir into container
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
6312ea3f8f
Setting the network type
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
ce334e0e04
Adding cpu resource limits
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
bb2a580ef1
Implemented an LXC Driver
2016-10-12 17:18:58 -07:00