Commit Graph

1353 Commits

Author SHA1 Message Date
Michael Schurter
7b9b8b7d7b Merge pull request #3798 from simar7/qemu-graceful-shutdown-bug
[QEMU] Fixing an unintentional variable shadowing
2018-01-30 17:43:44 -08:00
Michael Schurter
d50ae8a92b Merge pull request #3773 from mikemccracken/2018-01-18/destroy-container-on-err
lxc: cleanup partially configured containers after errors in Start
2018-01-30 14:52:29 -08:00
Alex Dadgar
3c8a76a2fe Merge pull request #3799 from mikemccracken/2018-01-25/lxc-log-outside-container
lxc: move lxc log file out of container-visible alloc dir
2018-01-29 14:32:22 -08:00
Alex Dadgar
d11fdc7e10 Merge pull request #3802 from filipochnik/docker-readonly-rootfs
Add ReadonlyRootfs option to the Docker driver
2018-01-29 09:47:27 -08:00
Indradhanush Gupta
686c5d48e6 rkt_test.go: Remove underscore from variable names 2018-01-29 11:39:50 +01:00
Filip Ochnik
7507a1e161 Add ReadonlyRootfs option to the Docker driver 2018-01-27 14:38:29 +01:00
Simarpreet Singh
19e1a7fd61 qemu: Make the driver debugging output more indicative
Signed-off-by: Simarpreet Singh <simar@linux.com>
2018-01-25 16:40:16 -08:00
Simarpreet Singh
1223a5705e qemu: Fix unintentional shadowing of monitorPath variable
Signed-off-by: Simarpreet Singh <simar@linux.com>
2018-01-25 16:24:10 -08:00
Michael McCracken
2e72eea00a lxc: move lxc log file out of container-visible alloc dir
The LXC runtime's log file is currently written to TaskDir.LogDir,
which is mounted as alloc/logs inside the containers in the task
group.

This file is not intended to be visible to containers, and depending
on the log level, may have information about the host that a container
should not be allowed to see.

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-25 14:41:37 -08:00
Michael McCracken
2dd31f2cc7 fix speling in log
Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-25 13:56:14 -08:00
Michael McCracken
81f64eea27 review cleanup
don't export an internal function, and simplify some code

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-23 15:03:09 -08:00
Alex Dadgar
0cf5c76326 Allow overriding an image's entrypoint in Docker
Fixes https://github.com/hashicorp/nomad/issues/2219
2018-01-23 14:05:00 -08:00
Alex Dadgar
ec764f7654 Merge pull request #3754 from filipochnik/docker-caps
Add an option to add and drop capabilities in the Docker driver
2018-01-23 12:02:50 -08:00
Filip Ochnik
b509b0a680 Merge branch 'master' into docker-caps 2018-01-21 12:18:22 +01:00
Filip Ochnik
4080aac002 Finish implementation of the capabilities whitelist 2018-01-21 12:14:24 +01:00
Michael McCracken
0e9bae7bb4 lxc: cleanup partially configured containers after errors in Start
If there are any errors in container setup after c.Create() in
Start(), the container will be left around, with no way to clean it up
because the handle will not be created or returned from Start.

Added a wrapper that checks for errors and performs appropriate
cleanup. Returning a cleanup function from a wrapped function instead
of just doing the cleanup before returning the error helps to ensure
that future changes that might add or change error exits can't forget
to consider a cleanup function.

Adds a check to the invalid config test case to check that a container
created with an invalid config doesn't get left behind.

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-18 16:03:03 -08:00
Michael Schurter
6d77215f37 Improve driver network logging 2018-01-18 15:35:24 -08:00
Michael Schurter
cde796162c Always advertise driver IP when in driver mode
Fixes #3681

When in drive address mode Nomad should always advertise the driver's IP
in Consul even when no network exists. This matches the 0.6 behavior.

When in host address mode Nomad advertises the alloc's network's IP if
one exists. Otherwise it lets Consul determine the IP.

I also added some much needed logging around Docker's network discovery.
2018-01-18 15:35:24 -08:00
Michael McCracken
561376e3b9 lxc_test: add test for contents of file in bind-mounted dir
Ensure that bind mounting via the volumes config really did work.

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-18 05:36:45 -08:00
Michael McCracken
f86fbdcf1a Simplify with gofmt -s
Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-18 04:17:42 -08:00
Michael McCracken
8331cbdd57 lxc: add tests for volume support
Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-18 04:17:42 -08:00
Michael McCracken
bbdd58963d lxc: Add config flag to disable volume support
Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-18 04:17:42 -08:00
Michael McCracken
b597916a95 Add volumes config to LXC driver
Allow lxc driver to accept bind mount config similarly to the docker
driver.

