@crvouga/homelab 0.23.14 → 0.25.0
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-vercel/{68.0.0 → 68.2.0}/aube-lock.yaml +73 -297
- package/.mise/locks/npm-vercel/{68.0.0 → 68.2.0}/package.json +1 -1
- package/.mise/locks/npm-wrangler/{4.169.0 → 4.170.0}/aube-lock.yaml +42 -42
- package/.mise/locks/npm-wrangler/{4.169.0 → 4.170.0}/package.json +1 -1
- package/README.md +65 -87
- package/ansible/ubuntu/agent-tool.py +106 -1
- package/ansible/ubuntu/heavy.py +142 -0
- package/ansible/ubuntu/idle-reboot.py +125 -0
- package/ansible/ubuntu/policy.json +51 -3
- package/ansible/ubuntu/t3-desktop.yml +7 -0
- package/ansible/ubuntu/t3-hang-snapshot.sh +75 -0
- package/ansible/ubuntu/t3-headless.yml +7 -0
- package/ansible/ubuntu/t3-health.sh +71 -3
- package/ansible/ubuntu/t3-policy.yml +14 -5
- package/ansible/ubuntu/tasks/packages.yml +2 -0
- package/ansible/ubuntu/tasks/recovery.yml +5 -1
- package/ansible/ubuntu/tasks/resources.yml +25 -2
- package/ansible/ubuntu/tasks/unattended-upgrades.yml +24 -6
- package/ansible/ubuntu/tasks/updates.yml +59 -0
- package/bootstrap/doctor.ts +0 -4
- package/bootstrap/project-action.sh +4 -5
- package/bootstrap/shell-path.ts +17 -19
- package/cliproxy/README.md +5 -6
- package/cliproxy/config.template.yaml +1 -15
- package/cliproxy/docs/health-workflow.example.yml +6 -6
- package/cliproxy/docs/model-health.md +8 -8
- package/cliproxy/scripts/accounts.py +3 -4
- package/cliproxy/scripts/fleet_sync.py +2 -13
- package/cliproxy/scripts/ops +3 -21
- package/docs/authentication.md +21 -26
- package/docs/consumer-setup.md +31 -31
- package/docs/convergence.md +28 -32
- package/docs/declared.md +30 -31
- package/docs/github.md +0 -9
- package/docs/machine-setup.md +16 -17
- package/docs/manager-recovery.md +0 -2
- package/docs/operations.md +12 -11
- package/docs/releasing.md +24 -25
- package/docs/runbooks.md +22 -78
- package/docs/support-matrix.md +1 -1
- package/docs/ubuntu-sync.md +71 -65
- package/docs/worker-contract.md +112 -15
- package/examples/fleet.json +0 -2
- package/llms.txt +0 -2
- package/mise.lock +235 -809
- package/mise.toml +13 -28
- package/package.json +6 -6
- package/schema/check-ids.json +41 -482
- package/schema/fleet.schema.json +6 -61
- package/schema/output/fleet-sync.schema.json +23 -0
- package/schema/roster.schema.json +0 -2
- package/src/agent-session-limit.ts +2 -7
- package/src/auth-checks.ts +1 -3
- package/src/check-owners.ts +0 -13
- package/src/check-registry.ts +13 -72
- package/src/cli/agent-guide.ts +3 -16
- package/src/cli/command-index.ts +0 -12
- package/src/cli/fleet-sync-checkout.ts +10 -1
- package/src/cli/fleet-sync-manager.ts +4 -146
- package/src/cli/fleet-sync-output.ts +19 -4
- package/src/cli/fleet-sync-plan.ts +1 -24
- package/src/cli/fleet-sync-progress.ts +11 -2
- package/src/cli/fleet-sync-remote.ts +34 -1
- package/src/cli/fleet-sync-vault.ts +1 -2
- package/src/cli/fleet-sync.ts +8 -44
- package/src/cli/fleet.ts +1 -2
- package/src/cli/program.ts +3 -14
- package/src/cli/register-fleet.ts +1 -55
- package/src/cli/registry.ts +1 -43
- package/src/config.ts +0 -2
- package/src/definition.ts +8 -84
- package/src/fleet-config.ts +1 -1
- package/src/ide/definition.ts +2 -29
- package/src/ide/super.ts +4 -35
- package/src/ide/t3.ts +9 -38
- package/src/manager-sync.ts +15 -1
- package/src/node-converge-linux.ts +4 -47
- package/src/node-converge-shared.ts +1 -22
- package/src/package-info.ts +104 -6
- package/src/{agents/toolchain.ts → pinned-path.ts} +0 -17
- package/src/platform/agent-oom-check.ts +104 -0
- package/src/platform/t3-policy.ts +23 -36
- package/src/platform/t3-service.ts +117 -0
- package/src/platform/wip-guard-check.ts +65 -0
- package/src/remote-entry.ts +2 -41
- package/src/repair-catalog.ts +0 -30
- package/src/schedule-check.ts +17 -4
- package/src/service-auth.ts +0 -50
- package/src/state/litestream.ts +1 -1
- package/src/t3/retire-providers.ts +79 -0
- package/src/t3/version.ts +1 -1
- package/src/transport.ts +2 -6
- package/src/types.ts +0 -2
- package/src/version-parity.ts +0 -8
- package/src/worker-access-checks.ts +0 -75
- package/src/worker-host-checks.ts +78 -1
- package/src/worker-policy.ts +1 -5
- package/src/worker-readiness.ts +2 -0
- package/src/worker-sizing.ts +25 -0
- package/.mise/locks/azure-cli/2.93.0~a837e014/pyproject.toml +0 -5
- package/.mise/locks/azure-cli/2.93.0~a837e014/uv.lock +0 -2841
- package/.mise/locks/gemini/0.71.1~84aac8e6/aube-lock.yaml +0 -124
- package/.mise/locks/gemini/0.71.1~84aac8e6/package.json +0 -12
- package/agents/antigravity-proxy.ts +0 -3
- package/agents/audit.md +0 -88
- package/agents/bin/agy +0 -10
- package/agents/bin/antigravity +0 -10
- package/agents/bin/claude +0 -10
- package/agents/bin/codex +0 -10
- package/agents/bin/grok +0 -10
- package/agents/bin/opencode +0 -10
- package/agents/claude-proxy +0 -5
- package/agents/claude-proxy.ts +0 -3
- package/agents/codex-proxy.ts +0 -3
- package/agents/grok-proxy.ts +0 -3
- package/agents/managed-proxy.ts +0 -109
- package/agents/opencode-proxy.ts +0 -3
- package/agents/registry.json +0 -209
- package/agents/registry.schema.json +0 -149
- package/agents/setup.md +0 -158
- package/agents/t3.json +0 -40
- package/ansible/agents/agents.yml +0 -135
- package/ansible/agents/commands.yml +0 -32
- package/ansible/agents/receipts.yml +0 -19
- package/ansible/agents/templates/antigravity.settings.json.j2 +0 -3
- package/ansible/agents/templates/claude.settings.json.j2 +0 -3
- package/ansible/agents/templates/codex.config.toml.j2 +0 -11
- package/ansible/agents/templates/gemini.settings.json.j2 +0 -14
- package/ansible/agents/templates/grok.config.toml.j2 +0 -25
- package/ansible/agents/templates/opencode.json.j2 +0 -24
- package/ansible/agents/templates/receipt.json.j2 +0 -10
- package/ansible/t3/provider-keys.yml +0 -24
- package/docs/accounts.md +0 -256
- package/src/accounts/checks.ts +0 -226
- package/src/accounts/context.ts +0 -77
- package/src/accounts/propagate.ts +0 -62
- package/src/accounts/roster.ts +0 -112
- package/src/accounts/selection.ts +0 -67
- package/src/accounts/sessions.ts +0 -354
- package/src/agents/account-relay.ts +0 -279
- package/src/agents/accounts.ts +0 -94
- package/src/agents/admission.ts +0 -65
- package/src/agents/audit.ts +0 -77
- package/src/agents/cli.ts +0 -13
- package/src/agents/command.ts +0 -257
- package/src/agents/commands.ts +0 -127
- package/src/agents/converge.ts +0 -339
- package/src/agents/doctor.ts +0 -107
- package/src/agents/errors.ts +0 -2
- package/src/agents/files.ts +0 -43
- package/src/agents/fleet-verify.ts +0 -195
- package/src/agents/launch.ts +0 -361
- package/src/agents/native-verify.ts +0 -738
- package/src/agents/provider-errors.ts +0 -57
- package/src/agents/registry.ts +0 -61
- package/src/agents/render.ts +0 -121
- package/src/agents/round-trip.ts +0 -192
- package/src/agents/secrets.ts +0 -48
- package/src/agents/verify-cache.ts +0 -164
- package/src/agents/verify.ts +0 -129
- package/src/cli/fleet-accounts.ts +0 -294
- package/src/cli/fleet-sync-accounts.ts +0 -62
- package/src/cli/node-deployment.ts +0 -34
- package/src/cli/node-sync.ts +0 -121
- package/src/cli/node-t3.ts +0 -35
- package/src/cli/t3/command.ts +0 -91
- package/src/cli/t3/register.ts +0 -56
- package/src/configure.ts +0 -271
- package/src/github/copilot.ts +0 -54
- package/src/t3/accounts.ts +0 -90
- package/src/t3/antigravity.ts +0 -93
- package/src/t3/desired.ts +0 -174
- package/src/t3/diagnostics.ts +0 -42
- package/src/t3/models.ts +0 -354
- package/src/t3/names-check.ts +0 -53
- package/src/t3/names.ts +0 -155
- package/src/t3/plan.ts +0 -106
- package/src/t3/provider-keys.ts +0 -49
- package/src/t3/providers.ts +0 -102
- package/src/t3/reconcile.ts +0 -133
|
@@ -9,8 +9,8 @@ importers:
|
|
|
9
9
|
.:
|
|
10
10
|
dependencies:
|
|
11
11
|
wrangler:
|
|
12
|
-
specifier: 4.
|
|
13
|
-
version: 4.
|
|
12
|
+
specifier: 4.170.0
|
|
13
|
+
version: 4.170.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.20261129.1':
|
|
31
|
+
resolution: {integrity: sha512-3CBFQhU+hPjGUEVuBydhVIlV1vpFG2BR9Xv62LbgIL/DzY8F6oLgA+2iRzN49OZCyUbHFa7WEv766KcL2Amfrg==}
|
|
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.20261129.1':
|
|
37
|
+
resolution: {integrity: sha512-8Jj+pF2yLP9iYEXAtioO6F8S+D9Vn1u/7VDcGxELMxg299cN37xS0JG10mmOTGQbsmabRAV/aKuYwApLufogNA==}
|
|
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.20261129.1':
|
|
43
|
+
resolution: {integrity: sha512-MDIGDtM+yOV95KNN48GcGbOTl9+ngWVr2J32T09Ou88fdhL4S+vDTAiVMOZsK+ipZWprtBW+crcU7ek2MpXkyQ==}
|
|
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.20261129.1':
|
|
49
|
+
resolution: {integrity: sha512-0U7jPlNHfiAaeD2TROHzzZZUYwSX4SJTu5SA/A89jqlqhBY4raZBlRf1IzQwfYvQwKzmtlvju2ZjguvapwsFqg==}
|
|
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.20261129.1':
|
|
55
|
+
resolution: {integrity: sha512-Wzli8yhmD7Hj16hCDrwBTfF5L0xt2B/yr09UJFRYs32IVx0gmOYd8d9EhHQ9S4DODAQBKUnMWdZipdqZWK/k0g==}
|
|
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.60.0':
|
|
61
|
+
resolution: {integrity: sha512-E7AmXbkvFNjFiqc/6JctU/Y8pacsAEnc/AzMMWrJfYJz61SGgzp9Q0sk06KGJFrWxifIL5afA0hRnN+1RSNB0Q==}
|
|
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.20261129.0-beta:
|
|
571
|
+
resolution: {integrity: sha512-JMvkB+pBXW1pK0FTF4yANLhLfCv0TdwoXeOAkkw/EaQ9+qzJAO5jnEuXFj9lDeBcXXr/5oYkMNHNyOpgxt03Sg==}
|
|
572
572
|
engines: {node: '>=22.12.0'}
|
|
573
573
|
peerDependencies:
|
|
574
574
|
kerberos: ^2.0.0
|
|
@@ -643,17 +643,17 @@ 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.20261129.1:
|
|
647
|
+
resolution: {integrity: sha512-ASqCkTnd53qhWVKaqkPHOS/KbzaO8ps58nMuvRxfKsQOaXvzf0ncoyCdODEW+ond8tUHArF8Y9h2zfYqXcm8jw==}
|
|
648
648
|
engines: {node: '>=16'}
|
|
649
649
|
hasBin: true
|
|
650
650
|
|
|
651
|
-
wrangler@4.
|
|
652
|
-
resolution: {integrity: sha512-
|
|
651
|
+
wrangler@4.170.0:
|
|
652
|
+
resolution: {integrity: sha512-QKVXAFNHDCMj140jQ/+HDb3VJ7bjHiE2AGUxg+RZdxUZJsW+vgRYNYOZzSQ5Wn5nZAqR6iHvhhovYL6N1D20zA==}
|
|
653
653
|
engines: {node: '>=22.12.0'}
|
|
654
654
|
hasBin: true
|
|
655
655
|
peerDependencies:
|
|
656
|
-
'@cloudflare/workers-types': ^5.
|
|
656
|
+
'@cloudflare/workers-types': ^5.20261129.1
|
|
657
657
|
peerDependenciesMeta:
|
|
658
658
|
'@cloudflare/workers-types':
|
|
659
659
|
optional: true
|
|
@@ -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.20261129.1)':
|
|
684
684
|
dependencies:
|
|
685
685
|
unenv: 2.0.0-rc.24
|
|
686
686
|
optionalDependencies:
|
|
687
|
-
workerd: 1.
|
|
687
|
+
workerd: 1.20261129.1
|
|
688
688
|
|
|
689
|
-
'@cloudflare/workerd-darwin-64@1.
|
|
689
|
+
'@cloudflare/workerd-darwin-64@1.20261129.1':
|
|
690
690
|
optional: true
|
|
691
691
|
|
|
692
|
-
'@cloudflare/workerd-darwin-arm64@1.
|
|
692
|
+
'@cloudflare/workerd-darwin-arm64@1.20261129.1':
|
|
693
693
|
optional: true
|
|
694
694
|
|
|
695
|
-
'@cloudflare/workerd-linux-64@1.
|
|
695
|
+
'@cloudflare/workerd-linux-64@1.20261129.1':
|
|
696
696
|
optional: true
|
|
697
697
|
|
|
698
|
-
'@cloudflare/workerd-linux-arm64@1.
|
|
698
|
+
'@cloudflare/workerd-linux-arm64@1.20261129.1':
|
|
699
699
|
optional: true
|
|
700
700
|
|
|
701
|
-
'@cloudflare/workerd-windows-64@1.
|
|
701
|
+
'@cloudflare/workerd-windows-64@1.20261129.1':
|
|
702
702
|
optional: true
|
|
703
703
|
|
|
704
|
-
'@cloudflare/workers-utils@0.
|
|
704
|
+
'@cloudflare/workers-utils@0.60.0':
|
|
705
705
|
dependencies:
|
|
706
706
|
'@cspotcode/source-map-support': 0.8.1
|
|
707
707
|
chalk: 5.3.0
|
|
@@ -1102,12 +1102,12 @@ snapshots:
|
|
|
1102
1102
|
dependencies:
|
|
1103
1103
|
mime-db: 1.52.0
|
|
1104
1104
|
|
|
1105
|
-
miniflare@5.
|
|
1105
|
+
miniflare@5.20261129.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.
|
|
1110
|
+
workerd: 1.20261129.1
|
|
1111
1111
|
ws: 8.21.0
|
|
1112
1112
|
youch: 4.1.0-beta.10
|
|
1113
1113
|
transitivePeerDependencies:
|
|
@@ -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.20261129.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.20261129.1
|
|
1192
|
+
'@cloudflare/workerd-darwin-arm64': 1.20261129.1
|
|
1193
|
+
'@cloudflare/workerd-linux-64': 1.20261129.1
|
|
1194
|
+
'@cloudflare/workerd-linux-arm64': 1.20261129.1
|
|
1195
|
+
'@cloudflare/workerd-windows-64': 1.20261129.1
|
|
1196
1196
|
|
|
1197
|
-
wrangler@4.
|
|
1197
|
+
wrangler@4.170.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.20261129.1)
|
|
1201
|
+
'@cloudflare/workers-utils': 0.60.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.20261129.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.20261129.1
|
|
1212
1212
|
optionalDependencies:
|
|
1213
1213
|
fsevents: 2.3.3
|
|
1214
1214
|
transitivePeerDependencies:
|
package/README.md
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Keeps a set of development machines in sync: one **manager** and many
|
|
4
4
|
**workers**. One command, `converge`, brings every machine to the same
|
|
5
|
-
pinned tools, the same
|
|
6
|
-
uptime policy and the same monitoring. Adding or removing a machine is one
|
|
5
|
+
pinned tools, the same uptime policy and the same monitoring. Adding or removing a machine is one
|
|
7
6
|
entry in `fleet.json`.
|
|
8
7
|
|
|
9
8
|
Status: extracted from a working three-machine fleet and in daily use there.
|
|
@@ -49,9 +48,10 @@ homelab is opinionated. These are part of it, not options:
|
|
|
49
48
|
happens to it.
|
|
50
49
|
- The fleet state is kept in an **S3-compatible bucket** you own.
|
|
51
50
|
- Machines reach each other over **Tailscale**.
|
|
52
|
-
- Coding agents
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
- Coding agents are not homelab's. **T3 Code** installs, updates and signs in
|
|
52
|
+
each one on the machine it runs on; homelab pins and updates only T3 itself.
|
|
53
|
+
**CLIProxyAPI** on the manager only gathers the usage of the provider
|
|
54
|
+
accounts you add to it: no machine signs in through it.
|
|
55
55
|
- Machine policy is **Ansible** (`ansible/`), tool versions are **mise** pins
|
|
56
56
|
(`mise.toml`, `mise.lock`), monitoring is **Beszel**.
|
|
57
57
|
|
|
@@ -289,21 +289,14 @@ project, and which state is not in the bucket yet.
|
|
|
289
289
|
|
|
290
290
|
## Provider accounts
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
there `claude`, `codex`, `opencode`, `grok` and `antigravity` are the fleet's
|
|
301
|
-
launchers (`agents/bin`), ahead of the pinned CLIs on the `PATH` of every
|
|
302
|
-
shell. A person in a terminal on a worker, or an app that starts an agent over
|
|
303
|
-
SSH, therefore uses the proxy's accounts, picked by the fleet's selection
|
|
304
|
-
policy. The pinned CLI itself is still there, behind the launcher, as
|
|
305
|
-
`~/.local/share/mise/shims/claude`. The manager is your own machine: its
|
|
306
|
-
commands stay the pinned CLIs with whatever sign-in you gave them.
|
|
292
|
+
A machine signs in to each provider itself, in T3 Code, and T3 keeps those
|
|
293
|
+
agents up to date. homelab installs no agent CLI, renders no agent profile and
|
|
294
|
+
starts no agent through a launcher of its own.
|
|
295
|
+
|
|
296
|
+
The CLI proxy on the manager holds provider accounts only to gather their
|
|
297
|
+
usage: `homelab proxy accounts` lists them with their state, and
|
|
298
|
+
`homelab proxy add-account`, `relogin` and `remove-account` change one.
|
|
299
|
+
Nothing on a worker or on the manager authenticates through it.
|
|
307
300
|
|
|
308
301
|
## Add or remove a machine
|
|
309
302
|
|
|
@@ -335,8 +328,8 @@ commands stay the pinned CLIs with whatever sign-in you gave them.
|
|
|
335
328
|
([a limit on agent sessions](docs/worker-contract.md#a-limit-on-agent-sessions)).
|
|
336
329
|
|
|
337
330
|
3. Run `converge`. A machine that has only an SSH server and an account
|
|
338
|
-
with sudo is enough: every
|
|
339
|
-
|
|
331
|
+
with sudo is enough: every night proves that against a bare Ubuntu
|
|
332
|
+
machine, over SSH
|
|
340
333
|
([`fresh-box.feature`](features/fresh-box/fresh-box.feature)).
|
|
341
334
|
|
|
342
335
|
A new machine can also join by itself: `npx @crvouga/homelab provision --id ID
|
|
@@ -383,17 +376,17 @@ hand, on the manager or on a worker it is about to converge, before anything
|
|
|
383
376
|
is changed. [docs/state.md](docs/state.md#day-to-day) says how to keep or discard
|
|
384
377
|
one.
|
|
385
378
|
|
|
386
|
-
| Block | What it declares
|
|
387
|
-
| ---------- |
|
|
388
|
-
| `source` | The Git repository nodes accept code from (this one, or your fork)
|
|
389
|
-
| `state` | The bucket that holds the fleet state; never its credentials
|
|
390
|
-
| `secrets` | Where secrets are kept: `env`, `file`, `sops` or `vault`
|
|
391
|
-
| `manager` | The one macOS manager
|
|
392
|
-
| `workers` | The Ubuntu workers
|
|
393
|
-
| `services` | The proxy's public origin and the monitoring dashboard and accounts
|
|
394
|
-
| `worker` | Policy every worker must meet
|
|
395
|
-
| `ides` | The IDEs the fleet runs; `["t3"]` when absent
|
|
396
|
-
| `t3` | T3
|
|
379
|
+
| Block | What it declares |
|
|
380
|
+
| ---------- | ------------------------------------------------------------------------- |
|
|
381
|
+
| `source` | The Git repository nodes accept code from (this one, or your fork) |
|
|
382
|
+
| `state` | The bucket that holds the fleet state; never its credentials |
|
|
383
|
+
| `secrets` | Where secrets are kept: `env`, `file`, `sops` or `vault` |
|
|
384
|
+
| `manager` | The one macOS manager |
|
|
385
|
+
| `workers` | The Ubuntu workers |
|
|
386
|
+
| `services` | The proxy's public origin and the monitoring dashboard and accounts |
|
|
387
|
+
| `worker` | Policy every worker must meet |
|
|
388
|
+
| `ides` | The IDEs the fleet runs; `["t3"]` when absent |
|
|
389
|
+
| `t3` | T3 mesh access between enrolled machines, and shared settings (`profile`) |
|
|
397
390
|
|
|
398
391
|
### Supported IDEs
|
|
399
392
|
|
|
@@ -423,7 +416,7 @@ and start the app on the manager and enable Remote workspaces under Settings →
|
|
|
423
416
|
Experimental; it updates itself. Every `converge` then asks the app, through
|
|
424
417
|
its own CLI, for a remote workspace for each worker that has none, named after
|
|
425
418
|
the worker and pointed at the SSH alias `fleet.json` gives it, and measures
|
|
426
|
-
that the manager's own SSH finds Git
|
|
419
|
+
that the manager's own SSH finds Git and `flock`
|
|
427
420
|
there (`super:ssh`, `super:workspace`). The app connects with your SSH
|
|
428
421
|
configuration, so a worker needs an `ssh` alias that works from a terminal on
|
|
429
422
|
the manager. The `super:*` checks only warn, so an app that is closed never
|
|
@@ -435,13 +428,8 @@ account’s home. A dry run lists workspaces to create. The fleet records the ID
|
|
|
435
428
|
of each workspace it creates so retirement or an SSH alias change can remove
|
|
436
429
|
that grouping. Previously existing workspaces stay under their owner’s control.
|
|
437
430
|
|
|
438
|
-
|
|
439
|
-
sign
|
|
440
|
-
worker that command is the fleet's launcher (see
|
|
441
|
-
[Provider accounts](#provider-accounts)). `super:ssh` warns
|
|
442
|
-
(`SUPER_AGENTS_NOT_PROXIED`) about a worker where it is still the plain CLI,
|
|
443
|
-
until the next `converge` of that worker. Workspaces on the manager itself
|
|
444
|
-
start the manager's own CLIs, which homelab leaves as they are.
|
|
431
|
+
The agents the app starts are its own and the provider's to install and
|
|
432
|
+
sign in; homelab measures only that Git and flock are there.
|
|
445
433
|
|
|
446
434
|
What it does not do yet: homelab never removes a workspace, so delete a
|
|
447
435
|
retired worker's in the app. Projects are yours to add to a workspace, and the
|
|
@@ -472,19 +460,7 @@ machine's own, and one edited on a machine since `converge` last wrote it
|
|
|
472
460
|
is reported as `T3_PROFILE_CONFLICT` by the check `t3:profile`, never
|
|
473
461
|
overwritten.
|
|
474
462
|
|
|
475
|
-
|
|
476
|
-
instance `converge` hides the models of T3's catalogue that its account does
|
|
477
|
-
not serve and lists the preferred default it serves first, so the instance
|
|
478
|
-
shows, and opens on, a model that works. Which catalogue models are hidden
|
|
479
|
-
there is the fleet's: one hidden by hand is shown again while its account
|
|
480
|
-
serves it. Until a sync, the check `t3:models` says what it would change
|
|
481
|
-
(`T3_MODELS_PENDING`). It reports as `T3_MODELS_MISMATCH` only what cannot
|
|
482
|
-
work: a custom model or a T3 default the proxy does not serve, an account that
|
|
483
|
-
serves none of its tool's preferred defaults, and a model in
|
|
484
|
-
`t3.requiredModels` that is missing.
|
|
485
|
-
|
|
486
|
-
Secrets are asked for by purpose (`proxy-client-key`,
|
|
487
|
-
`monitoring-account-password`, `monitoring-tunnel-token`,
|
|
463
|
+
Secrets are asked for by purpose (`monitoring-account-password`, `monitoring-tunnel-token`,
|
|
488
464
|
`proxy-tunnel-token`); see [`src/secrets.ts`](src/secrets.ts).
|
|
489
465
|
|
|
490
466
|
`converge` records the configuration it applies in the fleet state, so a
|
|
@@ -559,8 +535,7 @@ fleet.json contents.
|
|
|
559
535
|
| `src/` | Inventory, orchestration, verification, the report; `src/cli` CLI |
|
|
560
536
|
| `src/state/` | The fleet state database and its replication to the bucket |
|
|
561
537
|
| `ansible/` | Machine policy: `ubuntu/`, `macos/`, `monitoring/` |
|
|
562
|
-
| `
|
|
563
|
-
| `cliproxy/` | The CLIProxyAPI service: install, audit, backup, model health |
|
|
538
|
+
| `cliproxy/` | The CLIProxyAPI service: install, audit, backup, recovery |
|
|
564
539
|
| `bootstrap/` | Toolchain bootstrap and the manager and worker entry scripts |
|
|
565
540
|
| `schema/` | JSON schemas for `fleet.json`, the roster and command output; check IDs |
|
|
566
541
|
| `examples/` | A complete example configuration |
|
|
@@ -593,32 +568,34 @@ package's Python tests. Features run against `examples/fleet.json` and never
|
|
|
593
568
|
contact a real machine.
|
|
594
569
|
|
|
595
570
|
Checks run in three tiers ([`ci.yml`](.github/workflows/ci.yml),
|
|
596
|
-
[`nightly.yml`](.github/workflows/nightly.yml))
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
|
600
|
-
|
|
|
601
|
-
|
|
|
602
|
-
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
Ubuntu
|
|
610
|
-
release
|
|
611
|
-
is
|
|
612
|
-
|
|
613
|
-
| Check | What it proves
|
|
614
|
-
| --------------------- |
|
|
615
|
-
|
|
|
616
|
-
|
|
|
617
|
-
|
|
|
618
|
-
|
|
|
619
|
-
|
|
|
620
|
-
|
|
|
621
|
-
|
|
|
571
|
+
[`nightly.yml`](.github/workflows/nightly.yml)), each inside a hard time
|
|
572
|
+
limit:
|
|
573
|
+
|
|
574
|
+
| Tier | When | Limit | What runs |
|
|
575
|
+
| ------------ | ------------------------------------------------ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
576
|
+
| Pull request | A pull request, or a dispatch off `main` | 2 minutes | Format, typecheck, lint and the features the diff affects, split over four jobs. Fleet state, workflows, playbooks and the proxy run only when the diff reaches them. No machine is started. |
|
|
577
|
+
| Release | A push to `main`, or a dispatch on `main` | 5 minutes | The pull request checks over every feature, then the package packed, installed on Node 22 and 24, published and tagged. No machine is started. |
|
|
578
|
+
| Nightly | 07:17 UTC, or a dispatch of the Nightly workflow | 30 minutes | Every accepted Ubuntu release and architecture, both fresh-worker features, the monitoring agent and the manager on macOS. The Ubuntu VM (04:17) and the tailnet test (04:41) are workflows of their own on the same night. |
|
|
579
|
+
|
|
580
|
+
The limits are hard. Every job of a workflow is stopped when its tier's limit
|
|
581
|
+
is reached and fails like any failed job, so a check that grows past a limit
|
|
582
|
+
is found the day it does. What does not fit moves to a slower tier, never to
|
|
583
|
+
a longer limit: a bare Ubuntu machine over SSH takes six minutes and the
|
|
584
|
+
Ubuntu VM twenty, so they run at night. A failure at night never holds a pull
|
|
585
|
+
request or a release: it is queued as an issue (below) for whoever picks it up.
|
|
586
|
+
The load soak (`soak.yml`) is longer than a night and runs weekly.
|
|
587
|
+
|
|
588
|
+
| Check | What it proves |
|
|
589
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
590
|
+
| Format, types, lint | Prettier, `tsc` and ESLint pass |
|
|
591
|
+
| Features | The features the diff affects pass, in four jobs of about the same length |
|
|
592
|
+
| Python tests | The VM setup and snapshot examples, and the proxy package when it changes |
|
|
593
|
+
| Fleet state | The pinned Litestream replicates the fleet state to a directory and to an S3 API, and a second manager restores it |
|
|
594
|
+
| Fresh worker over SSH | (night) A new Ubuntu machine with only an SSH server and sudo is bootstrapped by the production code over real SSH |
|
|
595
|
+
| Workflows | The workflow files pass `actionlint` |
|
|
596
|
+
| Playbooks | Every playbook passes `ansible-lint` (production profile, which syntax-checks it), and every pinned package is in the pinned snapshot |
|
|
597
|
+
| Manager on macOS | (night) The macOS features, and the manager playbook converged, then re-run and checked with no change |
|
|
598
|
+
| Monitoring agent | (night) The agent playbook applied on a machine running systemd, and the pinned T3 server's session limit |
|
|
622
599
|
|
|
623
600
|
The ruleset of `main` requires one check, **Required checks**, which passes
|
|
624
601
|
when every job passed or was skipped, and fails when one failed. A job that
|
|
@@ -627,11 +604,12 @@ A failed job opens or updates one issue, `CI failure: <tier> / <job>`, and
|
|
|
627
604
|
the next green run of that same job and tier closes it. A pull request is
|
|
628
605
|
`pr`, CI on `main` is `release` and a night is `nightly`. The same queue
|
|
629
606
|
covers the workflows that follow: the publish workflow (`publish`), the
|
|
630
|
-
|
|
631
|
-
(`catch-up`). A publish run that releases
|
|
632
|
-
not pass, changes no issue.
|
|
633
|
-
|
|
634
|
-
|
|
607
|
+
nightly Ubuntu VM (`vm`), the nightly tailnet test (`tailnet`), the weekly
|
|
608
|
+
load soak (`soak`) and catch-up (`catch-up`). A publish run that releases
|
|
609
|
+
nothing, because CI on `main` did not pass, changes no issue. A job that is
|
|
610
|
+
stopped at its limit fails, so it is queued the same way. A release does not
|
|
611
|
+
wait for the Ubuntu VM or the tailnet test: they run every night and queue
|
|
612
|
+
their own failures.
|
|
635
613
|
|
|
636
614
|
A pull request needs nobody attending
|
|
637
615
|
([`pull-requests.feature`](features/rules/pull-requests.feature)):
|
|
@@ -60,6 +60,89 @@ def grant(policy, budget, reserve, headroom, reservations):
|
|
|
60
60
|
return granted if granted >= minimum else 0
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
def cpu_limits(policy, cpus, agents):
|
|
64
|
+
"""The CPU quota of one tool scope, in percent of one CPU, and the number of
|
|
65
|
+
parallel jobs a tool should start by default: the quota in cores shared by
|
|
66
|
+
the agents that are running. Never below one CPU or one job."""
|
|
67
|
+
quota = max(100, cpus * policy.get('agentCpu', {}).get('toolPercentOfCores', 25))
|
|
68
|
+
return quota, max(1, (quota // 100) // max(1, agents))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def default_environment(env, jobs):
|
|
72
|
+
"""The tool settings an agent did not choose itself, from the job count.
|
|
73
|
+
A value that is already set is the agent's and is never replaced. (A JVM
|
|
74
|
+
sizes its heap from the memory cap of the scope, so none is set here.)"""
|
|
75
|
+
out = dict(env)
|
|
76
|
+
out.setdefault('TURBO_CONCURRENCY', str(jobs))
|
|
77
|
+
out.setdefault('UV_THREADPOOL_SIZE', str(max(4, jobs)))
|
|
78
|
+
if 'org.gradle.workers.max' not in out.get('GRADLE_OPTS', ''):
|
|
79
|
+
out['GRADLE_OPTS'] = (out.get('GRADLE_OPTS', '') + ' -Dorg.gradle.workers.max=%d' % jobs).strip()
|
|
80
|
+
return out
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def heavy_functions(names):
|
|
84
|
+
"""Shell functions, exported through the environment, that send a known
|
|
85
|
+
heavy tool through the worker-wide queue (heavy.py). Only the first word of
|
|
86
|
+
a name is a function; a second word (`bun test`) limits it to that
|
|
87
|
+
subcommand and the rest of the tool is run as it was."""
|
|
88
|
+
functions = {}
|
|
89
|
+
for name in names:
|
|
90
|
+
words = name.split()
|
|
91
|
+
tool = words[0]
|
|
92
|
+
queued = 'homelab-heavy %s "$@"' % tool
|
|
93
|
+
if len(words) == 1:
|
|
94
|
+
body = queued
|
|
95
|
+
else:
|
|
96
|
+
body = 'if [ "$1" = %s ]; then %s; else command %s "$@"; fi' % (words[1], queued, tool)
|
|
97
|
+
functions['BASH_FUNC_%s%%%%' % tool] = '() { %s\n}' % body
|
|
98
|
+
return functions
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def oom_message(returncode, events, cap_mib, tool):
|
|
102
|
+
"""What the agent is told when a tool ended with SIGKILL: the cause when the
|
|
103
|
+
scope's memory events say so, and what to do about it. None otherwise."""
|
|
104
|
+
if returncode not in (137, -9):
|
|
105
|
+
return None
|
|
106
|
+
if events.get('oom_kill', 0) > 0:
|
|
107
|
+
return ('AGENT_TOOL_OOM_KILLED: %s used more than its memory cap of %d MiB and the kernel killed it. '
|
|
108
|
+
'Start fewer parallel jobs (TURBO_CONCURRENCY, gradle --max-workers, bun test --concurrency) '
|
|
109
|
+
'and run it again; the cap is shared out by what other agents on the worker use.'
|
|
110
|
+
% (tool, cap_mib))
|
|
111
|
+
return ('AGENT_TOOL_KILLED: %s ended with SIGKILL. If memory was the cause, its cap was %d MiB '
|
|
112
|
+
'(memory.high slows it before that); start fewer parallel jobs and run it again.'
|
|
113
|
+
% (tool, cap_mib))
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def tool_name(argv):
|
|
117
|
+
"""The program a shell command line starts, for a message and a record:
|
|
118
|
+
the first word of the `-c` string, as a name and never with its arguments."""
|
|
119
|
+
for at, argument in enumerate(argv[:-1]):
|
|
120
|
+
if argument.startswith('-') and not argument.startswith('--') and 'c' in argument:
|
|
121
|
+
words = argv[at + 1].split()
|
|
122
|
+
return os.path.basename(words[0]) if words else 'the tool'
|
|
123
|
+
return 'the tool'
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def record_oom(kind, tool, cap_mib):
|
|
127
|
+
"""Leave a line the user and `worker:agent-oom` can read: when, what, how
|
|
128
|
+
big. The command's arguments are never recorded."""
|
|
129
|
+
state = Path(os.environ.get('XDG_STATE_HOME') or Path.home() / '.local/state') / 'personal'
|
|
130
|
+
try:
|
|
131
|
+
state.mkdir(parents=True, exist_ok=True)
|
|
132
|
+
with (state / 'agent-oom.ndjson').open('a') as log:
|
|
133
|
+
log.write(json.dumps(dict(t=int(time.time()), kind=kind, tool=tool, capMiB=cap_mib)) + '\n')
|
|
134
|
+
except OSError:
|
|
135
|
+
pass
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def read_events(path):
|
|
139
|
+
try:
|
|
140
|
+
return {key: int(value) for key, value in
|
|
141
|
+
(line.split() for line in path.read_text().splitlines() if line)}
|
|
142
|
+
except (OSError, ValueError):
|
|
143
|
+
return {}
|
|
144
|
+
|
|
145
|
+
|
|
63
146
|
def main():
|
|
64
147
|
policy = json.loads(Path(__file__).with_name('agent-tool-policy.json').read_text())
|
|
65
148
|
runtime = Path(os.environ['XDG_RUNTIME_DIR'])
|
|
@@ -89,10 +172,17 @@ def main():
|
|
|
89
172
|
unit = 'homelab-tool-' + uuid.uuid4().hex + '.scope'
|
|
90
173
|
env = dict(os.environ)
|
|
91
174
|
env.pop('BASH_ENV', None)
|
|
175
|
+
agents = sum(1 for _ in root.glob('t3code-*.scope'))
|
|
176
|
+
quota, jobs = cpu_limits(policy, len(os.sched_getaffinity(0)), agents)
|
|
177
|
+
env = default_environment(env, jobs)
|
|
178
|
+
env.update(heavy_functions(policy.get('heavy', {}).get('names', [])))
|
|
179
|
+
high = budget * policy.get('highPercent', 80) // 100 // (1024 * 1024) * (1024 * 1024)
|
|
92
180
|
child = subprocess.Popen([
|
|
93
181
|
'/usr/bin/systemd-run', '--user', '--scope', '--quiet', '--collect',
|
|
94
182
|
'--slice=app-t3code-agents.slice', '--unit=' + unit,
|
|
183
|
+
'--property=MemoryHigh=' + str(high),
|
|
95
184
|
'--property=MemoryMax=' + str(budget),
|
|
185
|
+
'--property=CPUQuota=%d%%' % quota,
|
|
96
186
|
'--property=MemorySwapMax=' + str(policy['swapMiB']) + 'M',
|
|
97
187
|
'--property=OOMPolicy=stop', '--property=IOAccounting=yes',
|
|
98
188
|
'--property=TimeoutStopSec=10s',
|
|
@@ -118,7 +208,22 @@ def main():
|
|
|
118
208
|
sys.stderr.write('AGENT_TOOL_REFUSED: tool scope startup was not observed.\n')
|
|
119
209
|
return 75
|
|
120
210
|
time.sleep(0.02)
|
|
121
|
-
|
|
211
|
+
# Keep the scope's memory events while it runs: it is gone once it ends,
|
|
212
|
+
# and they say whether the kernel killed the tool for its memory. wait()
|
|
213
|
+
# returns the moment the tool ends, so a short command is not delayed.
|
|
214
|
+
events = {}
|
|
215
|
+
while True:
|
|
216
|
+
try:
|
|
217
|
+
code = child.wait(timeout=0.25)
|
|
218
|
+
break
|
|
219
|
+
except subprocess.TimeoutExpired:
|
|
220
|
+
events = read_events(root / unit / 'memory.events') or events
|
|
221
|
+
tool = tool_name(sys.argv[1:])
|
|
222
|
+
message = oom_message(code, events, budget // (1024 * 1024), tool)
|
|
223
|
+
if message:
|
|
224
|
+
sys.stderr.write(message + '\n')
|
|
225
|
+
record_oom(message.split(':', 1)[0], tool, budget // (1024 * 1024))
|
|
226
|
+
return code
|
|
122
227
|
|
|
123
228
|
|
|
124
229
|
if __name__ == '__main__':
|