Commit Graph

1249 Commits

Author SHA1 Message Date
Michael Schurter
900e708577 Properly autodetect Docker IP in Windows
Our Docker network plugin autodetection code was erroneously treating
Window's default network `nat` as a plugin and defaulting to it instead
of the host.

Fixes #3218
2017-09-27 16:49:23 -07:00
Michael Schurter
08f8411163 Only build rkt driver on linux
Build stub for non-linux targets
2017-09-27 14:21:45 -07:00
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
5decea6a59 Ignore rkt network failure if container died early
If the container dies before the network can be read, we now ignore the
error coming out of the network information polling loop. Nomad will
restart the task regardless, so we might be masking the actual error.

The polling loop for the rkt network information, inside the `Start`
method, was getting a bit unwieldy. It's been refactored out so it's not
a seperate function.
2017-09-27 00:15:27 +02: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
b537f16eff Improve rkt driver network status poll loop
The network status poll loop will now report any networks it ignored, as
well as a no-networks situations.
2017-09-26 21:49:45 +02:00
Lasse Dalegaard
eade50b938 Refactor rkt network status loop
The network status poll loop for the rkt drivers `Start` method was a
bit messy, and could not display the last encountered error. Here we
clean it up.
2017-09-26 21:27:12 +02:00
Lasse Dalegaard
a7f5f8a363 Small logging fix in rkt/driver 2017-09-26 19:36:13 +02:00
Lasse Dalegaard
dd934a60a7 Bump minimum rkt version to 1.27.0.
The changes introduces in #3256 require at least rkt 1.27.0 because of
a bug in the JSON output of `rkt status` in previous versions.

Here we upgrade all references to rkt's minimum version, and also make
travis and vagrant use this version when running tests.

Finally we add a CHANGELOG notice.
2017-09-26 19:15:43 +02:00
Lasse Dalegaard
ddec2f1617 Turn rkt network status failure into Start failure
If the rkt driver cannot get the network status, for a task with a
configured port mapping, it will now fail the Start() call and kill the
task instead of simply logging. This matches the Docker behavior.

If no port map is specified, the warnings will be logged but the task
will be allowed to start.
2017-09-26 10:20:57 +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
Lasse Dalegaard
1d75ff8194 Discard errors from rkt status and cat-manifest
Since we don't actually show these errors anywhere, just discard them
right away.
2017-09-26 09:05:47 +02:00
Lasse Dalegaard
bdfd8d8810 Expose rkt DriverNetwork
Currently the rkt driver does not expose a DriverNetwork instance after
starting the container, which means that address_mode = 'driver' does
not work.

To get the container network information, we can call `rkt status` on
the UUID of the container and grab the container IP from there.

For the port map, we need to grab the pod manifest as it will tell us
which ports the container exposes. We then cross-reference the
configured port name with the container port names, and use that to
create a correct port mapping.

To avoid doing a (bad) reimplementation of the appc schema(which rkt
uses for its manifest) and rkt apis, we pull those in as vendored
dependencies. The versions used are the same ones that rkt use in their
glide dependency configuration for version 1.28.0.
2017-09-21 00:34:22 +02:00
Lasse Dalegaard
3dafacdd72 Use rkt prepare + run-prepared instead of run.
The rkt driver currently executes run and asks that the pod UUID is
written to a file that is then polled for changes for up to five
seconds. Many container fetches will take longer than this, so this
method will often not be able to track the pod UUID reliably.

To avoid this problem, rkt allows pods to be first prepared, which will
return their UUID, and then run as a second invocation.

