Commit Graph

65 Commits

Author SHA1 Message Date
Michael Schurter
eeeb544a2d Merge pull request #3256 from dalegaard/master
Enable rkt driver to use address_mode = 'driver'
2017-09-26 18:04:37 -05:00
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Lasse Dalegaard
c359ba44a5 Make rkt port mapping test not exit immediately
The rkt port mapping test currently starts redis with --version, which
obviously makes redis exit again almost immediately. This means that the
container exists before the network status can be queried, and so the
test fails.
2017-09-26 23:10:24 +02:00
Lasse Dalegaard
3dd16a2212 Test for rkt driver setting DriverNetwork
To test that the rkt driver correctly sets a DriverNetwork, at least
when a port mapping is requested, we amend the
TestRktDriver_PortsMapping test with a small check.
2017-09-26 09:10:50 +02:00
Alex Dadgar
fdd77dcaa0 travis check fixes 2017-07-22 21:01:22 -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
Alex Dadgar
789a5072a9 Parallel 2017-07-21 12:06:39 -07:00
Michael Schurter
8a7df57227 Test driver network advertisement and checks 2017-06-21 17:19:08 -07:00
Michael Schurter
426c696404 Reuse ExecScript implementation 2017-05-04 16:21:40 -07:00
Michael Schurter
db8aabe1c3 Fix circular test imports 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
Michael Schurter
07b85bb8d8 Replace _ with - in task names for rkt volumes
Fixes #2358
2017-03-07 14:34:57 -08:00
Alex Dadgar
07f7e19578 Fix vet script and fix vet problems
This PR fixes our vet script and fixes all the missed vet changes.

It also fixes pointers being printed in `nomad stop <job>` and `nomad
node-status <node>`.
2017-02-27 16:00: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
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
Alex Dadgar
fb56132830 respond to comment 2016-11-15 16:27:07 -08:00
Alex Dadgar
756738d9f1 Fix TestRktDriver_PortsMapping and TestAgent_LoadKeyrings 2016-11-15 15:49:05 -08:00
Michael Schurter
294b7b306d Fix tests for rkt port map 2016-10-25 17:06:41 -07:00
Kenjiro Nakayama
82c1e7914e driver.rkt: add rkt drriver port mapping test 2016-10-25 15:41:49 -07:00
Michael Schurter
89a1b60c1b Enable rkt and docker volume mounting by default 2016-10-25 09:46:49 -07:00
Michael Schurter
da46ce29c2 Fix docker reference in rkt test 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
1de16a3847 Rkt 2016-10-10 11:47:04 -07:00
Alex Dadgar
4bae54741e Secret dir materialized in alloc/task directory 2016-09-02 12:44:05 -07:00
Alex Dadgar
335cababe1 Revert "Introduce a Secret/ directory" 2016-09-01 17:23:15 -07:00
Alex Dadgar
46ce8dd020 Interface + tests 2016-08-30 21:40:32 -07:00
Kenjiro Nakayama
c2a38d6773 Add TestRktTaskValidate 2016-08-04 23:15:13 +09:00
Kenjiro Nakayama
6b72f2cbc1 Add TestRktTrustPrefix 2016-08-04 17:26:10 +09:00
Diptanu Choudhury
cab0d3eea7 Introduced an env var for rkt tests 2016-07-11 15:48:16 -06:00
Diptanu Choudhury
1b137e4344 Skipping travis tests and not installing rkt on travis 2016-07-11 15:10:09 -06:00
Miquel Sabaté Solà
b41608df51 client/driver: added more tests
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
2016-03-24 08:47:23 +01:00
Alex Dadgar
0e25872895 fmt rkt test 2016-03-10 14:56:43 -08:00
Abhishek Chanda
f19fb4a374 Enable passing DNS info to the rkt driver 2016-03-08 18:59:11 -08:00
Alex Dadgar
022b6dd528 Fix bug introduced with paused nack timers 2016-03-04 16:17:14 -08:00
Abhishek Chanda
d8d62aaddf Fix location of volume mount
Also add a test for mounting alloc dirs
2016-03-02 14:04:14 -08:00
Abhishek Chanda
aa288c91d0 A number of cleanups
- Removed some unused variables.
2016-03-02 14:04:14 -08:00
Abhishek Chanda
0f4472d94f Change name of the stdout file 2016-03-02 14:04:14 -08:00
Abhishek Chanda
fb2607bcec Use the plugin mechanism in the rkt driver 2016-03-02 14:04:14 -08:00
Abhishek Chanda
877dd7de61 Defer cleanup 2016-03-02 14:04:14 -08:00
Abhishek Chanda
1a9438cdd1 Use less resources for containers 2016-03-02 14:04:14 -08:00
Abhishek Chanda
adf0c0677f A number of rkt fixes
- Reorder rkt arguments to make it work
- Change a few things in test
2016-03-02 14:04:14 -08:00
Alex Dadgar
e0c23ec2cd Use TestMultiplier on all waits 2016-01-21 15:24:24 -08:00
Alex Dadgar
dccbc0320b Fix tests 2016-01-11 09:58:31 -08:00
Alex Dadgar
9f44780f89 User specifiable kill timeout and operator configurable max 2015-12-22 16:10:30 -08:00
Abhishek Chanda
19bcf4fce3 Run gofmt 2015-12-21 06:09:11 +00:00
Abhishek Chanda
6f3210e3d7 Support CPU and meory isolators for the rkt driver
The rkt community added supprt for these isolators recently
2015-12-21 06:06:45 +00:00
Alex Dadgar
7357979089 Revert "Revert "Make drivers take arguments as a list and not as a string"" 2015-11-18 15:16:42 -08:00
Alex Dadgar
d666f5bde1 Revert "Make drivers take arguments as a list and not as a string" 2015-11-18 13:46:43 -08:00