Commit Graph

105 Commits

Author SHA1 Message Date
Nick Ethier
249dbfffd2 docker: move config RPCs to config.go 2018-11-19 22:59:18 -05:00
Nick Ethier
8ae8932783 docker: fix tests 2018-11-19 22:59:18 -05:00
Nick Ethier
0462c8a7f8 docker: remove container pointer from task handle 2018-11-19 22:59:18 -05:00
Nick Ethier
d7631e3b23 docker: move volume driver options to seperate block 2018-11-19 22:59:18 -05:00
Nick Ethier
577d4a2ea8 docker: group common config into blocks 2018-11-19 22:59:17 -05:00
Michael Schurter
455e75492c Apply suggestions from code review
Co-Authored-By: nickethier <ncethier@gmail.com>
2018-11-19 22:59:17 -05:00
Nick Ethier
3468880f50 docker: remove global pull coordinator 2018-11-19 22:59:17 -05:00
Nick Ethier
7d09ae57cc docker: remove call to global metrics instance 2018-11-19 22:59:17 -05:00
Nick Ethier
0c62b9adf4 docker: moved fingerprint code to it's own file 2018-11-19 22:59:17 -05:00
Nick Ethier
3601e4241d plugins/driver: remove NodeResources from task Resources and use PercentTicks field for docker driver 2018-11-19 22:59:17 -05:00
Nick Ethier
37ed75502e docker: move recoverable error proto to shared structs 2018-11-19 22:59:16 -05:00
Nick Ethier
396f6ab1fb docker: implement recover task logic 2018-11-19 22:59:16 -05:00
Nick Ethier
902eb9475c docker: finished porting tests 2018-11-19 22:59:16 -05:00
Nick Ethier
5c777a37de drivers/docker: more work porting tests from old driver plugin 2018-11-19 22:59:16 -05:00
Nick Ethier
98b295d617 docker: started work on porting docker driver to new plugin framework 2018-11-19 22:59:15 -05:00
Nick Ethier
9d8d3e158a docker: properly launch docker logger process 2018-11-19 22:59:12 -05:00
Michael Schurter
43b359914b client: interpolate driver configurations
Also add missing SetDriverNetwork calls.
2018-11-15 16:25:57 -08:00
Mahmood Ali
df694eb3be Regenerate proto files with protoc-gen-go@v1.2.0 2018-11-14 09:01:26 -05:00
Mahmood Ali
851b275afc Merge pull request #4858 from hashicorp/b-fix-master-20181109
Fix some tests in master
2018-11-13 16:08:26 -05:00
Alex Dadgar
6d0cd01a6a Merge pull request #4868 from hashicorp/b-plugin-ctx
Plugin client's handle plugin dying
2018-11-13 10:26:53 -08:00
Mahmood Ali
9d6a362b94 Use materialized duration fields for driver config 2018-11-13 10:21:40 -05:00
Mahmood Ali
9254bdb92e Avoid downloading image if present locally 2018-11-13 10:21:40 -05:00
Mahmood Ali
6b8c6836a9 Prioritize checking consumer context cancellation
Tests expect that as soon as eventer shuts down immediately on context
cancellations; but golang does not guarantee priority when multiple
pending channels are ready in a select statement.
2018-11-13 10:21:40 -05:00
Mahmood Ali
8ccb80bcea pull alpine image needed for test
The test requires the image to be present locally, so importing it as
part of setup.
2018-11-13 10:21:40 -05:00
Mahmood Ali
416b5240f4 Handle time.Duration in mock
Mock driver config uses `time.Duration` fields but we initialize them
inconsistently, as time.Duration sometimes and as duration strings other
times.  Previously, `mapstructure` handles it and does the right thing.

This is no longer the case with MsgPack.  I could not find a good way to
bring back old behavior without too much complexity.  `MsgPack` extended
types weren't ideal here as we lose type information (e.g. int64 vs
string), and the input is a generic map and not a MsgPack serialization
of duration.

As such, I went with the simple solution of declaring the config field
as duration string, and panicing if the test doesn't pass a valid
string.