Includes some static sanity checks in Validate step

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
2018-01-18 04:17:42 -08:00
Filip Ochnik
8f23c958e4 Add a sketch of capabilities whitelist logic for the Docker driver 2018-01-14 20:01:47 +01:00
Filip Ochnik
7f072ab2da Add an option to add and drop capabilities in the Docker driver 2018-01-14 19:56:57 +01:00
Alex Dadgar
47f90683fb Remove networking from basic resources 2018-01-12 14:33:42 -08:00
Charlie Voiselle
45c3d8d5a1 Found more priviledge.
priviledge -> privilege
2018-01-12 09:44:53 -05:00
Charlie Voiselle
8d6bd6dca4 fix typo
Priviledge -> privilege
2018-01-08 15:56:07 -05:00
Michael Schurter
0c2c3568a6 Skip tests that require root when not root
Also skip Chown on allocdir migration on Windows and when non-root.
Windows doesn't support it, and it will always fail as a non-root user.
2017-12-12 16:58:27 -08:00
Alex Dadgar
db63054740 Keyify struct 2017-12-11 17:23:14 -08:00
Michael Schurter
b79194f96c Fix test broken by mock updates 2017-12-08 16:45:25 -08:00
Michael Schurter
74e7d57b75 Test Consul from TaskRunner thoroughly
Rely less on the mockConsulServiceClient because the real
consul.ServiceClient needs all the testing it can get!
2017-12-08 12:03:00 -08:00
Chelsea Holland Komlo
ae10b638db code review fixes 2017-12-07 13:46:25 -05:00
Chelsea Holland Komlo
f09e3ec798 set default kill signal on executor shutdown 2017-12-07 11:40:15 -05:00
Chelsea Holland Komlo
27b666e935 extend configurable kill signal to java driver 2017-12-07 11:40:10 -05:00
Chelsea Holland Komlo
927c0a4d88 change location of default kill signal 2017-12-06 17:48:25 -05:00
Chelsea Holland Komlo
8356c6183c extract signal helper into utils 2017-12-06 14:36:44 -05:00
Chelsea Holland Komlo
9e49836d4f move kill_signal to task level, extend to docker 2017-12-06 14:36:39 -05:00
Chelsea Holland Komlo
079e6b5fb1 allow controlling the stop signal in exec/raw_exec 2017-12-06 11:28:45 -05:00
Chelsea Komlo
fef15f447a Merge pull request #3612 from hashicorp/docker-rkt-user
Set user for rkt tasks
2017-12-05 17:45:08 -05:00
Chelsea Holland Komlo
c4e1dc339d fix up test 2017-12-05 10:12:40 -05:00
Chelsea Holland Komlo
723e47c98c remove unused user option 2017-12-04 18:01:31 -05:00
Michael Schurter
104e0e5b19 Merge pull request #3615 from hashicorp/b-rkt-host-ports
rkt: Don't require port_map with host networking
2017-12-04 14:49:42 -08:00
Chelsea Holland Komlo
23b7042dd5 add ability to specify user for rkt 2017-12-04 14:21:48 -05:00
Michael Schurter
730e2aa4c8 rkt: Don't require port_map with host networking
Also don't try to return a DriverNetwork with host networking. None will
ever exist as that's the point of host networking: rkt won't create a
network namespace.
2017-12-01 17:23:25 -08:00
Chelsea Holland Komlo
584644287e get KillTimeout in seconds, not nanoseconds 2017-12-01 10:43:00 -05:00
Chelsea Holland Komlo
9a719cbea2 Support StopTimeout for Docker tasksw
Update github.com/fsouza/go-dockerclient
2017-11-29 14:33:05 -05:00
Preetha Appan
d522149f6b Missed assert in one place 2017-11-20 13:04:38 -06:00
Preetha Appan
ee4b4d859d Better error validation, and added test case for invalid sysctl inputs 2017-11-20 12:07:18 -06:00
Preetha Appan
0d4797711b Address some review comments 2017-11-20 11:15:09 -06:00