Merge branch 'main' into fix/remove-only-replaced-images

README: main's restricted database login (#17) became step 6, so the
migration is step 12 and the removal of the replaced images step 13.
This commit is contained in:
Christian Manivong committed 2026-12-02 17:24:46 +01:00
commit 31cc9da537
5 files changed
+305 -7

No files matched your search

+17 -7
View File
@@ -105,28 +105,38 @@ started earlier pulls whatever image the registry held before, which is stale.
here before anything changed: the host keeps its previous compose files and
`.env`, so a hand-typed `docker compose up -d` cannot move the database either.
See *Moving the bundled database*. This step runs before `.env` is written.
6. Reconciles the broker, `redis` (Valkey): recreated only if its definition changed,
6. On the bundled database, gives netOrk's application a database login of its own that
cannot change or delete the audit log (NetOrk/netork#2937), unless `.env` has one
already (`MIGRATION_DATABASE_URL` set) or says `RESTRICTED_DB_LOGIN=off`
(`remote/db_login.sh`). A container of the engine image being deployed rewrites
`.env`: the owner's URL moves to `MIGRATION_DATABASE_URL`, and `DATABASE_URL`
becomes `netork_app` with a password generated on the host. Nothing of the file is
printed. `netork-api` creates the role when it starts. An external database, or an
image from before this change, leaves `.env` alone. Any other failure stops the deploy
with the old engine running. The way back is in netOrk's `docs/TECHNICAL_DESIGN.md`,
"The application login that cannot change the audit log".
7. Reconciles the broker, `redis` (Valkey): recreated only if its definition changed,
and waited for until healthy, before the engine comes up against it. If it does
not get healthy within 120 s, the deploy stops with the old engine running.
7. Hands the `ssl_certs` volume to `netork`, the user the API and nginx run as
8. Hands the `ssl_certs` volume to `netork`, the user the API and nginx run as
(NetOrk/netork#1389), in one container of the engine image run as root with only the
capability to chown. A volume written by the old root nginx would keep the UI from
starting. `chown -c` names only what it changed; on a host handed over earlier it
does nothing. If it fails, the deploy stops with the old containers running.
8. Force-recreates the API, the workers, `netork-beat`, `flower` and, on UI servers,
9. Force-recreates the API, the workers, `netork-beat`, `flower` and, on UI servers,
`netork-ui`. If the recreate fails, it is tried once more after 5 s
(`DEPLOY_RECREATE_RETRY_DELAY`). Compose's parallel recreate can lose a container it
just renamed and leave the rest stopped. If the second attempt fails too, the
container states are printed and the deploy fails.
9. Reconciles `apt-cacher-ng` and `signal-api`: each is recreated only if its
10. Reconciles `apt-cacher-ng` and `signal-api`: each is recreated only if its
definition changed.
It then removes services netOrk no longer ships, container and volume, where a host
still has them: today the bundled `registry` (NetOrk/netork#763). It reports only
what it actually removed; on a host that was cleaned earlier it says nothing.
10. Verifies that the containers run exactly the image that was pulled. If they don't, the
11. Verifies that the containers run exactly the image that was pulled. If they don't, the
deploy fails.
11. Runs `alembic upgrade head` inside `netork-api`.
12. Removes the images the swap replaced, and only those. Before the swap it records which
12. Runs `alembic upgrade head` inside `netork-api`.
13. Removes the images the swap replaced, and only those. Before the swap it records which
images netOrk's own containers use; afterwards `remote/remove_replaced_images.sh`
removes them unless a container still uses one, a redeploy of the same tag for
example. Other projects' images on the host stay. This used to be