I found this to cause the smallest change in tests, but we can
alternatively force all to be int64 instead.
2018-11-13 10:21:40 -05:00
Mahmood Ali
cc52606a07 distinguish java driver tests from others 2018-11-13 10:21:40 -05:00
Mahmood Ali
a24fd59d4b Fix java driver tests 2018-11-13 10:21:40 -05:00
Mahmood Ali
66fc70fe50 Merge pull request #4845 from hashicorp/r-exec-refactor
Update exec driver to match rawexec
2018-11-12 20:59:32 -05:00
Alex Dadgar
9d42f4d039 Plugin client's handle plugin dying
This PR plumbs the plugins done ctx through the base and driver plugin
clients (device already had it). Further, it adds generic handling of
gRPC stream errors.
2018-11-12 17:09:27 -08:00
Danielle Tomlinson
1a17741e86 rawexec: Only use cgroups when running as root.
If Nomad is not running as root, we should not try to use cgroups for pid
freezing.

This originally was implemented pre-driver-support in
https://github.com/hashicorp/nomad/blob/v0.8.6/client/driver/raw_exec.go#L120-L130
2018-11-10 06:45:11 -08:00
Mahmood Ali
82b1764531 handle nil resources limits
Config may not express resource constraints on the job!
2018-11-09 15:52:44 -05:00
Mahmood Ali
26fc1b140f shorter health descriptions 2018-11-08 10:00:49 -08:00
Mahmood Ali
60166374d9 Add a helper functions for checking unix root 2018-11-08 10:00:49 -08:00
Mahmood Ali
c794e70c4d Update exec driver to match rawexec
Update exec driver with latest patterns used by rawexec, and eliminate
accidental diffs.
2018-11-08 10:00:49 -08:00
Alex Dadgar
ad4c26a1e3 review comments 2018-11-07 11:31:52 -08:00
Alex Dadgar
57f40c7e3e Device manager
Introduce a device manager that manages the lifecycle of device plugins
on the client. It fingerprints, collects stats, and forwards Reserve
requests to the correct plugin. The manager, also handles device plugins
failing and validates their output.
2018-11-07 10:43:15 -08:00
Mahmood Ali
62d24ce9ef reconcile java with latest patterns 2018-11-06 12:49:29 -08:00
Mahmood Ali
12149c3804 driver/java: support non-linux targets
Java driver supports non-linux targets, so LinuxResources fields isn't
guaranteed to be not-nil.
2018-11-06 12:41:39 -08:00
Mahmood Ali
dc0d244dd8 Reconcile with latest master patterns 2018-11-06 12:41:39 -08:00
Mahmood Ali
0022496e5b add java driver tests 2018-11-06 12:41:39 -08:00
Mahmood Ali
f7d83d7e80 Implement java driver 2018-11-06 12:41:39 -08:00
Michael Schurter
8122c76cd6 Merge pull request #4828 from hashicorp/b-restore
Implement client agent restarting
2018-11-05 18:50:15 -06:00
Michael Schurter
fdbe446ea6 client: first pass at implementing task restoring
Task restoring works but dead tasks may be restarted
2018-11-05 12:32:05 -08:00
Mahmood Ali
11a64f1332 Merge pull request #4826 from hashicorp/b-driver-exec-tweaks-20181031
Register exec driver plugin among some fixes
2018-11-02 10:11:05 -04:00
Mahmood Ali
6b79e5bd12 add plugin config 2018-11-02 08:51:23 -04:00
Michael Schurter
ce604b8b86 rkt: standardize names/code 2018-11-01 15:53:07 -07:00
Michael Schurter
4d707b5e8c rawexec: standardize names/code 2018-11-01 15:53:07 -07:00
Michael Schurter
84c8dbe5c9 qemu: standardize names/code 2018-11-01 15:53:07 -07:00
Michael Schurter
e949416e12 drivers/mock: standardize names/code 2018-10-31 11:52:51 -07:00
Mahmood Ali
a5e1e4b59e Register exec driver plugin among some fixes
Namely, remove the `enabled` configuration flag, as it's specific to
`raw_exec` driver.  Also, pass resource limits to underlying call.
2018-10-31 13:55:59 -04:00