Commit Graph

44 Commits

Author SHA1 Message Date
Mahmood Ali
df694eb3be Regenerate proto files with protoc-gen-go@v1.2.0 2018-11-14 09:01: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
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
Mahmood Ali
60166374d9 Add a helper functions for checking unix root 2018-11-08 10:00:49 -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
Michael Schurter
9b82025608 client: do not run terminal allocs 2018-11-05 12:32:05 -08: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
Michael Schurter
fd2fcd7cb6 drivers: only log non-cancellation errors 2018-10-30 17:13:35 -07:00
Nick Ethier
da7563b8c3 Merge pull request #4795 from hashicorp/f-plugin-config
Pass client configuration to plugins through loader
2018-10-29 18:42:27 -07:00
Nick Ethier
394cbc81b6 plugins/drivers: nil gaurd driver config when building executor config 2018-10-29 21:43:19 -04:00
Nick Ethier
95d381cff7 rename NomadConfig to ClientAgentConfig 2018-10-29 21:34:34 -04:00
Michael Schurter
41b40b9296 plugins/drivers: fix panic when copying a nil TaskHandle 2018-10-19 09:45:45 -07:00
Nick Ethier
7f69bcd4cd added driver specific client config struct to plugin configuration 2018-10-18 23:31:01 -04:00
Nick Ethier
87748fe423 update rkt and exec setconfig funcs 2018-10-16 23:00:26 -04:00
Nick Ethier
832a214bac drivers/exec: better fingerprinting and detection on non linux 2018-10-16 22:45:33 -04:00
Nick Ethier
7f5046849e drivers/exec: add exec implementation 2018-10-16 22:45:28 -04:00
Michael Schurter
2361c1904b tests: get tests building if not yet passing 2018-10-16 16:56:57 -07:00
Preetha Appan
3c6d6b9377 Review comments 2018-10-16 16:56:56 -07:00
Preetha Appan
0ebc3bdd2f RKT driver plugin and unit tests 2018-10-16 16:56:56 -07:00
Nick Ethier
2e055fe18a client: add test for driverfailure during fingerprinting 2018-10-16 16:56:56 -07:00
Preetha Appan
53381035db Get raw exec tests compiling and passing again 2018-10-16 16:56:56 -07:00
Nick Ethier
b016b2b5b0 plugin/driver: add Copy funcs 2018-10-16 16:56:56 -07:00
Nick Ethier
d335a82859 client: begin driver plugin integration
client: fingerprint driver plugins
2018-10-16 16:56:56 -07:00
Alex Dadgar
627e20801d Fix lints 2018-10-16 16:56:56 -07:00
Nick Ethier
db981de8e4 drivers/shared: move eventer to subpackage under drivers shared package 2018-10-16 16:56:55 -07:00
Nick Ethier
ca27a0254b drivers/utils: better handling of consumer cleanup in eventer 2018-10-16 16:56:55 -07:00
Nick Ethier
a8d50e83b1 plugins/drivers: remove bool to track if eventLoop shutdown and use context instead 2018-10-16 16:56:55 -07:00
Nick Ethier
207522be55 drivers/rawexec: PR comments and feedback 2018-10-16 16:56:55 -07:00
Nick Ethier
0d7bf53c57 plugin/drivers: rework eventer and change naming stream -> consumer 2018-10-16 16:56:55 -07:00
Nick Ethier
fc16a5c527 plugin/drivers: plumb in stdout/stderr paths 2018-10-16 16:53:31 -07:00
Nick Ethier
50b2981f0f raw_exec: move package outside of plugins dir 2018-10-16 16:53:31 -07:00
Nick Ethier
391005706f fix package references after drivers/base subpackage removed 2018-10-16 16:53:31 -07:00
Nick Ethier
c9f0d2e0b4 driver/raw_exec: port existing raw_exec tests and add some testing utilities 2018-10-16 16:53:31 -07:00
Nick Ethier
05ca3e9f10 driver/raw_exec: export driver config fields so they are encoded 2018-10-16 16:53:31 -07:00
Nick Ethier
8f2f603642 lint: remove unused code and fix spelling 2018-10-16 16:53:31 -07:00
Nick Ethier
650ac5a83e driver/raw_exec: more tests and bug fixes
added wrapper struct for plugin.ReattachConfig to better handle serialization
2018-10-16 16:53:31 -07:00
Nick Ethier
2b655e4463 driver/raw_exec: initial raw_exec implementation 2018-10-16 16:53:31 -07:00
Nick Ethier
e2bf0a388e clientv2: base driver plugin (#4671)
Driver plugin framework to facilitate development of driver plugins.

Implementing plugins only need to implement the DriverPlugin interface.
The framework proxies this interface to the go-plugin GRPC interface generated
from the driver.proto spec.

A testing harness is provided to allow implementing drivers to test the full
lifecycle of the driver plugin. An example use:

func TestMyDriver(t *testing.T) {
    harness := NewDriverHarness(t, &MyDiverPlugin{})
    // The harness implements the DriverPlugin interface and can be used as such
    taskHandle, err := harness.StartTask(...)
}
2018-10-16 16:53:31 -07:00
Nick Ethier
280d6a3f55 lint: fix comment spelling 2018-08-22 22:47:38 -04:00
Nick Ethier
c77dbdb5ce driver/base: fix proto pr comments 2018-08-22 22:20:46 -04:00
Nick Ethier
03ac6d8665 driver/base: add size on disk field for task 2018-08-22 22:20:46 -04:00
Nick Ethier
2072611bdb driver/base: fixup comments from code review 2018-08-22 22:20:46 -04:00
Nick Ethier
5290754c01 driver/base: add task event emitting to proto 2018-08-22 22:20:46 -04:00
Nick Ethier
59e5500de9 driver/base: Add initial protobuf spec 2018-08-22 22:20:46 -04:00