Here we convert the rkt driver's Start method to use this method
instead. This way, the UUID will always be tracked correctly.
2017-09-21 00:17:31 +02:00
epipho
56d591b119 Fix incorrect docker stats 2017-09-16 00:43:03 -04:00
Alex Dadgar
1bed4b41d9 Merge pull request #3187 from hashicorp/b-windows-docker
Fix MemorySwappiness on Windows Docker
2017-09-11 09:56:49 -07:00
Alex Dadgar
7148b65306 Fix MemorySwappiness on Windows Docker
Fixes https://github.com/hashicorp/nomad/issues/3181
2017-09-10 17:46:45 -07:00
Alex Dadgar
9206105e69 Fix docker user specified syslogging 2017-09-10 14:57:48 -07:00
Alex Dadgar
d8d4fb877b Merge pull request #3148 from clinta/purge-stopped
Always purge stopped containers
2017-09-05 17:18:05 -07:00
Alex Dadgar
4cab1781f6 Fix repo name passed to docker credential helpers
This PR fixes the server url passed to docker credential helpers and
fixes stderr capture.

Fixes https://github.com/hashicorp/nomad/issues/2957
2017-09-05 16:43:21 -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
Clint Armstrong
786c09f7e4 Always purge stopped containers 2017-08-31 14:28:48 -04:00
Clint Armstrong
cfffce07a0 fix logging re-init 2017-08-30 12:36:31 -04:00
Alex Dadgar
ba1eecbf7f Merge pull request #3073 from clinta/docker-500
Allow retry of 500 API errors to be handled by restart policies
2017-08-24 16:57:36 -07:00
Alex Dadgar
bf072b61fc resolve feedback 2017-08-23 14:17:00 -07:00
Alex Dadgar
8099655836 Clean up docker mounts 2017-08-22 14:12:44 -07:00
Clint Armstrong
6b98ddfb1e Allow retry of 500 API errors to be handled by restart policies 2017-08-22 14:04:46 -04:00
Michael Schurter
ad940977fa Merge pull request #3021 from clinta/docker-mount2
Expose docker mount options
2017-08-17 16:57:09 -07:00
Clint Armstrong
1378f03052 restrict mount to volume type 2017-08-17 09:52:13 -04:00
Alex Dadgar
c26ecb7092 Add version package
This PR adds a version package and consolidates version strings into a
Version struct.
2017-08-16 15:44:21 -07:00
Jan De Cooman
d7cdb7d848 updated message in test 2017-08-11 09:24:15 +02:00
Clint Armstrong
c71ac6a825 expose mount options to nomad 2017-08-10 12:37:17 -04:00
Jan De Cooman
ce8550d6fb fixed typo 2017-08-09 14:44:38 +02:00
Jan De Cooman
b4ec045e9a added dnsoptions to the docker driver 2017-08-09 13:30:06 +02:00
Luke Farnell
7a56971508 fixed all spelling mistakes for goreport 2017-08-07 17:13:05 -04:00
Michael Schurter
1585a5b2b9 Merge pull request #2883 from kmalec/add-support-for-readonly-mount
rkt driver support for read-only volumes mounts
2017-07-31 10:58:22 -07:00
Alex Dadgar
212fed63df Fix leaked plugin files for syslog server
This PR fixes a leaking of the unix socket used when launching a syslog
server for the Docker driver.

Fixes https://github.com/hashicorp/nomad/issues/2844
2017-07-30 17:51:38 -07:00
Alex Dadgar
80c4b03f07 fix vet 2017-07-22 22:43:33 -07:00
Alex Dadgar
fdd77dcaa0 travis check fixes 2017-07-22 21:01:22 -07:00
Alex Dadgar
70040f2574 fingerprinters 2017-07-22 20:38:03 -07:00
Alex Dadgar
4c89212f0a drop rkt deadline 2017-07-22 19:54:06 -07:00
Alex Dadgar
4c7c3c45e2 Merge branch 'master' of github.com:hashicorp/nomad 2017-07-22 19:48:54 -07:00
Alex Dadgar
22c5999c09 darwin test fixes 2017-07-22 19:48:47 -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
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
Alex Dadgar
d4e35815a1 executor and logging pkg 2017-07-21 12:14:54 -07:00
Alex Dadgar
789a5072a9 Parallel 2017-07-21 12:06:39 -07:00