@crvouga/dev-fleet 0.7.0 → 0.9.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 +88 -7
- package/agents/audit.md +18 -18
- package/ansible/agents/agents.yml +134 -0
- package/ansible/agents/templates/antigravity.settings.json.j2 +3 -0
- package/ansible/agents/templates/claude.settings.json.j2 +3 -0
- package/ansible/agents/templates/codex.config.toml.j2 +11 -0
- package/ansible/agents/templates/gemini.settings.json.j2 +14 -0
- package/ansible/agents/templates/grok.config.toml.j2 +19 -0
- package/ansible/agents/templates/opencode.json.j2 +24 -0
- package/ansible/agents/templates/receipt.json.j2 +10 -0
- package/ansible/ansible.cfg +14 -0
- package/ansible/github/git.yml +82 -0
- package/ansible/macos/manager-privilege.yml +83 -0
- package/ansible/macos/manager.yml +164 -9
- package/ansible/macos/policy.json +13 -0
- package/ansible/macos/t3-policy.yml +5 -3
- package/ansible/macos/vault-renew.yml +85 -0
- package/ansible/macos/worker-host-key.yml +33 -0
- package/ansible/monitoring/agent-darwin.yml +3 -0
- package/ansible/monitoring/agent.yml +2 -0
- package/ansible/monitoring/hub-darwin.yml +3 -0
- package/ansible/monitoring/hub-route-darwin.yml +1 -0
- package/ansible/net/remote-probe.sh +4 -1
- package/ansible/platforms.json +2 -2
- package/ansible/pyproject.toml +5 -0
- package/ansible/ubuntu/baseline.yml +39 -13
- package/ansible/ubuntu/disk-gc.py +6 -2
- package/ansible/ubuntu/firewall.nft.j2 +50 -0
- package/ansible/ubuntu/policy.json +125 -6
- package/ansible/ubuntu/reboot.yml +89 -0
- package/ansible/ubuntu/recovery.yml +13 -3
- package/ansible/ubuntu/t3/policy.json +3 -0
- package/ansible/ubuntu/t3-desktop.yml +23 -2
- package/ansible/ubuntu/t3-headless.yml +128 -0
- package/ansible/ubuntu/t3-health.sh +24 -10
- package/ansible/ubuntu/t3-idle.py +37 -2
- package/ansible/ubuntu/t3-policy.yml +4 -1
- package/ansible/ubuntu/t3-route.yml +1 -0
- package/ansible/ubuntu/tailscale.yml +54 -8
- package/ansible/ubuntu/tasks/browser.yml +3 -0
- package/ansible/ubuntu/tasks/containers-off.yml +43 -0
- package/ansible/ubuntu/tasks/docker.yml +53 -6
- package/ansible/ubuntu/tasks/dpkg.yml +4 -0
- package/ansible/ubuntu/tasks/features.yml +22 -0
- package/ansible/ubuntu/tasks/firewall.yml +172 -0
- package/ansible/ubuntu/tasks/install.yml +2 -1
- package/ansible/ubuntu/tasks/packages.yml +4 -2
- package/ansible/ubuntu/tasks/release.yml +6 -0
- package/ansible/ubuntu/tasks/resources.yml +6 -4
- package/ansible/ubuntu/tasks/services.yml +2 -2
- package/ansible/ubuntu/tasks/sizing.yml +49 -0
- package/ansible/ubuntu/tasks/snapshot.yml +14 -3
- package/ansible/ubuntu/tasks/ssh.yml +61 -4
- package/ansible/ubuntu/tasks/t3-restart.yml +3 -1
- package/ansible/ubuntu/tasks/user.yml +1 -0
- package/ansible/ubuntu/worker-account.yml +117 -0
- package/ansible/uv.lock +265 -0
- package/bin/devfleet.mjs +42 -4
- package/bootstrap/fleet-remote-bootstrap.sh +91 -25
- package/bootstrap/global-config.ts +29 -3
- package/bootstrap/package-smoke.ts +127 -0
- package/bootstrap/pins.ts +189 -0
- package/bootstrap/release-notes.ts +88 -0
- package/bootstrap/release-version.ts +41 -7
- package/bootstrap/worker-features.ts +114 -0
- package/bootstrap/worker-seed.yaml +65 -0
- package/bootstrap/worker-tools.ts +39 -9
- package/cliproxy/README.md +1 -1
- package/cliproxy/docs/health-workflow.example.yml +20 -143
- package/docs/authentication.md +21 -11
- package/docs/consumer-setup.md +74 -58
- package/docs/convergence.md +67 -0
- package/docs/declared.md +61 -34
- package/docs/machine-setup.md +73 -7
- package/docs/manager-setup.md +34 -0
- package/docs/operations.md +64 -9
- package/docs/releasing.md +49 -1
- package/docs/runbooks.md +112 -7
- package/docs/state.md +23 -11
- package/docs/support-matrix.md +40 -4
- package/docs/topology.md +82 -12
- package/docs/ubuntu-sync.md +98 -42
- package/docs/worker-contract.md +122 -19
- package/docs/worker-requirements.md +107 -0
- package/examples/fleet.json +1 -0
- package/examples/workers-from-infrastructure/main.tf +132 -0
- package/examples/workers-from-infrastructure/worker-records.json +14 -0
- package/llms.txt +3 -1
- package/mise.lock +29 -0
- package/mise.toml +5 -3
- package/package.json +2 -2
- package/schema/check-ids.json +1991 -162
- package/schema/check-ids.schema.json +34 -0
- package/schema/fleet.schema.json +349 -10
- package/schema/output/check.schema.json +1 -1
- package/schema/output/fleet-state-definition.schema.json +14 -0
- package/schema/output/fleet-sync-schedule.schema.json +26 -0
- package/schema/output/fleet-sync.schema.json +18 -0
- package/schema/output/report.schema.json +3 -2
- package/schema/worker-record.schema.json +76 -0
- package/src/agents/converge.ts +140 -24
- package/src/agents/files.ts +2 -32
- package/src/agents/native-verify.ts +34 -3
- package/src/agents/secrets.ts +39 -4
- package/src/check-owners.ts +62 -2
- package/src/check-registry.ts +630 -0
- package/src/cli/agent-guide.ts +3 -3
- package/src/cli/cli.ts +4 -0
- package/src/cli/fleet-manifest.ts +108 -0
- package/src/cli/fleet-node-lifecycle.ts +704 -0
- package/src/cli/fleet-node-park.ts +238 -0
- package/src/cli/fleet-node-seed.ts +167 -0
- package/src/cli/fleet-state.ts +2 -1
- package/src/cli/fleet-sync-checkout.ts +7 -0
- package/src/cli/fleet-sync-enrollment.ts +193 -32
- package/src/cli/fleet-sync-forward.ts +6 -0
- package/src/cli/fleet-sync-manager.ts +123 -8
- package/src/cli/fleet-sync-output.ts +31 -11
- package/src/cli/fleet-sync-plan.ts +65 -9
- package/src/cli/fleet-sync-records.ts +113 -0
- package/src/cli/fleet-sync-remote.ts +172 -15
- package/src/cli/fleet-sync-schedule.ts +14 -4
- package/src/cli/fleet-sync-state.ts +31 -10
- package/src/cli/fleet-sync-vault.ts +152 -26
- package/src/cli/fleet-sync-worker.ts +214 -0
- package/src/cli/fleet-sync.ts +172 -21
- package/src/cli/fleet-validate.ts +277 -0
- package/src/cli/fleet-watch.ts +7 -1
- package/src/cli/fleet.ts +87 -5
- package/src/cli/managed-health.ts +25 -1
- package/src/cli/register-fleet.ts +251 -4
- package/src/cli/registry.ts +47 -0
- package/src/cli/tailnet.ts +43 -10
- package/src/cli/ui-data.ts +3 -1
- package/src/cli/worker-usage-report.ts +63 -0
- package/src/clock.ts +42 -0
- package/src/definition.ts +762 -232
- package/src/diagnostics.ts +5 -2
- package/src/exposure.ts +102 -0
- package/src/fleet-config.ts +3 -1
- package/src/git-identity.ts +76 -3
- package/src/ide/ide.ts +5 -0
- package/src/ide/t3.ts +12 -2
- package/src/input-hashes.ts +6 -0
- package/src/machine/machine-class.ts +59 -0
- package/src/machine/platform.ts +90 -11
- package/src/machine/state.ts +70 -16
- package/src/machine/support-matrix.ts +11 -9
- package/src/machine-health.ts +28 -5
- package/src/manager-health.ts +148 -2
- package/src/manager-sync.ts +89 -8
- package/src/monitoring/beszel.ts +8 -8
- package/src/monitoring/enroll.ts +8 -1
- package/src/monitoring/hub-access.ts +10 -4
- package/src/monitoring/systems.ts +138 -0
- package/src/network-definition.ts +13 -4
- package/src/node-converge-linux.ts +136 -27
- package/src/node-converge.ts +13 -3
- package/src/platform/ansible-receipt.ts +17 -2
- package/src/platform/ansible.ts +40 -4
- package/src/platform/manager-host.ts +25 -8
- package/src/platform/resource-verify.ts +18 -7
- package/src/platform/t3-policy.ts +24 -10
- package/src/platform/t3-service.ts +109 -34
- package/src/platform/ubuntu-release.ts +24 -0
- package/src/platform/ubuntu-verify.ts +31 -3
- package/src/platform/ubuntu-worker.ts +58 -0
- package/src/platform/worker-platform.ts +72 -0
- package/src/protocol.ts +1 -1
- package/src/public-reachability.ts +186 -0
- package/src/remote-bootstrap.ts +50 -12
- package/src/remote-operation.ts +18 -4
- package/src/repair-plan.ts +23 -12
- package/src/report.ts +2 -1
- package/src/schedule-check.ts +21 -2
- package/src/secrets.ts +7 -0
- package/src/service-auth.ts +55 -48
- package/src/ssh-connection.ts +141 -0
- package/src/ssh.ts +63 -24
- package/src/state/store.ts +4 -2
- package/src/state/sync.ts +35 -6
- package/src/state/workers.ts +140 -0
- package/src/t3/pairing.ts +59 -0
- package/src/t3/peer-link.ts +333 -0
- package/src/t3/version.ts +1 -1
- package/src/tailnet-cleanup.ts +185 -0
- package/src/tailnet-control.ts +346 -0
- package/src/tailscale.ts +1 -1
- package/src/toolchain-checks.ts +11 -1
- package/src/types.ts +4 -2
- package/src/worker-account.ts +63 -0
- package/src/worker-activity.ts +303 -0
- package/src/worker-capacity.ts +31 -0
- package/src/worker-credentials.ts +201 -0
- package/src/worker-exposure.ts +388 -0
- package/src/worker-features.ts +201 -0
- package/src/worker-host-checks.ts +71 -20
- package/src/worker-manifest.ts +224 -0
- package/src/worker-parking.ts +70 -0
- package/src/worker-policy.ts +38 -36
- package/src/worker-readiness.ts +15 -3
- package/src/worker-reboot.ts +129 -0
- package/src/worker-records.ts +305 -0
- package/src/worker-seed.ts +143 -0
- package/src/worker-sizing.ts +76 -0
- package/src/cli/schedule-logs.ts +0 -36
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { FleetUsageError } from '../errors';
|
|
3
|
+
import { fleet } from '../fleet-config';
|
|
4
|
+
import { declaredFor, workerFeatures } from '../worker-features';
|
|
5
|
+
import { runCommand } from '../runner';
|
|
6
|
+
import type { Runner } from '../types';
|
|
7
|
+
import {
|
|
8
|
+
declaredDifferences,
|
|
9
|
+
diffManifests,
|
|
10
|
+
manifestCheck,
|
|
11
|
+
manifestDigest,
|
|
12
|
+
measureManifest,
|
|
13
|
+
ubuntuPolicy,
|
|
14
|
+
type WorkerManifest,
|
|
15
|
+
} from '../worker-manifest';
|
|
16
|
+
import type { CommandOutcome } from './contracts';
|
|
17
|
+
import { readRoster } from './roster';
|
|
18
|
+
|
|
19
|
+
export interface FleetManifestOptions {
|
|
20
|
+
id?: string;
|
|
21
|
+
/** A manifest from a fresh build of the same revision (fleet-manifest
|
|
22
|
+
* --json of that build) to compare the worker with.
|
|
23
|
+
*/
|
|
24
|
+
reference?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface FleetManifestServices {
|
|
28
|
+
run: Runner;
|
|
29
|
+
roster: string;
|
|
30
|
+
root?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const manifestServices = (roster: string): FleetManifestServices => ({
|
|
34
|
+
run: runCommand,
|
|
35
|
+
roster,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
async function reference(path: string): Promise<WorkerManifest> {
|
|
39
|
+
try {
|
|
40
|
+
const value = JSON.parse(await readFile(path, 'utf8')) as {
|
|
41
|
+
manifest?: WorkerManifest;
|
|
42
|
+
} & Partial<WorkerManifest>;
|
|
43
|
+
const manifest = value.manifest ?? (value as WorkerManifest);
|
|
44
|
+
if (manifest.version !== 1 || !manifest.packages) throw new Error();
|
|
45
|
+
return manifest;
|
|
46
|
+
} catch {
|
|
47
|
+
throw new FleetUsageError(
|
|
48
|
+
'--reference must name a manifest written by devfleet fleet-manifest --json.'
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Read-only: measures what an enrolled worker is made of, and the check
|
|
54
|
+
* worker:manifest against the declared pins and, with --reference, a fresh
|
|
55
|
+
* build of the same revision.
|
|
56
|
+
*/
|
|
57
|
+
export async function fleetManifest(
|
|
58
|
+
options: FleetManifestOptions,
|
|
59
|
+
services: FleetManifestServices
|
|
60
|
+
): Promise<CommandOutcome> {
|
|
61
|
+
const roster = await readRoster(services.roster);
|
|
62
|
+
const node = roster?.nodes.find((entry) => entry.id === options.id);
|
|
63
|
+
if (!node) throw new FleetUsageError('--id must name an enrolled worker.');
|
|
64
|
+
const fresh = options.reference
|
|
65
|
+
? await reference(options.reference)
|
|
66
|
+
: undefined;
|
|
67
|
+
// A worker is measured against what its own features install.
|
|
68
|
+
const policy = declaredFor(
|
|
69
|
+
await ubuntuPolicy(services.root),
|
|
70
|
+
workerFeatures(fleet, node.id)
|
|
71
|
+
);
|
|
72
|
+
const measured = await measureManifest(node, services.run, policy);
|
|
73
|
+
if ('check' in measured)
|
|
74
|
+
return {
|
|
75
|
+
exitCode: 1,
|
|
76
|
+
data: {
|
|
77
|
+
version: 1,
|
|
78
|
+
command: 'fleet-manifest',
|
|
79
|
+
ok: false,
|
|
80
|
+
node: node.id,
|
|
81
|
+
checks: [measured.check],
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
const { manifest, release } = measured;
|
|
85
|
+
const differences = [
|
|
86
|
+
...declaredDifferences(manifest, policy, release),
|
|
87
|
+
...(fresh ? diffManifests(fresh, manifest) : []),
|
|
88
|
+
];
|
|
89
|
+
const check = manifestCheck(differences);
|
|
90
|
+
const digest = manifestDigest(manifest);
|
|
91
|
+
return {
|
|
92
|
+
exitCode: check.status === 'fail' ? 1 : 0,
|
|
93
|
+
data: {
|
|
94
|
+
version: 1,
|
|
95
|
+
command: 'fleet-manifest',
|
|
96
|
+
ok: check.status !== 'fail',
|
|
97
|
+
node: node.id,
|
|
98
|
+
digest,
|
|
99
|
+
manifest,
|
|
100
|
+
differences,
|
|
101
|
+
checks: [check],
|
|
102
|
+
},
|
|
103
|
+
text: [
|
|
104
|
+
`${node.id}: ${Object.keys(manifest.packages).length} packages, ${Object.keys(manifest.tools).length} tools, digest ${digest}`,
|
|
105
|
+
`${check.status.toUpperCase()} ${check.id}: ${check.summary}`,
|
|
106
|
+
].join('\n'),
|
|
107
|
+
};
|
|
108
|
+
}
|