Mahmood Ali
7f81b20990
Merge pull request #7416 from greut/bump-go-dockerclient
...
vendor: fsouza/go-docker-client v1.6.3
2020-03-23 08:04:36 -04:00
Yoan Blanc
2e1a139c66
govendor sync
...
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-23 08:42:18 +01:00
Yoan Blanc
fd671b40d3
vendor: docker/docker -> moby/moby
...
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-23 08:37:55 +01:00
Yoan Blanc
ed8dcccb54
docker: disable swap in Windows only
...
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-23 08:35:09 +01:00
Dane Harrigan
588b30814e
Merge pull request #7373 from hashicorp/daneharrigan-patch-1
...
Update consul-connect.mdx
2020-03-22 22:22:43 -07:00
Mahmood Ali
fa1244f8c5
health tracker: account for group service checks
2020-03-22 12:38:37 -04:00
Mahmood Ali
d61140dcac
health check account for task lifecycle
...
In service jobs, lifecycles non-sidecar task tweak health logic a bit:
they may terminate successfully without impacting alloc health, but fail
the alloc if they fail.
Sidecars should be treated just like a normal task.
2020-03-22 12:37:40 -04:00
Mahmood Ali
07a30580ac
health: fail health if any task is pending
...
Fixes a bug where an allocation is considered healthy if some of the
tasks are being restarted and as such, their checks aren't tracked by
consul agent client.
Here, we fix the immediate case by ensuring that an alloc is healthy
only if tasks are running and the registered checks at the time are
healthy.
Previously, health tracker tracked task "health" independently from
checks and leads to problems when a task restarts. Consider the
following series of events:
1. all tasks start running -> `tracker.tasksHealthy` is true
2. one task has unhealthy checks and get restarted
3. remaining checks are healthy -> `tracker.checksHealthy` is true
4. propagate health status now that `tracker.tasksHealthy` and
`tracker.checksHealthy`.
This change ensures that we accurately use the latest status of tasks
and checks regardless of their status changes.
Also, ensures that we only consider check health after tasks are
considered healthy, otherwise we risk trusting incomplete checks.
This approach accomodates task dependencies well. Service jobs can have
prestart short-lived tasks that will terminate before main process runs.
These dead tasks that complete successfully will not negate health
status.
2020-03-22 11:13:41 -04:00
Mahmood Ali
b0a7e4381b
tests: add a check for failing service checks
...
Add tests to check for failing or missing service checks in consul
update.
2020-03-22 11:13:40 -04:00
Yoan Blanc
1bc3a1f615
vendor: upgrade some parts of docker
...
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-22 10:18:06 +01:00
Yoan Blanc
d9ea68e807
fixup! fixup! vendor: fsouza/go-docker-client v1.6.3
...
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-22 10:04:52 +01:00
Yoan Blanc
392e95d496
fixup! vendor: fsouza/go-docker-client v1.6.3
...
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-22 09:29:49 +01:00
Yoan Blanc
8e744d1877
vendor: fsouza/go-docker-client v1.6.3
...
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-03-22 09:25:46 +01:00
Mahmood Ali
2bb9eb4e78
Merge pull request #6843 from hashicorp/lifecycle
...
Task Lifecycle
2020-03-21 19:15:09 -04:00
Mahmood Ali
01dc3c16e4
fix one test usage of BlockUntil
2020-03-21 18:25:13 -04:00
Mahmood Ali
5801039214
address review feedback
2020-03-21 17:52:58 -04:00
Mahmood Ali
e1f53347e9
tr: proceed to mark other tasks as dead if alloc fails
2020-03-21 17:52:58 -04:00
Mahmood Ali
e30d26b404
fix test
2020-03-21 17:52:57 -04:00
Jasmine Dahilig
73a64e4397
change jobspec lifecycle stanza to use sidecar attribute instead of
...
block_until status
2020-03-21 17:52:57 -04:00
Jasmine Dahilig
89778bc88d
fix restart policy for system jobs with no lifecycle
2020-03-21 17:52:56 -04:00
Jasmine Dahilig
1485b342e2
remove deadline code for now
2020-03-21 17:52:56 -04:00
Jasmine Dahilig
56e0b8e933
refactor TaskHookCoordinator tests to use mock package and add failed init and sidecar test cases
2020-03-21 17:52:56 -04:00
Jasmine Dahilig
b69e8e3a42
remove api package dependency on structs package
2020-03-21 17:52:55 -04:00
Jasmine Dahilig
7b3f3497ed
mock task hook coordinator in consul integration test
2020-03-21 17:52:55 -04:00
Jasmine Dahilig
2a8dac077c
remove debugging test code from TestAllocRunner_TaskLeader_StopRestoredTG
2020-03-21 17:52:54 -04:00
Jasmine Dahilig
deb26aefab
fix bug in lifecycle restore tests after refactor
2020-03-21 17:52:54 -04:00
Jasmine Dahilig
2e93d7a875
fix failing ci test: TestTaskRunner_UnregisterConsul_Retries
2020-03-21 17:52:54 -04:00
Jasmine Dahilig
d54a83afee
fix linting errors
2020-03-21 17:52:53 -04:00
Jasmine Dahilig
3d1ffb9337
add task hook coordinator many init tasks test case
2020-03-21 17:52:53 -04:00
Jasmine Dahilig
80f0256cb4
refactor task hook coordinator helper method and tests
2020-03-21 17:52:53 -04:00
Jasmine Dahilig
a0fe570317
clean up restore test
2020-03-21 17:52:52 -04:00
Jasmine Dahilig
7ed08eb75a
partial test for restore functionality
2020-03-21 17:52:52 -04:00
Jasmine Dahilig
0c44d0017d
account for client restarts in task lifecycle hooks
2020-03-21 17:52:51 -04:00
Jasmine Dahilig
81d051d7e8
fix bug in lifecycle scheduler test mocks
2020-03-21 17:52:51 -04:00
Jasmine Dahilig
4ab39318cc
clean up restart conditions and restart tests for task lifecycle
2020-03-21 17:52:50 -04:00
Jasmine Dahilig
7064deaafb
put lifecycle nil and empty checks in api Canonicalize
2020-03-21 17:52:50 -04:00
Jasmine Dahilig
39b5eb245c
remove api dependency on structs package, copy lifecycle defaults to api package
2020-03-21 17:52:49 -04:00
Jasmine Dahilig
34f8055f39
remove logging debug line from cli
2020-03-21 17:52:49 -04:00
Jasmine Dahilig
b7f08c9d13
add appropriate lifecycle deadline default of 120s
2020-03-21 17:52:48 -04:00
Jasmine Dahilig
0cc9212a54
add test cases for scheduler alloc placement with lifecycle resources
2020-03-21 17:52:47 -04:00
Jasmine Dahilig
0d2988652c
add lifecycle job mock
2020-03-21 17:52:47 -04:00
Jasmine Dahilig
3e4e8f2b02
add allocfit test for lifecycles
2020-03-21 17:52:46 -04:00
Jasmine Dahilig
c27223207c
update task hook coordinator tests
2020-03-21 17:52:46 -04:00
Mahmood Ali
b880607bad
update scheduler to account for hooks
2020-03-21 17:52:45 -04:00
Mahmood Ali
c0f59ea06e
minor improvement
2020-03-21 17:52:44 -04:00
Jasmine Dahilig
bc78d6b64d
add lifecycle info to alloc status short
2020-03-21 17:52:42 -04:00
Jasmine Dahilig
12393f90e7
add test for lifecycle coordinator
2020-03-21 17:52:42 -04:00
Jasmine Dahilig
f6e58d6dad
add canonicalize in the right place
2020-03-21 17:52:41 -04:00
Jasmine Dahilig
b9a258ed7b
incorporate lifecycle into restart tracker
2020-03-21 17:52:40 -04:00
Jasmine Dahilig
4498c8c24f
add canonicalization
2020-03-21 17:52:39 -04:00