Commit Graph

14 Commits

Author SHA1 Message Date
Nick Ethier
7d80fe286f drivers: use consts for task handle version 2019-01-16 21:52:31 -05:00
Nick Ethier
e7a4dbb8a7 cleanup code comments and small fixes from refactor 2019-01-15 17:07:21 -05:00
Nick Ethier
12ae83bb79 executor: add pre 0.9 client and wrapper 2019-01-15 16:55:12 -05:00
Alex Dadgar
437f03d877 recover 2019-01-07 14:49:40 -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
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
Alex Dadgar
a10d3964d0 Do not use cty in drivers 2018-10-16 17:17:07 -07:00
Michael Schurter
2b249eee14 plugins: msgpack codec should use cty tags 2018-10-16 16:56:56 -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
Alex Dadgar
a0b01d16c6 Example device plugin and helpers
This PR introduces:
* An example device plugin that exposes files as devices for testing.
* Helpers for serving a device plugin
* A launcher binary that allows interacting with a device plugin without
needing a Nomad client.
2018-08-28 13:59:57 -07:00
Alex Dadgar
e11a510bd8 initial device go-plugin 2018-08-16 16:49:09 -07:00
Alex Dadgar
2de5989e37 vet 2018-08-13 11:10:33 -07:00
Alex Dadgar
1736d93430 Review comments 2018-08-13 11:01:44 -07:00
Alex Dadgar
cfc6992e4a Initial go-plugin 2018-08-12 15:58:39 -07:00