Commit Graph

304 Commits

Author SHA1 Message Date
Michael Schurter
a087a8be79 Fix inconsistent task env setting
Consolidate task environment building in GetTaskEnv since it can
determine what kind of filesystem isolation is used.

This means drivers no longer have to manipulate task environment paths.
2017-01-06 12:19:32 -08:00
Michael Schurter
86db19407e Remove task name prefix from executor logs 2017-01-05 16:31:56 -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
5ad7eeaed5 Remove unneeded waitClient field 2016-12-20 14:29:57 -08:00
Michael Schurter
6702813233 Fix formatting of downloading image message 2016-12-20 11:57:26 -08:00
Michael Schurter
bbcc27ef1b Use startContainer wrapper 2016-12-20 11:55:40 -08:00
Michael Schurter
50934da2c4 Emit "Downloading image" event 2016-12-20 11:40:34 -08:00
Alex Dadgar
e420d17bfb Small cleanups 2016-12-19 14:22:08 -08:00
Alex Dadgar
feb6f53a53 Merge pull request #1980 from dmexe/network-aliases
Add network_aliases for docker driver
2016-12-19 14:17:48 -08:00
Alex Dadgar
f36ccccdc2 Fix Docker Logging Type interpolation
This PR fixes an issue that made Logging.Type un-interpretable in the
docker driver.
2016-12-19 13:42:58 -08:00
Alex Dadgar
a51adaf609 Merge pull request #2063 from tmichaud314/fix-docker-driver-auth-interpolation
Fixes docker-driver Auth-config interpolation
2016-12-19 13:41:27 -08:00
Tom Michaud
a3dcd24894 Fixes docker-driver Auth-config interpolation 2016-12-06 13:30:23 -07: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
c72600efd1 Make errors starting a container recoverable
This PR makes errors starting a container recoverable and tries to
optimistically handle 500 errors.
2016-11-30 15:59:47 -08:00
Diptanu Choudhury
a6012560db Merge pull request #2045 from hashicorp/b-docker-create-container
Returning a container if it exists instead of creating a new one
2016-11-29 17:55:33 -08:00
Diptanu Choudhury
3f825bf746 Returning a container if it exists instead of creating a new one 2016-11-29 17:52:19 -08:00
Alex Dadgar
e01e02e7cf add debugging 2016-11-29 14:29:37 -08:00
Diptanu Choudhury
26bb30ed14 Fixes an issue with purging containers with the same name Nomad is trying to start 2016-11-28 17:37:22 -08:00
Alex Dadgar
0ed5967410 Merge pull request #2029 from gliptak/dockerauth1
Log when lookup in docker.auth.config fails
2016-11-28 12:45:19 -08:00
Alex Dadgar
49ee34c1e3 Make container exist errors non-retriable
This change makes it so that the task runner does not retry container
exists errors and also a sleep is added on the local retry.
2016-11-25 19:22:58 -08:00
Gábor Lipták
72f895688d Log when lookup in docker.auth.config fails 2016-11-23 18:43:58 -05:00
Dmitry Galinsky
49416ebf4c Add network_aliases for docker driver 2016-11-16 11:16:07 +03: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
4e5c7efcf6 remove debug 2016-11-08 14:21:37 -08:00
Alex Dadgar
a9da2583d2 Interpolate everything that is a string 2016-11-08 14:20:51 -08:00
Alex Dadgar
17cab6e932 Fix env vars relating to secretdir 2016-11-08 12:28:43 -08:00
Alex Dadgar
38680afa0b Merge pull request #1938 from hashicorp/b-docker-reattach
Fix Docker container creation and task runner updating
2016-11-04 17:14:40 -07:00
Michael Schurter
9750b8c8f7 Add userns_mode docker config option
Fixes #1904
2016-11-04 16:53:56 -07:00
Alex Dadgar
12c033ab81 Move the wait result to bottom of methods 2016-11-04 14:58:55 -07:00
Alex Dadgar
55e7d6f7c6 Create container much more robust 2016-11-04 14:39:56 -07:00
Alex Dadgar
6a0999c11f More recoverable errors 2016-11-02 10:36:04 -07:00
Alex Dadgar
d70fd7e426 Fix passing of recoverable error from docker pull 2016-10-28 17:49:46 -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
Alex Dadgar
a186f7a26d Merge pull request #1806 from hashicorp/f-docker4mac-fixes
A couple fixes to make Docker For Mac work
2016-10-27 09:29:40 -07:00
Alex Dadgar
00ce1e50f5 Fix panic 2016-10-25 17:27:13 -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
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
42f7bc8e81 Thread through whether DeriveToken error is recoverable or not 2016-10-22 18:08:30 -07:00
Alex Dadgar
008d91aa56 Advertise signalling abilities 2016-10-19 15:06:23 -07:00
Alex Dadgar
d7673670fc Actually mount the local directory 2016-10-18 15:57:12 -07:00
Alex Dadgar
e34902ae8a Large refactor of task runner and Vault token rehandling 2016-10-18 11:24:20 -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
Evan Phoenix
cb64cfe820 Disable the syslog logging system on Docker For Mac
The syslog logging system depends on the ability for a unix socket to be
accessed by the docker daemon in the $TMPDIR of the host. This doesn't
work on Docker For Mac because the docker daemon is running inside a VM,
and while /tmp is accessible, the filesystem used to share them doesn't
support unix socket files, and thus it doesn't work.
2016-10-12 17:07:21 -07:00
Alex Dadgar
1a017c6afd add plugin kill 2016-10-12 13:24:22 -07:00
Alex Dadgar
358c43333d Send Executor Ctx separately 2016-10-12 11:35:29 -07:00
Alex Dadgar
1a3585b572 Docker + Qemu 2016-10-10 11:47:04 -07:00