Alex Dadgar
5d4b0ab016
typo
2017-07-22 12:55:30 -07:00
Alex Dadgar
f30e5a5984
typo
2017-07-22 12:33:07 -07:00
Alex Dadgar
3cb16aa9a8
small fixes
2017-07-22 12:25:02 -07:00
Michael Schurter
3fddb05fc8
Implement DriverNetwork and Service.AddressMode
...
Ideally DriverNetwork would be fully populated in Driver.Prestart, but
Docker doesn't assign the container's IP until you start the container.
However, it's important to setup the port env vars before calling
Driver.Start, so Prestart should populate that.
2017-06-21 17:19:08 -07:00
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
0e0845e94b
Use a DriverAbility to expose Exec functionality
2017-04-19 12:42:47 -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
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
Michael Schurter
1ec5c930a6
Return errors from cleanup and let TaskRunner retry
2017-01-12 17:21:54 -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
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
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
630812bbdd
lxc: Set image local env vars
2016-12-20 14:37:18 -08:00
Alex Dadgar
92dc04e335
Fix mapstructure tag formatting for lxc driver
2016-12-16 10:24:17 -08: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
Ranjib Dey
1aaceafecc
Fix error message. Pass on template args
2016-11-21 20:12:59 -08:00
Michael Schurter
ba0983c35a
Add LXC docs and enable by default for lxc builds
2016-11-01 10:18:16 -07:00
Michael Schurter
aeb410c07c
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
7eae82191e
Fix LXC driver interface impls
2016-10-26 10:06:03 -07:00
Diptanu Choudhury
b0c665ce26
Added lxc related dependencies
2016-10-25 15:17:02 -07:00
Michael Schurter
317922642f
Fix comment form
2016-10-21 16:56:33 -07:00
Michael Schurter
1566b979e3
Disable lxc by default
2016-10-13 13:22:12 -07:00
Michael Schurter
af8a20bc7d
Cleanup comments/whitespace
2016-10-13 13:05:55 -07:00
Michael Schurter
487a4980e0
Mount secret dir
2016-10-13 12:45:33 -07:00
Diptanu Choudhury
14294fde77
throwing an error if stats line can't be converted to k/v pair
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
d4fba69b95
Bind mounting alloc dir into container
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
9ae6c0e8d4
Setting the network type
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
340efc879d
Adding cpu resource limits
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
7300ea8463
Implemented an LXC Driver
2016-10-12 17:18:58 -07:00