open-nomad/client/allocrunner/taskrunner
Tim Gross 0f29dcc935
support script checks for task group services (#6197)
In Nomad prior to Consul Connect, all Consul checks work the same
except for Script checks. Because the Task being checked is running in
its own container namespaces, the check is executed by Nomad in the
Task's context. If the Script check passes, Nomad uses the TTL check
feature of Consul to update the check status. This means in order to
run a Script check, we need to know what Task to execute it in.

To support Consul Connect, we need Group Services, and these need to
be registered in Consul along with their checks. We could push the
Service down into the Task, but this doesn't work if someone wants to
associate a service with a task's ports, but do script checks in
another task in the allocation.

Because Nomad is handling the Script check and not Consul anyways,
this moves the script check handling into the task runner so that the
task runner can own the script check's configuration and
lifecycle. This will allow us to pass the group service check
configuration down into a task without associating the service itself
with the task.

When tasks are checked for script checks, we walk back through their
task group to see if there are script checks associated with the
task. If so, we'll spin off script check tasklets for them. The
group-level service and any restart behaviors it needs are entirely
encapsulated within the group service hook.
2019-09-03 15:09:04 -04:00
..
getter taskrunner getter set Umask for go-getter, setuid test 2019-08-23 15:59:03 -04:00
interfaces
restarts Fix restart attempts of restart stanza. 2019-05-21 13:27:19 +02:00
state client: test logmon cleanup 2019-03-04 13:15:15 -08:00
template client/template: configuration for function blacklist and sandboxing 2019-08-12 16:34:48 -04:00
testdata executor/linux: make chroot binary paths absolute 2019-04-01 15:45:31 -07:00
artifact_hook.go client: ensure task is cleaned up when terminal 2019-03-01 14:00:23 -08:00
artifact_hook_test.go client: ensure task is cleaned up when terminal 2019-03-01 14:00:23 -08:00
device_hook.go Store device envs separately and pass to drivers 2018-12-19 14:23:09 -08:00
device_hook_test.go
dispatch_hook.go client/state: support upgrading from 0.8->0.9 2018-12-19 10:39:27 -08:00
dispatch_hook_test.go use drivers.FSIsolation 2019-01-08 09:11:47 -05:00
driver_handle.go implement client endpoint of nomad exec 2019-05-09 16:49:08 -04:00
envoybootstrap_hook.go connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
envoybootstrap_hook_test.go connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
errors.go client: artifact errors are retry-able 2019-02-20 07:21:27 -08:00
errors_test.go client: artifact errors are retry-able 2019-02-20 07:21:27 -08:00
lazy_handle.go executor: implement streaming stats API 2019-01-12 12:18:22 -05:00
lifecycle.go tr: Fetch Wait channel before killTask in restart 2019-06-26 15:20:57 +02:00
logmon_hook.go retry grpc unavailable errors even if not shutting down 2019-04-25 18:39:17 -04:00
logmon_hook_test.go logmon: make Start rpc idempotent and simplify hook 2019-03-19 14:02:36 -04:00
logmon_hook_unix_test.go try checking process status 2019-04-25 18:16:13 -04:00
script_check_hook.go support script checks for task group services (#6197) 2019-09-03 15:09:04 -04:00
script_check_hook_test.go support script checks for task group services (#6197) 2019-09-03 15:09:04 -04:00
service_hook.go Consul service meta (#6193) 2019-08-23 12:49:02 -04:00
service_hook_test.go consul: fix task deregistration hook 2019-02-12 15:36:02 -08:00
stats_hook.go log unrecoverable errors 2019-07-17 11:01:59 +07:00
stats_hook_test.go executor: implement streaming stats API 2019-01-12 12:18:22 -05:00
task_dir_hook.go client: ensure task is cleaned up when terminal 2019-03-01 14:00:23 -08:00
task_runner.go Merge pull request #6065 from hashicorp/b-nil-driver-exec 2019-08-02 09:48:28 -05:00
task_runner_getters.go Merge pull request #5518 from hashicorp/f-simplify-kill 2019-04-15 14:11:58 -07:00
task_runner_hooks.go support script checks for task group services (#6197) 2019-09-03 15:09:04 -04:00
task_runner_test.go cleanup test 2019-06-18 14:15:25 +00:00
tasklet.go support script checks for task group services (#6197) 2019-09-03 15:09:04 -04:00
tasklet_test.go support script checks for task group services (#6197) 2019-09-03 15:09:04 -04:00
template_hook.go
validate_hook.go
validate_hook_test.go
vault_hook.go emit TaskRestartSignal event on vault restart 2019-02-22 15:56:14 -05:00
vault_hook_test.go
volume_hook.go HostVolumeConfig: Source -> Path 2019-08-12 15:39:08 +02:00