core: propagate remote task handles

Add a new driver capability: RemoteTasks.

When a task is run by a driver with RemoteTasks set, its TaskHandle will
be propagated to the server in its allocation's TaskState. If the task
is replaced due to a down node or draining, its TaskHandle will be
propagated to its replacement allocation.

This allows tasks to be scheduled in remote systems whose lifecycles are
disconnected from the Nomad node's lifecycle.

See https://github.com/hashicorp/nomad-driver-ecs for an example ECS
remote task driver.
This commit is contained in:
Michael Schurter
2020-12-17 15:21:46 -08:00
parent fb5e898131
commit d50fb2a00e
28 changed files with 1431 additions and 347 deletions

View File

@@ -43,6 +43,7 @@ func (b *driverPluginServer) Capabilities(ctx context.Context, req *proto.Capabi
Exec: caps.Exec,
MustCreateNetwork: caps.MustInitiateNetwork,
NetworkIsolationModes: []proto.NetworkIsolationSpec_NetworkIsolationMode{},
RemoteTasks: caps.RemoteTasks,
},
}