The build-server agent has igneum-build-2 and -3 on order (suites and benches; proving and the fast-time nodes). The installer takes a host argument (N reads ~/.config/igneum/build-server-N, or build@<ip>); the pusher drops the Mac and PC facts on every box it has a host file for, pulls each box's file and publishes boxes[] (box stays the first for the old shape); the page draws one server section and one crew card per box, reads every box's Caddy feed in parallel (build, build-2, build-3.igneum.network) with the edge copy filling any box that does not answer, and merges every box's builds into the lanes, the timeline and the analytics. Nothing changes for build-1 until the host files exist. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
21 lines
1.9 KiB
Bash
Executable file
21 lines
1.9 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Install or refresh the worker dashboard collector on igneum-build-1 from this Mac.
|
|
# infra/build-server/workers/install.sh build-1: copies tools/workers/{lib,collect}.mjs and the two units, enables the timer
|
|
# infra/build-server/workers/install.sh 2 igneum-build-2 (host line in ~/.config/igneum/build-server-2), 3 for build-3
|
|
# infra/build-server/workers/install.sh build@<ip> any box by its host line
|
|
# Needs root over ssh (root@<ip> with ~/.ssh/igneum_ed25519); the host ip comes from ~/.config/igneum/build-server[-N] (build@<ip>).
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"; ROOT="$(cd "$HERE/../../.." && pwd)"
|
|
KEY="${IGNEUM_BUILD_KEY:-$HOME/.ssh/igneum_ed25519}"
|
|
case "${1:-}" in
|
|
"") HOST_LINE="$(head -1 "${IGNEUM_BUILD_HOST_FILE:-$HOME/.config/igneum/build-server}" | tr -d '[:space:]')" ;;
|
|
[2-9]) HOST_LINE="$(head -1 "$HOME/.config/igneum/build-server-$1" | tr -d '[:space:]')" ;;
|
|
*@*) HOST_LINE="$1" ;;
|
|
*) echo "usage: install.sh [N | build@<ip>]" >&2; exit 2 ;;
|
|
esac
|
|
IP="${HOST_LINE#*@}"; [ -n "$IP" ] || { echo "no build server in ~/.config/igneum/build-server" >&2; exit 1; }
|
|
SSH=(ssh -i "$KEY" -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10)
|
|
"${SSH[@]}" "root@$IP" 'install -d -o build -g build /srv/workers /srv/workers/bin /srv/workers/sources /srv/builds/_log; chown build:build /srv/builds/_log'
|
|
scp -q -i "$KEY" "$ROOT/tools/workers/lib.mjs" "$ROOT/tools/workers/collect.mjs" "build@$IP:/srv/workers/bin/"
|
|
scp -q -i "$KEY" "$HERE/igneum-workers.service" "$HERE/igneum-workers.timer" "root@$IP:/etc/systemd/system/"
|
|
"${SSH[@]}" "root@$IP" 'systemctl daemon-reload && systemctl enable --now igneum-workers.timer >/dev/null 2>&1; systemctl start igneum-workers.service; systemctl is-active igneum-workers.timer; systemctl list-timers igneum-workers.timer --no-pager | sed -n 2p; ls -la /srv/workers/workers.json'
|