@crvouga/homelab 0.26.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mise/locks/npm-wrangler/{4.170.0 → 4.171.0}/aube-lock.yaml +46 -46
- package/.mise/locks/npm-wrangler/{4.170.0 → 4.171.0}/package.json +1 -1
- package/ansible/ubuntu/policy.json +2 -1
- package/ansible/ubuntu/t3-boot-readiness.py +38 -0
- package/ansible/ubuntu/tasks/recovery.yml +27 -0
- package/docs/runbooks.md +1 -1
- package/docs/worker-contract.md +10 -8
- package/mise.lock +3 -3
- package/mise.toml +1 -1
- package/package.json +2 -2
- package/schema/check-ids.json +1 -1
- package/src/check-registry.ts +1 -1
- package/src/worker-host-checks.ts +22 -35
|
@@ -9,8 +9,8 @@ importers:
|
|
|
9
9
|
.:
|
|
10
10
|
dependencies:
|
|
11
11
|
wrangler:
|
|
12
|
-
specifier: 4.
|
|
13
|
-
version: 4.
|
|
12
|
+
specifier: 4.171.0
|
|
13
|
+
version: 4.171.0(@types/node@18.19.130)
|
|
14
14
|
|
|
15
15
|
packages:
|
|
16
16
|
|
|
@@ -27,38 +27,38 @@ packages:
|
|
|
27
27
|
workerd:
|
|
28
28
|
optional: true
|
|
29
29
|
|
|
30
|
-
'@cloudflare/workerd-darwin-64@1.
|
|
31
|
-
resolution: {integrity: sha512-
|
|
30
|
+
'@cloudflare/workerd-darwin-64@1.20261201.1':
|
|
31
|
+
resolution: {integrity: sha512-3zYOvrvOa2sPrNygPEsrODlvGwq20znmw2pWndOSKPWg2cepdBZfmty90/GhWJJXxmZk6ZSNORFsUEqGTjIBjQ==}
|
|
32
32
|
engines: {node: '>=16'}
|
|
33
33
|
cpu: [x64]
|
|
34
34
|
os: [darwin]
|
|
35
35
|
|
|
36
|
-
'@cloudflare/workerd-darwin-arm64@1.
|
|
37
|
-
resolution: {integrity: sha512-
|
|
36
|
+
'@cloudflare/workerd-darwin-arm64@1.20261201.1':
|
|
37
|
+
resolution: {integrity: sha512-oc6uK56CE/VktpEU+cCIKg/o25GwWXPgJjzab7kKUss23Gu3Xqw1y5XKoXnozx40rDmceF4dPXslFGH4dTEtRw==}
|
|
38
38
|
engines: {node: '>=16'}
|
|
39
39
|
cpu: [arm64]
|
|
40
40
|
os: [darwin]
|
|
41
41
|
|
|
42
|
-
'@cloudflare/workerd-linux-64@1.
|
|
43
|
-
resolution: {integrity: sha512-
|
|
42
|
+
'@cloudflare/workerd-linux-64@1.20261201.1':
|
|
43
|
+
resolution: {integrity: sha512-Y+ON1Pd7EFHZXu82kSHC+8/+tcBuSxGPEW0jGU6YC0xk4iY3iieHcDYe9vQDD/NulBZDNqN4eOKJHj8SVR5plQ==}
|
|
44
44
|
engines: {node: '>=16'}
|
|
45
45
|
cpu: [x64]
|
|
46
46
|
os: [linux]
|
|
47
47
|
|
|
48
|
-
'@cloudflare/workerd-linux-arm64@1.
|
|
49
|
-
resolution: {integrity: sha512-
|
|
48
|
+
'@cloudflare/workerd-linux-arm64@1.20261201.1':
|
|
49
|
+
resolution: {integrity: sha512-9uTVy8ArDk4hvSUlNv03tZP5la9pXPJUw50STbT2UOT40OmDEN8m/ZGAqyOB0Kki7bJwrJGBzZnTyL0x5gGFRQ==}
|
|
50
50
|
engines: {node: '>=16'}
|
|
51
51
|
cpu: [arm64]
|
|
52
52
|
os: [linux]
|
|
53
53
|
|
|
54
|
-
'@cloudflare/workerd-windows-64@1.
|
|
55
|
-
resolution: {integrity: sha512-
|
|
54
|
+
'@cloudflare/workerd-windows-64@1.20261201.1':
|
|
55
|
+
resolution: {integrity: sha512-Vbvb6HttqEwIoB2SNhDfySyubnD+R8aTGv9lqEfg/AFhyqzm6llmRFUuqlCCPp3pNgRGSI1DUhqUVked0A6Pag==}
|
|
56
56
|
engines: {node: '>=16'}
|
|
57
57
|
cpu: [x64]
|
|
58
58
|
os: [win32]
|
|
59
59
|
|
|
60
|
-
'@cloudflare/workers-utils@0.
|
|
61
|
-
resolution: {integrity: sha512-
|
|
60
|
+
'@cloudflare/workers-utils@0.61.0':
|
|
61
|
+
resolution: {integrity: sha512-xJaWBTrLAn/umnvegxIrGemY8wUnKQecmHlPKOcvOHMiLrpKklipTK1XbOk2Qzivpx5yZsiDIjAv9uU8TTIJ6Q==}
|
|
62
62
|
peerDependencies:
|
|
63
63
|
vitest: ^4.1.0 || ^5.0.0
|
|
64
64
|
peerDependenciesMeta:
|
|
@@ -567,8 +567,8 @@ packages:
|
|
|
567
567
|
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
|
|
568
568
|
engines: {node: '>= 0.6'}
|
|
569
569
|
|
|
570
|
-
miniflare@5.
|
|
571
|
-
resolution: {integrity: sha512-
|
|
570
|
+
miniflare@5.20261201.0-beta:
|
|
571
|
+
resolution: {integrity: sha512-fzuDddbIUf8kSsip5APBAoA3zniIrSdSiiIycXRBFB06B4zC8/++0NEeXu9JelO8ezcKsJpViM8BsL7CzNFNpQ==}
|
|
572
572
|
engines: {node: '>=22.12.0'}
|
|
573
573
|
peerDependencies:
|
|
574
574
|
kerberos: ^2.0.0
|
|
@@ -643,23 +643,23 @@ packages:
|
|
|
643
643
|
whatwg-url@5.0.0:
|
|
644
644
|
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
|
645
645
|
|
|
646
|
-
workerd@1.
|
|
647
|
-
resolution: {integrity: sha512-
|
|
646
|
+
workerd@1.20261201.1:
|
|
647
|
+
resolution: {integrity: sha512-HbaelaaUD7TvytkuIadqsHyHIV95bIdP9GCFKhcPFc1hsvBXNOAhC97cpgl9YLlWuql2AGBFzchyjxmjQv5Biw==}
|
|
648
648
|
engines: {node: '>=16'}
|
|
649
649
|
hasBin: true
|
|
650
650
|
|
|
651
|
-
wrangler@4.
|
|
652
|
-
resolution: {integrity: sha512-
|
|
651
|
+
wrangler@4.171.0:
|
|
652
|
+
resolution: {integrity: sha512-pXilcA3/5anwhJxMXvkI+FAG6s4zReAMdIVqprK14duLgAoV6/CLBsg1Zl30nUuflUCMiIWJzDvAUiFSNJDi3w==}
|
|
653
653
|
engines: {node: '>=22.12.0'}
|
|
654
654
|
hasBin: true
|
|
655
655
|
peerDependencies:
|
|
656
|
-
'@cloudflare/workers-types': ^5.
|
|
656
|
+
'@cloudflare/workers-types': ^5.20261201.1
|
|
657
657
|
peerDependenciesMeta:
|
|
658
658
|
'@cloudflare/workers-types':
|
|
659
659
|
optional: true
|
|
660
660
|
|
|
661
|
-
ws@8.
|
|
662
|
-
resolution: {integrity: sha512-
|
|
661
|
+
ws@8.23.1:
|
|
662
|
+
resolution: {integrity: sha512-1rzWDSN0NOi3tpwgHsQExjWRoKUGtjCkJ2gZRaaRtzhYLboMytOI9pj9PU7yCgY37auqdd4OyLofZDbkeuZmPA==}
|
|
663
663
|
engines: {node: '>=10.0.0'}
|
|
664
664
|
peerDependencies:
|
|
665
665
|
bufferutil: ^4.0.1
|
|
@@ -680,28 +680,28 @@ snapshots:
|
|
|
680
680
|
|
|
681
681
|
'@cloudflare/kv-asset-handler@0.5.1': {}
|
|
682
682
|
|
|
683
|
-
'@cloudflare/unenv-preset@2.16.2(unenv@2.0.0-rc.24)(workerd@1.
|
|
683
|
+
'@cloudflare/unenv-preset@2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261201.1)':
|
|
684
684
|
dependencies:
|
|
685
685
|
unenv: 2.0.0-rc.24
|
|
686
686
|
optionalDependencies:
|
|
687
|
-
workerd: 1.
|
|
687
|
+
workerd: 1.20261201.1
|
|
688
688
|
|
|
689
|
-
'@cloudflare/workerd-darwin-64@1.
|
|
689
|
+
'@cloudflare/workerd-darwin-64@1.20261201.1':
|
|
690
690
|
optional: true
|
|
691
691
|
|
|
692
|
-
'@cloudflare/workerd-darwin-arm64@1.
|
|
692
|
+
'@cloudflare/workerd-darwin-arm64@1.20261201.1':
|
|
693
693
|
optional: true
|
|
694
694
|
|
|
695
|
-
'@cloudflare/workerd-linux-64@1.
|
|
695
|
+
'@cloudflare/workerd-linux-64@1.20261201.1':
|
|
696
696
|
optional: true
|
|
697
697
|
|
|
698
|
-
'@cloudflare/workerd-linux-arm64@1.
|
|
698
|
+
'@cloudflare/workerd-linux-arm64@1.20261201.1':
|
|
699
699
|
optional: true
|
|
700
700
|
|
|
701
|
-
'@cloudflare/workerd-windows-64@1.
|
|
701
|
+
'@cloudflare/workerd-windows-64@1.20261201.1':
|
|
702
702
|
optional: true
|
|
703
703
|
|
|
704
|
-
'@cloudflare/workers-utils@0.
|
|
704
|
+
'@cloudflare/workers-utils@0.61.0':
|
|
705
705
|
dependencies:
|
|
706
706
|
'@cspotcode/source-map-support': 0.8.1
|
|
707
707
|
chalk: 5.3.0
|
|
@@ -1102,13 +1102,13 @@ snapshots:
|
|
|
1102
1102
|
dependencies:
|
|
1103
1103
|
mime-db: 1.52.0
|
|
1104
1104
|
|
|
1105
|
-
miniflare@5.
|
|
1105
|
+
miniflare@5.20261201.0-beta(@types/node@18.19.130):
|
|
1106
1106
|
dependencies:
|
|
1107
1107
|
'@cspotcode/source-map-support': 0.8.1
|
|
1108
1108
|
sharp: 0.35.5(@types/node@18.19.130)
|
|
1109
1109
|
undici: 7.30.2
|
|
1110
|
-
workerd: 1.
|
|
1111
|
-
ws: 8.
|
|
1110
|
+
workerd: 1.20261201.1
|
|
1111
|
+
ws: 8.23.1
|
|
1112
1112
|
youch: 4.1.0-beta.10
|
|
1113
1113
|
transitivePeerDependencies:
|
|
1114
1114
|
- '@types/node'
|
|
@@ -1186,29 +1186,29 @@ snapshots:
|
|
|
1186
1186
|
tr46: 0.0.3
|
|
1187
1187
|
webidl-conversions: 3.0.1
|
|
1188
1188
|
|
|
1189
|
-
workerd@1.
|
|
1189
|
+
workerd@1.20261201.1:
|
|
1190
1190
|
optionalDependencies:
|
|
1191
|
-
'@cloudflare/workerd-darwin-64': 1.
|
|
1192
|
-
'@cloudflare/workerd-darwin-arm64': 1.
|
|
1193
|
-
'@cloudflare/workerd-linux-64': 1.
|
|
1194
|
-
'@cloudflare/workerd-linux-arm64': 1.
|
|
1195
|
-
'@cloudflare/workerd-windows-64': 1.
|
|
1191
|
+
'@cloudflare/workerd-darwin-64': 1.20261201.1
|
|
1192
|
+
'@cloudflare/workerd-darwin-arm64': 1.20261201.1
|
|
1193
|
+
'@cloudflare/workerd-linux-64': 1.20261201.1
|
|
1194
|
+
'@cloudflare/workerd-linux-arm64': 1.20261201.1
|
|
1195
|
+
'@cloudflare/workerd-windows-64': 1.20261201.1
|
|
1196
1196
|
|
|
1197
|
-
wrangler@4.
|
|
1197
|
+
wrangler@4.171.0(@types/node@18.19.130):
|
|
1198
1198
|
dependencies:
|
|
1199
1199
|
'@cloudflare/kv-asset-handler': 0.5.1
|
|
1200
|
-
'@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.
|
|
1201
|
-
'@cloudflare/workers-utils': 0.
|
|
1200
|
+
'@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261201.1)
|
|
1201
|
+
'@cloudflare/workers-utils': 0.61.0
|
|
1202
1202
|
'@cspotcode/source-map-support': 0.8.1
|
|
1203
1203
|
'@types/yargs': 17.0.24
|
|
1204
1204
|
cloudflare: 5.2.0
|
|
1205
1205
|
devtools-protocol: 0.0.1182435
|
|
1206
1206
|
esbuild: 0.28.2
|
|
1207
|
-
miniflare: 5.
|
|
1207
|
+
miniflare: 5.20261201.0-beta(@types/node@18.19.130)
|
|
1208
1208
|
path-to-regexp: 6.3.0
|
|
1209
1209
|
undici: 7.30.2
|
|
1210
1210
|
unenv: 2.0.0-rc.24
|
|
1211
|
-
workerd: 1.
|
|
1211
|
+
workerd: 1.20261201.1
|
|
1212
1212
|
optionalDependencies:
|
|
1213
1213
|
fsevents: 2.3.3
|
|
1214
1214
|
transitivePeerDependencies:
|
|
@@ -1219,7 +1219,7 @@ snapshots:
|
|
|
1219
1219
|
- utf-8-validate
|
|
1220
1220
|
- vitest
|
|
1221
1221
|
|
|
1222
|
-
ws@8.
|
|
1222
|
+
ws@8.23.1: {}
|
|
1223
1223
|
|
|
1224
1224
|
youch-core@0.3.3:
|
|
1225
1225
|
dependencies:
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Keep the first successful T3 loopback observation for the current boot."""
|
|
2
|
+
|
|
3
|
+
from http.client import HTTPConnection, HTTPException
|
|
4
|
+
import json
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import sys
|
|
7
|
+
import time
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def answers(timeout: float) -> bool:
|
|
11
|
+
connection = HTTPConnection('127.0.0.1', 3773, timeout=timeout)
|
|
12
|
+
try:
|
|
13
|
+
connection.request('GET', '/.well-known/t3/environment')
|
|
14
|
+
response = connection.getresponse()
|
|
15
|
+
if response.status != 200:
|
|
16
|
+
return False
|
|
17
|
+
identity = json.load(response)
|
|
18
|
+
return isinstance(identity, dict) and isinstance(identity.get('environmentId'), str)
|
|
19
|
+
except (OSError, HTTPException, ValueError):
|
|
20
|
+
return False
|
|
21
|
+
finally:
|
|
22
|
+
connection.close()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def record_readiness(marker: Path, interval: float) -> None:
|
|
26
|
+
while not marker.exists():
|
|
27
|
+
if answers(interval):
|
|
28
|
+
milliseconds = time.clock_gettime_ns(time.CLOCK_BOOTTIME) // 1_000_000
|
|
29
|
+
# The user service is the sole writer. Publish the complete value at once.
|
|
30
|
+
temporary = marker.with_suffix('.tmp')
|
|
31
|
+
temporary.write_text(f'{milliseconds}\n', encoding='ascii')
|
|
32
|
+
temporary.replace(marker)
|
|
33
|
+
return
|
|
34
|
+
time.sleep(interval)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if __name__ == '__main__':
|
|
38
|
+
record_readiness(Path(sys.argv[1]), float(sys.argv[2]))
|
|
@@ -19,11 +19,38 @@
|
|
|
19
19
|
mode: '0755'
|
|
20
20
|
loop:
|
|
21
21
|
- t3-health.sh
|
|
22
|
+
- t3-boot-readiness.py
|
|
22
23
|
- t3-hang-snapshot.sh
|
|
23
24
|
- t3-listener.py
|
|
24
25
|
- t3-idle.py
|
|
25
26
|
- t3-renderers.py
|
|
26
27
|
- t3-local-only.py
|
|
28
|
+
- name: Declare the boot-time T3 readiness probe
|
|
29
|
+
ansible.builtin.copy:
|
|
30
|
+
dest: '{{ development_home }}/.config/systemd/user/personal-t3-boot-readiness.service'
|
|
31
|
+
owner: '{{ development_user }}'
|
|
32
|
+
mode: '0600'
|
|
33
|
+
content: |
|
|
34
|
+
# Managed by personal converge: ansible/ubuntu/t3-boot-readiness.py
|
|
35
|
+
[Unit]
|
|
36
|
+
Description=Record the first successful T3 API probe after boot
|
|
37
|
+
ConditionPathExists=!%t/personal-t3-boot-readiness-ms
|
|
38
|
+
[Service]
|
|
39
|
+
ExecStart=/usr/bin/python3 -I -B /usr/local/lib/personal-fleet/t3-boot-readiness.py %t/personal-t3-boot-readiness-ms {{ t3Service.bootProbeIntervalSeconds }}
|
|
40
|
+
Restart=on-failure
|
|
41
|
+
RestartSec={{ t3Service.bootProbeIntervalSeconds }}
|
|
42
|
+
[Install]
|
|
43
|
+
WantedBy=default.target
|
|
44
|
+
- name: Enable T3 readiness measurement for the next boot
|
|
45
|
+
become: true
|
|
46
|
+
become_user: '{{ development_user }}'
|
|
47
|
+
environment:
|
|
48
|
+
XDG_RUNTIME_DIR: '/run/user/{{ development_uid }}'
|
|
49
|
+
ansible.builtin.systemd_service:
|
|
50
|
+
scope: user
|
|
51
|
+
name: personal-t3-boot-readiness.service
|
|
52
|
+
daemon_reload: true
|
|
53
|
+
enabled: true
|
|
27
54
|
- name: Declare bounded recovery of the worker T3 desktop app
|
|
28
55
|
ansible.builtin.copy:
|
|
29
56
|
dest: '{{ development_home }}/.config/systemd/user/personal-worker-recovery.service'
|
package/docs/runbooks.md
CHANGED
|
@@ -375,7 +375,7 @@ runaway, write `1` to that agent scope’s `cgroup.kill`.
|
|
|
375
375
|
- `T3_NO_GRAPHICAL_SESSION`: logged by `personal-worker-recovery` on a desktop worker with a count: no graphical session is running, so the desktop app cannot run and the run fails. After three checks in a row the display manager is restarted so that auto-login starts a session, three times at most; after that the log says a person must log in at the worker.
|
|
376
376
|
- `T3_RESTART_DEADLINE`: not a failure. `personal-worker-recovery` logs it when a restart of T3 has waited `t3RestartMaxDeferralHours` (`ansible/ubuntu/policy.json`) and is applied although agent turns run: they end. `worker:t3-deadline-restarts` counts these of the last 24 hours as a warning. Nothing is left to repair: send the threads whose turn ended their next message.
|
|
377
377
|
- `WIP_GUARD_HEAVY`: a warning of `worker:wip-guard`: a run of the work-in-progress guard in the last 24 hours took longer than `resourceSafety.wipGuard.slowRunSeconds` or used more than `peakWarnMiB` (`ansible/ubuntu/policy.json`). Each run ends with a JSON `run` line in `journalctl --user -u personal-worker-wip-guard.service`. The cost is a worktree with a large tree of files Git does not ignore: ignore its build output or remove the worktree.
|
|
378
|
-
- `T3_BOOT_SERVING_LATE`: a failure of `worker:t3-health`: T3 answers now, but its
|
|
378
|
+
- `T3_BOOT_SERVING_LATE`: a failure of `worker:t3-health`: T3 answers now, but its first successful loopback probe was later than `t3Service.bootServingSeconds` (`ansible/ubuntu/policy.json`) after this boot. A worker that lost power is given that long to serve on loopback with no one at the machine. Read the journal of the T3 unit and of `personal-worker-recovery` for what delayed the start.
|
|
379
379
|
- `T3_HANG_SNAPSHOT`: not a failure. `personal-worker-recovery` logs it on the first failed check of the T3 local API with the directory it wrote under `~/.local/state/personal/t3-hangs` (the newest ten are kept): each thread of T3 with the kernel call it waits in (`wchan`), the pressure, the busiest processes and the journal of the unit. Read it before the third failed check restarts T3 and destroys the evidence. `worker:t3-health` names the newest one after a restart.
|
|
380
380
|
- `T3_RESTART_BACKOFF`: not a failure. `personal-worker-recovery` logs it when T3 is unresponsive again soon after the watchdog restarted it: each restart for unresponsiveness within the hour makes the next one wait twice as long (`t3Service.restartBackoffBaseSeconds`, at most `restartBackoffMaxSeconds` in `ansible/ubuntu/policy.json`), so a persistent fault does not restart T3 every few minutes. Find the cause in the snapshots (`T3_HANG_SNAPSHOT`).
|
|
381
381
|
- `T3_RESTARTS_FREQUENT`: a failure of `worker:t3-stability`: the watchdog restarted T3 for being unresponsive more than `t3Stability.maxRestarts24h` times in the last 24 hours. Each restart leaves a server that answers, so no other check reports it. The remedy names the newest snapshots of why T3 hung; look for agents or recovery jobs running heavy work at that time.
|
package/docs/worker-contract.md
CHANGED
|
@@ -163,10 +163,9 @@ removes the desktop unit, installs `t3code-headless.service` from the pinned
|
|
|
163
163
|
server archive the toolchain already holds, keeps `~/.t3` (environment
|
|
164
164
|
identity, pairing, history), repoints recovery to the new unit and starts it;
|
|
165
165
|
`converge --dry-run` lists what the worker loses. Back to `desktop` is the same
|
|
166
|
-
edit and also keeps `~/.t3`.
|
|
167
|
-
`fleet.json`: moving the MS-A2 workers is that consumer's change.
|
|
166
|
+
edit and also keeps `~/.t3`. Apply this change in the consumer project.
|
|
168
167
|
|
|
169
|
-
Canary, before more workers follow: converge one
|
|
168
|
+
Canary, before more workers follow: converge one unattended worker, confirm
|
|
170
169
|
`worker:t3-recovery`, `worker:t3-health`, `worker:t3-protection` and the
|
|
171
170
|
resource checks pass and the manager's link reconnects; open T3's preview
|
|
172
171
|
browser on a thread of that worker; and compare the restarts and slow probes
|
|
@@ -343,15 +342,18 @@ one:
|
|
|
343
342
|
After an unclean power loss a worker reaches "T3 answers on loopback" with
|
|
344
343
|
no one at the machine. `t3Service.bootServingSeconds` (`ansible/ubuntu/policy.json`,
|
|
345
344
|
180 seconds from the boot) is that limit, and `worker:t3-health` fails with
|
|
346
|
-
`T3_BOOT_SERVING_LATE` when
|
|
347
|
-
|
|
345
|
+
`T3_BOOT_SERVING_LATE` when the first successful loopback probe exceeds that limit.
|
|
346
|
+
The boot-time probe keeps its first observation in the worker's runtime
|
|
347
|
+
directory across T3 restarts. Measurement begins on the first boot after
|
|
348
|
+
installation. The tunnel registers once the server answers. The check measures the
|
|
348
349
|
loopback API, which is what the watchdog and the route both need. A desktop
|
|
349
350
|
worker's unit stores Chromium passwords in a file under `T3CODE_HOME`
|
|
350
351
|
(`--password-store=basic`), so a locked login keyring never blocks the T3
|
|
351
352
|
path; the RDP credential stays in the volatile session keyring. The VM test
|
|
352
|
-
power-cycles the guest without a clean shutdown and requires the
|
|
353
|
-
|
|
354
|
-
|
|
353
|
+
power-cycles the guest without a clean shutdown and requires the loopback
|
|
354
|
+
API to answer within that limit. The optional desktop VM run also checks
|
|
355
|
+
this limit and verifies RDP control while the login keyring is locked.
|
|
356
|
+
Tunnel registration after a power cut requires separate verification.
|
|
355
357
|
|
|
356
358
|
A package run cut off by a power loss is finished by the next sync: the
|
|
357
359
|
baseline waits for the APT lock, runs `dpkg --configure -a` once (bounded to
|
package/mise.lock
CHANGED
|
@@ -1619,10 +1619,10 @@ backend = "npm:vercel"
|
|
|
1619
1619
|
specifiers = ["68.5.0"]
|
|
1620
1620
|
|
|
1621
1621
|
[[tools."npm:wrangler"]]
|
|
1622
|
-
version = "4.
|
|
1623
|
-
aube = { path = ".mise/locks/npm-wrangler/4.
|
|
1622
|
+
version = "4.171.0"
|
|
1623
|
+
aube = { path = ".mise/locks/npm-wrangler/4.171.0", digest = "sha256:fcb2d440403de048e88881e422829f885c4bed4f4a4a4c2ca7a35a2f2957df36" }
|
|
1624
1624
|
backend = "npm:wrangler"
|
|
1625
|
-
specifiers = ["4.
|
|
1625
|
+
specifiers = ["4.171.0"]
|
|
1626
1626
|
|
|
1627
1627
|
[[tools.opentofu]]
|
|
1628
1628
|
version = "1.13.11"
|
package/mise.toml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/homelab",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "Keeps a set of development machines in sync: one manager and many workers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:crvouga/homelab",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=22"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "debd78cddc6e71eff3b3d6eecf5b86187687d603",
|
|
77
77
|
"gitCommittedAt": "2026-12-03"
|
|
78
78
|
}
|
package/schema/check-ids.json
CHANGED
|
@@ -2208,7 +2208,7 @@
|
|
|
2208
2208
|
},
|
|
2209
2209
|
{
|
|
2210
2210
|
"id": "worker:t3-health",
|
|
2211
|
-
"meaning": "T3 local API answers with its environment identity within 10 seconds, and
|
|
2211
|
+
"meaning": "T3 local API answers with its environment identity within 10 seconds, and any recorded first successful loopback probe falls within the boot-serving limit.",
|
|
2212
2212
|
"severity": "required",
|
|
2213
2213
|
"repair": {
|
|
2214
2214
|
"manual": "Re-converge the worker with converge: it applies the whole worker policy at the approved revision."
|
package/src/check-registry.ts
CHANGED
|
@@ -514,7 +514,7 @@ export const CHECK_MEANINGS: Record<string, string> = {
|
|
|
514
514
|
'worker:service-recovery': 'Worker services recover after failure.',
|
|
515
515
|
'worker:sudo': 'Designated worker user has noninteractive sudo.',
|
|
516
516
|
'worker:t3-health':
|
|
517
|
-
'T3 local API answers with its environment identity within 10 seconds, and
|
|
517
|
+
'T3 local API answers with its environment identity within 10 seconds, and any recorded first successful loopback probe falls within the boot-serving limit.',
|
|
518
518
|
'worker:convergence':
|
|
519
519
|
'The worker last applied the approved revision and its last apply succeeded.',
|
|
520
520
|
'worker:pressure-events':
|
|
@@ -204,7 +204,7 @@ async function recoveryChecks(
|
|
|
204
204
|
: 'The T3 desktop app runs as an enabled session service with automatic crash recovery.'
|
|
205
205
|
)
|
|
206
206
|
);
|
|
207
|
-
checks.push(await t3HealthCheck(run
|
|
207
|
+
checks.push(await t3HealthCheck(run));
|
|
208
208
|
checks.push(await wipGuardCheck(run));
|
|
209
209
|
checks.push(await t3StabilityCheck(run, userInfo().homedir));
|
|
210
210
|
checks.push(
|
|
@@ -269,32 +269,21 @@ export async function serviceRecoveryCheck(run: Runner): Promise<Check> {
|
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
/**
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
): Promise<number | null> {
|
|
278
|
-
const started = await run([
|
|
279
|
-
'systemctl',
|
|
280
|
-
'--user',
|
|
281
|
-
'show',
|
|
282
|
-
'--property=ActiveEnterTimestampMonotonic',
|
|
283
|
-
'--value',
|
|
284
|
-
t3Unit(session),
|
|
272
|
+
/** The retained first successful loopback probe, measured from this boot. */
|
|
273
|
+
async function bootToServingSeconds(run: Runner): Promise<number | null> {
|
|
274
|
+
const marker = await run([
|
|
275
|
+
'cat',
|
|
276
|
+
`/run/user/${userInfo().uid}/personal-t3-boot-readiness-ms`,
|
|
285
277
|
]);
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
278
|
+
const value = marker.stdout.trim();
|
|
279
|
+
const milliseconds = Number(value);
|
|
280
|
+
return marker.ok && /^\d+$/.test(value) && Number.isSafeInteger(milliseconds)
|
|
281
|
+
? milliseconds / 1000
|
|
282
|
+
: null;
|
|
290
283
|
}
|
|
291
284
|
|
|
292
|
-
/**
|
|
293
|
-
|
|
294
|
-
export async function t3HealthCheck(
|
|
295
|
-
run: Runner,
|
|
296
|
-
session: 'desktop' | 'headless' = 'desktop'
|
|
297
|
-
): Promise<Check> {
|
|
285
|
+
/** Check the current server independently of the boot readiness record. */
|
|
286
|
+
export async function t3HealthCheck(run: Runner): Promise<Check> {
|
|
298
287
|
const probe = await run(
|
|
299
288
|
[
|
|
300
289
|
'curl',
|
|
@@ -307,9 +296,7 @@ export async function t3HealthCheck(
|
|
|
307
296
|
{ timeoutMs: 15_000 }
|
|
308
297
|
);
|
|
309
298
|
const answers = probe.ok && hasEnvironmentIdentity(probe.stdout);
|
|
310
|
-
const boot = answers
|
|
311
|
-
? await bootServing(run, session)
|
|
312
|
-
: { late: false, summary: '' };
|
|
299
|
+
const boot = answers ? await bootServing(run) : { late: false, summary: '' };
|
|
313
300
|
const ok = answers && !boot.late;
|
|
314
301
|
return {
|
|
315
302
|
id: 'worker:t3-health',
|
|
@@ -321,7 +308,7 @@ export async function t3HealthCheck(
|
|
|
321
308
|
? {
|
|
322
309
|
remedy: {
|
|
323
310
|
action: boot.late
|
|
324
|
-
? 'The T3
|
|
311
|
+
? 'The first successful T3 loopback probe was later than t3Service.bootServingSeconds in ansible/ubuntu/policy.json. Read the journal of the T3 unit and of personal-worker-recovery for what delayed the start after boot.'
|
|
325
312
|
: 'Apply the approved converge revision over verified SSH, then rerun check --workers. No password prompt or state reset is attempted by health.',
|
|
326
313
|
},
|
|
327
314
|
}
|
|
@@ -342,22 +329,22 @@ function hasEnvironmentIdentity(response: string): boolean {
|
|
|
342
329
|
}
|
|
343
330
|
}
|
|
344
331
|
|
|
345
|
-
/** Compare the
|
|
332
|
+
/** Compare the first successful loopback probe with the boot-serving deadline. */
|
|
346
333
|
async function bootServing(
|
|
347
|
-
run: Runner
|
|
348
|
-
session: 'desktop' | 'headless'
|
|
334
|
+
run: Runner
|
|
349
335
|
): Promise<{ late: boolean; summary: string }> {
|
|
350
336
|
const limit = policy.t3Service.bootServingSeconds;
|
|
351
|
-
const serving = await bootToServingSeconds(run
|
|
352
|
-
if (serving === null)
|
|
337
|
+
const serving = await bootToServingSeconds(run);
|
|
338
|
+
if (serving === null)
|
|
339
|
+
return { late: false, summary: ' Boot readiness was not measured.' };
|
|
353
340
|
if (serving > limit)
|
|
354
341
|
return {
|
|
355
342
|
late: true,
|
|
356
|
-
summary: `T3_BOOT_SERVING_LATE: The T3
|
|
343
|
+
summary: `T3_BOOT_SERVING_LATE: The first successful T3 loopback probe was ${serving} seconds after boot, past the ${limit} seconds a worker is given to serve after a power loss.`,
|
|
357
344
|
};
|
|
358
345
|
return {
|
|
359
346
|
late: false,
|
|
360
|
-
summary: ` The T3
|
|
347
|
+
summary: ` The first successful T3 loopback probe was ${serving} seconds after boot (at most ${limit}).`,
|
|
361
348
|
};
|
|
362
349
|
}
|
|
363
350
|
|