feat: reconcile the broker before the engine (NetOrk/netork#1308)
CI / check (pull_request) Failing after 2m28s
CI / check (pull_request) Failing after 2m28s
redis was in no list: the engine is recreated with --no-deps, and the infrastructure reconcile left databases out on purpose. A changed definition -- Valkey in place of redis:7-alpine -- therefore never reached a host. The broker is now brought up with a plain `up -d --wait` right before the engine is recreated: recreated only when its definition changed, so an unchanged broker keeps running and keeps its queue, and the engine comes up against a healthy broker. If the broker does not get healthy within 120 s, the deploy stops with the old engine still running.
This commit is contained in:
1 parent
c1b1eb07b9
commit
7e4fff8025
3 files changed
+102
-5
No files matched your search
@@ -306,8 +306,9 @@ deploy_steps() {
|
||||
fi
|
||||
|
||||
# Containers on upstream images. Reconciled, not force-recreated (below).
|
||||
# postgres and redis are deliberately absent: restarting a database on every
|
||||
# deploy would be worse than any compose change one could miss.
|
||||
# postgres is deliberately absent: restarting a database on every deploy would
|
||||
# be worse than any compose change one could miss. redis is reconciled on its
|
||||
# own, before the engine (below).
|
||||
local INFRA_SERVICES="apt-cacher-ng signal-api"
|
||||
|
||||
echo "[${SERVER}] Pulling images..."
|
||||
@@ -352,6 +353,20 @@ for kv in "REGISTRY_HOST=${REGISTRY_HOST}" "NETORK_VERSION=${SERVER_VERSION}"; d
|
||||
done
|
||||
REMOTE_ENV
|
||||
|
||||
# The broker, before the engine that cannot work without it. Plain `up -d`
|
||||
# recreates it only when its compose definition changed, so an unchanged
|
||||
# broker keeps running and keeps its queue. It used to be in no list at all,
|
||||
# and a changed definition -- Valkey in place of redis:7-alpine
|
||||
# (NetOrk/netork#1308) -- never reached a host. --wait: the engine comes up
|
||||
# against a healthy broker. If it does not get there, the deploy stops here,
|
||||
# with the old engine still running.
|
||||
echo "[${SERVER}] Reconciling the broker..."
|
||||
run_remote "$SERVER" "reconciling redis" "" \
|
||||
"cd ~/netork && \
|
||||
REGISTRY_HOST='${REGISTRY_HOST}' NETORK_VERSION='${SERVER_VERSION}' \
|
||||
docker compose -f docker-compose.yml -f docker-compose.registry.yml \
|
||||
up -d --no-deps --wait --wait-timeout 120 redis"
|
||||
|
||||
# --force-recreate is deliberate: `docker compose up -d` decides what to
|
||||
# replace from the service definition's config hash, and the image reference
|
||||
# (`.../ui:latest-dev`) does not change when the tag is moved to a new image.
|
||||
|
||||
Reference in new issue
Block a user