act/pkg/runner
Markus Wolf 4ef50eeae7
feat: handle context cancelation during docker exec (#1170)
* feat: handle context cancelation during docker exec

To allow interrupting docker exec (which could be long running)
we process the log output in a go routine and handle
context cancelation as well as command result.

In case of context cancelation a CTRL+C is written into the docker
container. This should be enough to terminate the running
command.

To make sure we do not get stuck during cleanup, we do
set the cleanup contexts with a timeout of 5 minutes

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>

* feat: handle SIGTERM signal and abort run

* test: on context cancel, abort running command

This test makes sure that whenever the act Context was canceled, the
currently running docker exec is sent a 0x03 (ctrl+c).

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* test: make sure the exec funcction handles command exit code

This test makes sure that the exec function does handle
docker command error results

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
Co-authored-by: Philipp Hinrichsen <philipp.hinrichsen@new-work.se>
Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
2022-05-24 14:52:25 +00:00
..
res Add super-linter + fix lint issues (#650) 2021-05-03 09:52:03 -07:00
testdata implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
action.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
action_composite.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
action_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
command.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
command_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
container_mock_test.go feat: split job steps into its own files/structs (#1004) 2022-03-22 14:13:00 -07:00
expression.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
expression_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
job_executor.go feat: handle context cancelation during docker exec (#1170) 2022-05-24 14:52:25 +00:00
job_executor_test.go fix: panic if a step in a job is nil (#1145) 2022-05-12 19:23:34 +00:00
logger.go refactor: remove composite action runcontext workaround (#1085) 2022-05-11 19:06:05 +00:00
run_context.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
run_context_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
runner.go feat: handle context cancelation during docker exec (#1170) 2022-05-24 14:52:25 +00:00
runner_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step_action_local.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step_action_local_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step_action_remote.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step_action_remote_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step_docker.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step_docker_test.go feat: split job steps into its own files/structs (#1004) 2022-03-22 14:13:00 -07:00
step_factory.go feat: split job steps into its own files/structs (#1004) 2022-03-22 14:13:00 -07:00
step_factory_test.go feat: split job steps into its own files/structs (#1004) 2022-03-22 14:13:00 -07:00
step_run.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00
step_run_test.go feat: split job steps into its own files/structs (#1004) 2022-03-22 14:13:00 -07:00
step_test.go implement pre and post steps (#1089) 2022-05-24 13:36:06 +00:00