build(ci,deploy)!: the runner at home in a nightly window, deploys by hand (ADR 0039, D6, D13, D16)
Some checks failed
CI / check (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
The CI runner moves to halkyon.li's host at home and runs from 02:00 to 05:00 alone: a timer starts it, its unit's RuntimeMaxSec ends it, and night.sh rests the instance's heavy sidecars around it as deploy, while Caddy, PostgreSQL and the apps' servers keep serving. Jobs pushed during the day wait in Forgejo's queue. Its sandbox fits the new host: its folder on the HDD, the rest of /data hidden, containerd's store out of reach, no private IPv4 network and no IPv6 at all (the home network's IPv6 addresses are public ones under a changing prefix, on the internet's own interface), 5 GB of memory with swap beyond. The Sandbox step checks the tunnel, the home router and IPv6. BREAKING CHANGE: CI deploys nothing any more: the deploy job goes with learn.halkyon.eu's server, and halkyon.li deploys by hand with redeploy.sh once a commit's night's run passed. Jobs run on the runner labelled balthasar; sahaquiel's runner picks up none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
2218695dcf
commit
c8d67b1eb7
1 changed files with 401 additions and 76 deletions
37
deploy/night.sh
Executable file
37
deploy/night.sh
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
# Rests the instance's heavy sidecars during the CI runner's nightly window and starts them
|
||||
# again after it (ADR 0039, D6): `night.sh stop` at 01:55, `night.sh start` at 05:00, as
|
||||
# deploy, from deploy/runner/'s halkyon-night and halkyon-morning units. Caddy, PostgreSQL
|
||||
# and the apps' servers keep serving through the night, so people sign in and sync;
|
||||
# Jellyfin, LanguageTool, the dictionaries, routes, map tiles and place search, with their
|
||||
# refreshers, wait until the morning. Only those .env switches on; a deploy in between
|
||||
# starts them with the rest, which is harmless.
|
||||
set -eu
|
||||
|
||||
# Every service that takes memory or builds data, by its compose name.
|
||||
heavy="jellyfin languagetool dictionaries brouter brouter-segments map-tiles map-tiles-refresh photon photon-data"
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
action=${1:-}
|
||||
case $action in
|
||||
stop | start) ;;
|
||||
*)
|
||||
echo "usage: $0 stop|start" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
on=$(docker compose config --services)
|
||||
services=
|
||||
for service in $heavy; do
|
||||
if printf '%s\n' "$on" | grep -qx "$service"; then
|
||||
services="$services $service"
|
||||
fi
|
||||
done
|
||||
if [ -z "$services" ]; then
|
||||
echo "No heavy sidecar is switched on."
|
||||
exit 0
|
||||
fi
|
||||
# shellcheck disable=SC2086 # one service a word
|
||||
docker compose "$action" $services
|
||||
echo "night.sh $action:$services"
|
||||
Loading…
Reference in a new issue