Commit Graph

136 Commits

Author SHA1 Message Date
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Alex Dadgar
b9f51ce61c Parse Docker mounts correctly (#3163)
* Parse Docker mounts correctly

This PR fixes the parsing of Docker mounts and adds testing to ensure no
regressions.

Fixes https://github.com/hashicorp/nomad/issues/3156

* Review feedback
2017-09-05 14:02:57 -07:00
Jan De Cooman
d7cdb7d848 updated message in test 2017-08-11 09:24:15 +02:00
Jan De Cooman
b4ec045e9a added dnsoptions to the docker driver 2017-08-09 13:30:06 +02: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
ef98449b07 Merge pull request #2787 from hashicorp/f-docker-test-mac
Test #2652 - Docker MAC Address option
2017-07-07 16:22:10 -07:00
Michael Schurter
38bf16d2ef Add driver.docker.bridge_ip node attribute
Fixes #2785
2017-07-07 10:14:10 -07:00
Michael Schurter
eaab2b2eee Test #2652
Also cleanup docker config opts docs
2017-07-06 12:46:25 -07:00
Michael Schurter
8c32582d38 Fix some tests still expecting reverted behavior 2017-06-23 16:51:38 -07:00
Michael Schurter
8a7df57227 Test driver network advertisement and checks 2017-06-21 17:19:08 -07:00
Ulrik Mikaelsson
20fd19d6e2 Implement support for docker-credential-helpers
Solves: #2334
2017-05-31 12:45:02 +02:00
Michael Schurter
9ccb53d561 Let's pretend I never committed this 2017-05-26 15:06:59 -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
Brandon Fulljames
dc95acdcc6 Fix for test 2017-05-19 16:59:07 -07:00
Brandon Fulljames
b0304477a2 Add SecurityOpt as a config field in Docker driver 2017-05-19 16:18:49 -07:00
Alex Dadgar
1dbd63ad2a Split driver tests 2017-04-04 15:12:14 -07:00
Michael Schurter
4d3c571859 Merge pull request #2482 from hashicorp/f-2289-better-artifact-err
Improve artifact download error message
2017-03-28 12:48:22 -07:00
Michael Schurter
ae9d49502a Recoverable struct field must be exported 2017-03-28 12:18:57 -07:00
Michael Schurter
6a4e1d1709 Recoverable is a method now, not a field 2017-03-27 15:41:35 -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
6535aa8d95 Fix API breaks in tests 2017-03-02 15:50:18 -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
Alex Dadgar
5338dafd51 Merge pull request #2361 from hashicorp/f-docker-coordination
Docker Image Coordinator and caching
2017-02-24 14:18:21 -08:00
Alex Dadgar
27b2c677c0 Docker Image Coordinator
This PR introduces a coordinator for doing CRUD on a Docker image. It
should fix racy deletion of images. The issue before was images would be
deleted between prestart and start causing an error.
2017-02-24 13:20:40 -08:00
Michael Schurter
d710c23d4d Put access to Docker volume drivers behind flag 2017-02-23 15:47:36 -08:00
Alex Dadgar
e9d8a6aa72 Revendor docker client 2017-02-14 17:34:05 -08:00
Alex Dadgar
77b19f55a0 Add test and better logs
This commit adds a test to retrieving auth configurations, use either
the auth block in the config or specified via the agent config and adds
a log if lookup fails.
2017-01-23 14:48:02 -08:00
Michael Schurter
a17c3a9ded Updated CreatedResources as images are cleaned 2017-01-17 16:13:40 -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
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
e2a09752b5 add force_pull to docker driver 2017-01-10 16:54:01 -06:00
Michael Schurter
59c501f474 Driver is now required in test tasks 2017-01-06 11:39:17 -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
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
decee19978 Fix tests broken by TaskEnv change 2016-12-20 14:37:35 -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
Dmitry Galinsky
49416ebf4c Add network_aliases for docker driver 2016-11-16 11:16:07 +03:00
Alex Dadgar
0aad09c239 Remove todo 2016-11-10 15:20:19 -08:00
Alex Dadgar
e246167dc5 Changes the relative path from joining against the alloc dir to the
task's directory.

This PR changes the behavior when given a relative host path when
mounting docker containers. Prior to this, the behavior was to mount by
joining against the alloc/ directory. This PR changes it to be against
the task/ directory.
2016-11-10 14:47:54 -08:00
Alex Dadgar
f3bd7a8a69 Add docker test 2016-10-28 17:53:25 -07:00
Alex Dadgar
8864f6f9a5 Don't delete docker images in test 2016-10-27 12:31:53 -07:00
Michael Schurter
98debf5320 Expand env vars in docker volume paths
Fixes #1876
2016-10-27 11:02:38 -07:00
Michael Schurter
fe7179c8ee Allow mounting alloc-dir-relative paths in docker 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
Alex Dadgar
ceecfbbdef Merge pull request #1845 from hashicorp/f-remove-disk-usage-acct
Remove disk usage enforcement
2016-10-22 19:01:51 -07:00