This commit is contained in:
parent
b6600a6560
commit
7322105fd9
6
abra
6
abra
@ -802,10 +802,16 @@ ensure_stack_deployed() {
|
|||||||
|
|
||||||
local -a UNHEALTHY # mapping
|
local -a UNHEALTHY # mapping
|
||||||
local -a HEALTHY # mapping
|
local -a HEALTHY # mapping
|
||||||
|
local -a UNKNOWN # mapping
|
||||||
|
|
||||||
services=$(docker stack services "${STACK_NAME}" --format "{{.ID}}" | tr '\n' ' ')
|
services=$(docker stack services "${STACK_NAME}" --format "{{.ID}}" | tr '\n' ' ')
|
||||||
debug "Detected the following service IDs: $(echo $services)"
|
debug "Detected the following service IDs: $(echo $services)"
|
||||||
|
|
||||||
|
without_health_checks = $(docker inspect --format)
|
||||||
|
|
||||||
|
# TODO: this tells you if shit is missing
|
||||||
|
docker inspect --format "{{ json .State }}" traefik_app.1.rnpar574ozsn6oi2ouo5s84jn | jq "try(.Health.Status // \"missing\")"
|
||||||
|
|
||||||
while [ ! "${#HEALTHY[@]}" -eq "$(( ${#SERVICES[@]} + 1 ))" ]; do
|
while [ ! "${#HEALTHY[@]}" -eq "$(( ${#SERVICES[@]} + 1 ))" ]; do
|
||||||
debug "Number of services expected to be healthy: $(( ${#SERVICES[@]} + 1 ))"
|
debug "Number of services expected to be healthy: $(( ${#SERVICES[@]} + 1 ))"
|
||||||
debug "Number of services actually healthy: ${#HEALTHY[@]}"
|
debug "Number of services actually healthy: ${#HEALTHY[@]}"
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
# The goal of this compose file is to have a testing ground for understanding
|
||||||
|
# what cases we need to handle to get stable deployments. For that, we need to
|
||||||
|
# work with healthchecks and deploy configurations quite closely. If you run
|
||||||
|
# the `make symlink` target then this will be loaded into a "fake" app on your
|
||||||
|
# local machine which you can deploy with `abra`.
|
||||||
|
|
||||||
version: "3.8"
|
version: "3.8"
|
||||||
services:
|
services:
|
||||||
r1:
|
r1_should_work:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
deploy:
|
deploy:
|
||||||
update_config:
|
update_config:
|
||||||
@ -17,7 +23,8 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 1s
|
start_period: 1s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
r2:
|
|
||||||
|
r2_broken_health_check:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
deploy:
|
deploy:
|
||||||
update_config:
|
update_config:
|
||||||
@ -29,8 +36,31 @@ services:
|
|||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: foobar
|
test: foobar
|
||||||
# test: redis-cli ping
|
|
||||||
interval: 2s
|
interval: 2s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 1s
|
start_period: 1s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
|
|
||||||
|
r3_no_health_check:
|
||||||
|
image: redis:alpine
|
||||||
|
deploy:
|
||||||
|
update_config:
|
||||||
|
failure_action: rollback
|
||||||
|
order: start-first
|
||||||
|
rollback_config:
|
||||||
|
order: start-first
|
||||||
|
restart_policy:
|
||||||
|
max_attempts: 3
|
||||||
|
|
||||||
|
r4_disabled_health_check:
|
||||||
|
image: redis:alpine
|
||||||
|
deploy:
|
||||||
|
update_config:
|
||||||
|
failure_action: rollback
|
||||||
|
order: start-first
|
||||||
|
rollback_config:
|
||||||
|
order: start-first
|
||||||
|
restart_policy:
|
||||||
|
max_attempts: 3
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
Reference in New Issue
Block a user