@crvouga/dev-fleet 0.3.0 → 0.5.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/README.md +25 -17
- package/ansible/github/git.yml +66 -0
- package/ansible/macos/policy.json +12 -1
- package/ansible/monitoring/compose.yml +10 -0
- package/ansible/monitoring/container-watchdog.py +118 -0
- package/ansible/monitoring/hub-darwin.yml +146 -0
- package/ansible/net/remote-probe.sh +5 -0
- package/ansible/platforms.json +111 -0
- package/ansible/ubuntu/authorize-sudo.sh +7 -16
- package/ansible/ubuntu/baseline.yml +6 -28
- package/ansible/ubuntu/disk-gc.py +211 -7
- package/ansible/ubuntu/disk-guard.py +24 -5
- package/ansible/ubuntu/policy.json +68 -4
- package/ansible/ubuntu/t3-desktop.yml +2 -2
- package/ansible/ubuntu/tailscale.yml +20 -9
- package/ansible/ubuntu/tasks/browser.yml +56 -0
- package/ansible/ubuntu/tasks/docker.yml +52 -0
- package/ansible/ubuntu/tasks/dpkg.yml +46 -0
- package/ansible/ubuntu/tasks/install.yml +38 -0
- package/ansible/ubuntu/tasks/packages.yml +4 -55
- package/ansible/ubuntu/tasks/release.yml +25 -0
- package/ansible/ubuntu/tasks/resources.yml +7 -6
- package/ansible/ubuntu/tasks/services.yml +13 -0
- package/ansible/ubuntu/tasks/snapshot.yml +50 -0
- package/ansible/ubuntu/tasks/unattended-upgrades.yml +24 -0
- package/bootstrap/doctor.ts +32 -6
- package/bootstrap/fleet-remote-bootstrap.sh +49 -45
- package/bootstrap/setup.ts +23 -8
- package/bootstrap/worker-tools.ts +118 -0
- package/cliproxy/README.md +1 -1
- package/cliproxy/compose.yaml +4 -0
- package/cliproxy/scripts/checkpoint.py +1 -1
- package/docs/authentication.md +90 -0
- package/docs/consumer-setup.md +32 -30
- package/docs/declared.md +6 -5
- package/docs/machine-setup.md +22 -12
- package/docs/operations.md +87 -31
- package/docs/runbooks.md +377 -0
- package/docs/state.md +13 -7
- package/docs/support-matrix.md +36 -0
- package/docs/ubuntu-sync.md +16 -13
- package/docs/worker-contract.md +28 -1
- package/examples/fleet.json +19 -1
- package/llms.txt +2 -0
- package/mise.toml +7 -0
- package/package.json +2 -2
- package/schema/check-ids.json +526 -0
- package/schema/fleet.schema.json +185 -4
- package/schema/output/check.schema.json +23 -0
- package/schema/output/error.schema.json +14 -0
- package/schema/output/fleet-report.schema.json +79 -0
- package/schema/output/fleet-sync.schema.json +112 -0
- package/schema/output/report.schema.json +38 -0
- package/src/auth-checks.ts +3 -0
- package/src/cli/agent-guide.ts +5 -3
- package/src/cli/fleet-report.ts +126 -0
- package/src/cli/fleet-sync-manager.ts +11 -0
- package/src/cli/fleet-sync-plan.ts +200 -0
- package/src/cli/fleet-sync-remote.ts +4 -2
- package/src/cli/fleet-sync-schedule.ts +142 -35
- package/src/cli/fleet-sync.ts +90 -8
- package/src/cli/fleet-watch.ts +198 -0
- package/src/cli/fleet.ts +4 -0
- package/src/cli/register-fleet.ts +51 -0
- package/src/cli/registry.ts +13 -0
- package/src/cli/schedule-logs.ts +36 -0
- package/src/clock.ts +63 -0
- package/src/definition.ts +160 -12
- package/src/git-identity.ts +160 -0
- package/src/machine/platform.ts +48 -28
- package/src/machine/support-matrix.ts +76 -0
- package/src/machine-health.ts +51 -4
- package/src/manager-health.ts +205 -0
- package/src/manager-sync.ts +27 -9
- package/src/monitoring/hub-backup.ts +63 -17
- package/src/monitoring/manager-hub.ts +44 -2
- package/src/network-definition.ts +1 -1
- package/src/node-converge-linux.ts +16 -5
- package/src/node-converge.ts +1 -1
- package/src/notify.ts +239 -0
- package/src/platform/debian-version.ts +62 -0
- package/src/platform/ubuntu-audit.ts +11 -4
- package/src/platform/ubuntu-release.ts +41 -0
- package/src/remote-bootstrap.ts +89 -25
- package/src/remote-operation.ts +213 -0
- package/src/schedule-check.ts +40 -0
- package/src/secrets.ts +26 -8
- package/src/ssh.ts +10 -2
- package/src/state/history.ts +172 -0
- package/src/state/store.ts +11 -4
- package/src/tailscale.ts +51 -0
- package/src/toolchain-checks.ts +8 -3
- package/src/worker-capability-checks.ts +167 -0
- package/src/worker-capacity.ts +19 -7
- package/src/worker-host-checks.ts +68 -10
- package/src/worker-policy.ts +33 -0
- package/src/worker-readiness.ts +10 -1
package/src/worker-policy.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CAPABILITIES, record } from './config';
|
|
2
2
|
import { FleetUsageError } from './errors';
|
|
3
3
|
import type { Capability } from './types';
|
|
4
|
+
import { TOOL_PROFILES, type ToolProfile } from '../bootstrap/worker-tools';
|
|
4
5
|
|
|
5
6
|
export interface WorkerPolicy {
|
|
6
7
|
requiredCapabilities: Capability[];
|
|
@@ -12,6 +13,10 @@ export interface WorkerPolicy {
|
|
|
12
13
|
unattendedSudo: true;
|
|
13
14
|
persistentT3: true;
|
|
14
15
|
neverSleep: true;
|
|
16
|
+
/** Tool profiles every worker installs on top of the base tools. */
|
|
17
|
+
toolProfiles?: ToolProfile[];
|
|
18
|
+
/** Single tools pinned in dev-fleet's mise.toml every worker installs. */
|
|
19
|
+
tools?: string[];
|
|
15
20
|
}
|
|
16
21
|
const REQUIRED = [
|
|
17
22
|
'github',
|
|
@@ -41,8 +46,11 @@ function validPolicy(value: Record<string, unknown>): boolean {
|
|
|
41
46
|
'unattendedSudo',
|
|
42
47
|
'persistentT3',
|
|
43
48
|
'neverSleep',
|
|
49
|
+
'toolProfiles',
|
|
50
|
+
'tools',
|
|
44
51
|
].includes(key)
|
|
45
52
|
) &&
|
|
53
|
+
validTools(value) &&
|
|
46
54
|
validCapabilities(value['requiredCapabilities']) &&
|
|
47
55
|
typeof value['githubLogin'] === 'string' &&
|
|
48
56
|
/^[a-zA-Z0-9-]{1,39}$/.test(value['githubLogin']) &&
|
|
@@ -55,6 +63,31 @@ function validPolicy(value: Record<string, unknown>): boolean {
|
|
|
55
63
|
)
|
|
56
64
|
);
|
|
57
65
|
}
|
|
66
|
+
/** A list of known tool profiles, each once; null when it is not one. */
|
|
67
|
+
export function toolProfiles(value: unknown): ToolProfile[] | null {
|
|
68
|
+
return Array.isArray(value) &&
|
|
69
|
+
new Set(value).size === value.length &&
|
|
70
|
+
value.every((item) => TOOL_PROFILES.includes(item as ToolProfile))
|
|
71
|
+
? (value as ToolProfile[])
|
|
72
|
+
: null;
|
|
73
|
+
}
|
|
74
|
+
/** The optional tool profiles and single tools every worker adds. */
|
|
75
|
+
function validTools(value: Record<string, unknown>): boolean {
|
|
76
|
+
return (
|
|
77
|
+
(value['toolProfiles'] === undefined ||
|
|
78
|
+
toolProfiles(value['toolProfiles']) !== null) &&
|
|
79
|
+
(value['tools'] === undefined || toolNames(value['tools']))
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function toolNames(value: unknown): boolean {
|
|
83
|
+
return (
|
|
84
|
+
Array.isArray(value) &&
|
|
85
|
+
new Set(value).size === value.length &&
|
|
86
|
+
value.every(
|
|
87
|
+
(item) => typeof item === 'string' && /^[a-z0-9@:/._-]{1,75}$/i.test(item)
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
58
91
|
export function parseWorkerPolicy(value: unknown): WorkerPolicy {
|
|
59
92
|
if (!record(value) || !validPolicy(value))
|
|
60
93
|
throw new FleetUsageError(
|
package/src/worker-readiness.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { workerCapacity } from './worker-capacity';
|
|
2
2
|
import { userInfo, hostname } from 'node:os';
|
|
3
3
|
import { hostId } from './topology';
|
|
4
|
-
import { configPath } from './fleet-config';
|
|
4
|
+
import { configPath, fleet } from './fleet-config';
|
|
5
|
+
import { workerSelection } from '../bootstrap/worker-tools';
|
|
6
|
+
import { browserCheck, dockerRunCheck } from './worker-capability-checks';
|
|
7
|
+
import { gitChecks } from './git-identity';
|
|
5
8
|
import type { Check, Runner } from './types';
|
|
6
9
|
import { workerHostChecks } from './worker-host-checks';
|
|
7
10
|
import { workerAccessChecks } from './worker-access-checks';
|
|
@@ -59,6 +62,12 @@ export async function workerReadiness(
|
|
|
59
62
|
...host,
|
|
60
63
|
...access,
|
|
61
64
|
proxy,
|
|
65
|
+
await dockerRunCheck(run),
|
|
66
|
+
await browserCheck(
|
|
67
|
+
run,
|
|
68
|
+
workerSelection(fleet, nodeId).profiles.includes('web')
|
|
69
|
+
),
|
|
70
|
+
...(await gitChecks(fleet.git, run)),
|
|
62
71
|
...(await workerCapacity(root, nodeId, run)),
|
|
63
72
|
];
|
|
64
73
|
}
|