Automatically place servers using learned resource capacity

This commit is contained in:
2026-10-04 21:04:09 -04:00
parent a1b957392f
commit e6cdf9eb7f
25 changed files with 927 additions and 85 deletions
+18 -1
View File
@@ -68,7 +68,16 @@ export interface HostInventory {
currentOperation?: string | null; [key: string]: unknown;
capabilities?: string[];
agentUpdate?: HostAgentUpdate;
instanceResources?: InstanceResources[];
}
export interface InstanceResources {
instanceId: string; generation: number; uptimeSeconds: number; cpuCores: number; memoryBytes: number;
}
export interface ResourceAllowance {
cpuCores: number; memoryBytes: number; source: 'host' | 'fleet' | 'bootstrap';
samples: number; observedAt: string | null;
}
export interface CapacityCalibration { running: ResourceAllowance; startup: ResourceAllowance }
export interface Host {
id: string; name: string; hostname: string; mode: HostMode; portMin: number; portMax: number;
bindAddress: string; publicAddress: string; minimumFreeBytes: number; createdAt: string;
@@ -95,6 +104,14 @@ export interface HostPreparation {
}
export interface NativeDeploymentSelection {
hostId: string; libraryIds: Partial<Record<'t5' | 't6', string>>; image: string;
libraryIds: Partial<Record<'t5' | 't6', string>>; image: string;
bindAddress?: string; publicAddress?: string; publicPort?: number;
}
/** The host/port are provisional until the creation command is submitted. */
export interface NativePlacement {
hostId: string; libraryId: string; image?: string;
bindAddress?: string; publicAddress?: string; publicPort?: number;
automatic?: boolean;
network?: { bindAddress?: string; publicAddress?: string; publicPort?: number };
}