feat: reconcile the broker before the engine (NetOrk/netork#1308) #13

Merged
christianmanivong merged 2 commits from feat/reconcile-broker into main 2026-10-20 20:40:21 +00:00
Owner

redis was in no list: the engine is recreated with --no-deps, and the infrastructure reconcile leaves databases out on purpose. So a changed redis definition never reached a host, and NetOrk/netork#1308 changes it: Valkey in place of redis:7-alpine, on a new volume.

Change

  • deploy.sh brings the broker up with up -d --no-deps --wait --wait-timeout 120 redis right after .env is written and before the engine is recreated.
  • A plain up -d recreates the broker only when its definition changed. An unchanged broker keeps running and keeps its queue.
  • If the broker is not healthy within 120 s, the deploy stops, and the old engine keeps running.
  • postgres stays out of every list.

Tests

  • New tests/test_deploy_broker.py checks that:
    • the broker is reconciled before the engine;
    • the broker is never force-recreated;
    • a broker that fails stops the deploy.
  • test_every_up_sees_the_version_being_deployed now counts three up calls.

Deploy together with NetOrk/netork's feat/service-images. Merge after the test on .50.

`redis` was in no list: the engine is recreated with `--no-deps`, and the infrastructure reconcile leaves databases out on purpose. So a changed `redis` definition never reached a host, and NetOrk/netork#1308 changes it: Valkey in place of `redis:7-alpine`, on a new volume. **Change** - deploy.sh brings the broker up with `up -d --no-deps --wait --wait-timeout 120 redis` right after `.env` is written and before the engine is recreated. - A plain `up -d` recreates the broker only when its definition changed. An unchanged broker keeps running and keeps its queue. - If the broker is not healthy within 120 s, the deploy stops, and the old engine keeps running. - postgres stays out of every list. **Tests** - New `tests/test_deploy_broker.py` checks that: - the broker is reconciled before the engine; - the broker is never force-recreated; - a broker that fails stops the deploy. - `test_every_up_sees_the_version_being_deployed` now counts three `up` calls. Deploy together with NetOrk/netork's `feat/service-images`. Merge after the test on .50.
christianmanivong added 1 commit 2026-10-20 20:26:34 +00:00
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.
christianmanivong added 1 commit 2026-10-20 20:38:11 +00:00
style: ruff format test_deploy_broker.py
CI / check (pull_request) Successful in 1m48s
b93a258efc
christianmanivong merged commit 9513594f1a into main 2026-10-20 20:40:21 +00:00
christianmanivong deleted branch feat/reconcile-broker 2026-10-20 20:40:21 +00:00
Sign in to join this conversation.