Commit Graph

146 Commits

Author SHA1 Message Date
Alex Dadgar
4c89212f0a drop rkt deadline 2017-07-22 19:54:06 -07:00
Alex Dadgar
08c2ba9bc6 Parallel client tests (#2890)
* alloc_runner

* Random tests

* parallel task_runner and no exec compatible check

* Parallel client

* Fail fast and use random ports

* Fix docker port mapping

* Make concurrent pull less timing dependant

* up parallel

* Fixes

* don't build chroots in parallel on travis

* Reduce parallelism on travis with lxc/rkt

* make java test app not run forever

* drop parallelism a little

* use docker ports that are out of the os's ephemeral port range

* Limit even more on travis

* rkt deadline
2017-07-22 19:04:36 -07:00
Michael Schurter
9eb1a87c47 rkt: use %s instead of %q when interpolating env
Fixes #2686
2017-07-05 09:36:17 -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
9f362d6557 Fix bad merge conflict resolution 2017-06-09 10:40:47 -07:00
Michael Schurter
a58b5e18cb Merge branch 'master' into add-no-overlay-option 2017-06-08 13:15:56 -07:00
Karel Malec
0c21187af7 Fix backticks in docs; refine --debug comment 2017-06-07 21:11:22 +02:00
Karel Malec
cd713ce193 Added insecure_options config list 2017-06-07 09:58:42 +02:00
Karel Malec
d43de0e9cd Add a no_overlay option for the rkt task config. 2017-06-07 00:17:33 +02:00
Michael Schurter
c4aa3c38cc Always use PATH-only env for rkt commands 2017-05-26 15:41:26 -07:00
Michael Schurter
fc5254d4b1 Use custom TaskEnv to provide PATH for rkt 2017-05-26 15:24:14 -07:00
Michael Schurter
a96fb5dbb0 Move task env into execcontext
Also inject PATH into rkt commands since we're no longer appending host
env vars for it.
2017-05-23 13:53:34 -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
ace00980a1 Refactor TaskEnvironment into Builder and TaskEnv 2017-05-23 13:53:33 -07:00
Michael Schurter
426c696404 Reuse ExecScript implementation 2017-05-04 16:21:40 -07:00
Michael Schurter
29f222d461 Change raw_exec to use simplified exec wrapper 2017-04-21 16:50:20 -07:00
Michael Schurter
0e0845e94b Use a DriverAbility to expose Exec functionality 2017-04-19 12:42:47 -07:00
Michael Schurter
10cb924b2c Refactor Consul Syncer into new ServiceClient
Fixes #2478 #2474 #1995 #2294

The new client only handles agent and task service advertisement. Server
discovery is mostly unchanged.

The Nomad client agent now handles all Consul operations instead of the
executor handling task related operations. When upgrading from an
earlier version of Nomad existing executors will be told to deregister
from Consul so that the Nomad agent can re-register the task's services
and checks.

Drivers - other than qemu - now support an Exec method for executing
abritrary commands in a task's environment. This is used to implement
script checks.

Interfaces are used extensively to avoid interacting with Consul in
tests that don't assert any Consul related behavior.
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
07b85bb8d8 Replace _ with - in task names for rkt volumes
Fixes #2358
2017-03-07 14:34:57 -08:00
Alex Dadgar
4ba4987625 Drivers log during fingerprinting
This PR fixes a regression in which some drivers did not log during
fingerprinting.
2017-02-20 19:35:51 -08:00
Michael Schurter
269b3c7e14 Merge pull request #2186 from hashicorp/f-driver-cleanup
Add Cleanup method to Driver interface
2017-01-20 13:02:14 -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
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
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
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
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
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
Michael Schurter
119198f022 rkt: Support host and none dns options
Fixes #2025
2016-11-28 13:13:40 -08:00
Michael Schurter
449194eb47 Fix rkt volumes
I forgot to validate the volumes field!
2016-11-28 13:13:40 -08:00
Alex Dadgar
a90b84afd8 Rkt env var 2016-11-08 15:14:04 -08:00
Alex Dadgar
12c033ab81 Move the wait result to bottom of methods 2016-11-04 14:58:55 -07:00
Michael Schurter
294b7b306d Fix tests for rkt port map 2016-10-25 17:06:41 -07:00
Kenjiro Nakayama
f59a6f7362 driver.rkt: support port mapping with net and port options 2016-10-25 15:41:49 -07:00
Alex Dadgar
b0749c7bd4 Merge pull request #1839 from hashicorp/f-signal-constraints
Signal creates an auto-constraints
2016-10-25 11:09:33 -07:00
Michael Schurter
da7e3f318b Fingerprint rkt volume support and make periodic
Fix rkt docs and custom volume mounting
2016-10-25 09:46:49 -07:00
Michael Schurter
89a1b60c1b Enable rkt and docker volume mounting by default 2016-10-25 09:46:49 -07:00
Michael Schurter
5ed12860af Make volume name unique 2016-10-25 09:46:49 -07:00
Michael Schurter
f23cd482c7 Bump minimum required rkt version; update docs
Make section names match between docker and rkt
2016-10-25 09:46:49 -07:00
Michael Schurter
6af70e005e Add arbitrary volume support to rkt 2016-10-25 09:46:49 -07:00
Michael Schurter
ec1b44e7e6 Fix standard mounts in rkt and tests 2016-10-25 09:46:49 -07:00
Alex Dadgar
008d91aa56 Advertise signalling abilities 2016-10-19 15:06:23 -07:00
Alex Dadgar
917c7e5085 Merge pull request #1801 from hashicorp/f-signals
Consul-template signal change mode
2016-10-18 11:23:47 -07:00
Alex Dadgar
358c43333d Send Executor Ctx separately 2016-10-12 11:35:29 -07:00
Alex Dadgar
1de16a3847 Rkt 2016-10-10 11:47:04 -07:00
Alex Dadgar
1a3585b572 Docker + Qemu 2016-10-10 11:47:04 -07:00
Kenjiro Nakayama
0e092ef326 driver.rkt: Remove unnecessary job validation 2016-08-16 23:33:34 +09:00
Alex Dadgar
e2b7b86883 Merge pull request #1581 from nak3/fix-rkt2
Set host environment variables to taskEnv of rkt driver
2016-08-15 10:31:10 -07:00