feat: refuse a tag without an image for the host's platform
CI / check (pull_request) Successful in 17s
CI / check (pull_request) Successful in 17s
From 0.34.0 on, netOrk's releases (X.Y.Z, latest) are published for linux/amd64 and linux/arm64, so a Raspberry Pi with a 64-bit OS can be a target (NetOrk/netork#934). The deploy itself needed no change for that: every step runs docker on the target host, which pulls its own platform, and the images on the host (postgres, redis, apt-cacher-ng, signal-api) exist for arm64 as well. What did not work is a tag without arm64: latest-dev, main-<sha>, feature-<branch> and every release before 0.34.0. On a Pi those failed at the first pull with "no matching manifest for linux/arm64/v8", which names neither the cause nor a tag that would work. Now, right after the registry login, the host's architecture (docker version) is compared with the platforms the registry lists for the engine image, and on UI servers the ui image (docker manifest inspect). A definite mismatch stops the deploy before anything on the host changes, and says which tags carry arm64. When the registry's answer can't be read, the pull decides, as before.
This commit is contained in:
1 parent
6b334f42e2
commit
4bf71b7e1c
3 files changed
+233
-2
No files matched your search
@@ -26,6 +26,14 @@ start, and database migrations run from that same image.
|
||||
tag you deploy. The engine image must carry its compose files under `/app/deploy/`.
|
||||
Tags built before that change are refused with a clear message.
|
||||
|
||||
**Raspberry Pi and other arm64 hosts:** a Raspberry Pi 3, 4, 5 or Zero 2 W with a 64-bit
|
||||
OS can be a target. Nothing changes in `deploy.env`: each host pulls the variant for its
|
||||
own platform. netOrk publishes arm64 images for releases only, from 0.34.0 on (`latest`,
|
||||
`X.Y.Z`). `latest-dev`, `main-<sha>`, `feature-<branch>` and older releases are amd64 only,
|
||||
and a deploy of such a tag to an arm64 host is refused before the host is touched. The
|
||||
images on the host (`postgres`, `redis`, `apt-cacher-ng`, `signal-api`) exist for arm64
|
||||
as well.
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
@@ -76,7 +84,10 @@ started earlier pulls whatever image the registry held before, which is stale.
|
||||
ssh session, so a deploy that fails, is interrupted or loses its connection frees it
|
||||
on its own. A host without `flock` is deployed without the lock, with a warning.
|
||||
1. Logs in to the registry. The password travels over ssh's stdin, never on a command
|
||||
line.
|
||||
line. Then it checks that the tag has an image for the host's platform (`docker
|
||||
version`, `docker manifest inspect`): engine, and on UI servers ui. If not, for
|
||||
example `latest-dev` on a Raspberry Pi, it stops here and says which tags would work.
|
||||
If the registry's answer can't be read, the pull below decides.
|
||||
2. Pulls the engine image and copies `docker-compose.yml` and
|
||||
`docker-compose.registry.yml` out of it into `~/netork/`.
|
||||
3. Pulls the netOrk images, then force-recreates the API, the workers, `netork-beat`,
|
||||
|
||||
Reference in new issue
Block a user