@kici-dev/orchestrator 0.13.0 → 0.14.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/dist/agent/dispatcher.d.ts +17 -0
- package/dist/cancel/peer-job-cancel.d.ts +12 -0
- package/dist/cli/api-client.d.ts +73 -0
- package/dist/cli/commands/cluster-settings.d.ts +31 -1
- package/dist/cli/commands/peer.d.ts +27 -1
- package/dist/cli/commands/scaler.d.ts +40 -4
- package/dist/cli.js +2210 -933
- package/dist/cluster/cluster-settings-reader.d.ts +8 -2
- package/dist/cluster/coordinator.d.ts +34 -8
- package/dist/cluster/peer-client.d.ts +37 -4
- package/dist/cluster/peer-forget.d.ts +138 -0
- package/dist/cluster/peer-handler.d.ts +18 -1
- package/dist/cluster/scaler-orphans-peer.d.ts +40 -0
- package/dist/cluster/settings-propagation.d.ts +85 -0
- package/dist/cluster/worker-cluster-settings.d.ts +29 -0
- package/dist/config.d.ts +9 -0
- package/dist/db/migrations/154_cluster_settings_firecracker_api_socket_wait.d.ts +4 -0
- package/dist/db/migrations/155_org_settings_reroute_spawn_retry.d.ts +17 -0
- package/dist/db/migrations/156_kici_events_match_outcome.d.ts +17 -0
- package/dist/db/types.d.ts +16 -0
- package/dist/events/event-router.d.ts +7 -1
- package/dist/events/event-store.d.ts +20 -3
- package/dist/events/types.d.ts +45 -0
- package/dist/helpers/windows-batch.d.ts +59 -0
- package/dist/index.js +60 -0
- package/dist/metrics/prometheus.d.ts +2 -0
- package/dist/orchestrator-core.d.ts +7 -0
- package/dist/registration/registration-store.d.ts +10 -0
- package/dist/routes/admin-cluster-settings.d.ts +13 -1
- package/dist/routes/admin-event-inspect.d.ts +36 -0
- package/dist/routes/admin-peer-forget.d.ts +43 -0
- package/dist/routes/admin-scaler-orphans.d.ts +64 -0
- package/dist/routes/admin.d.ts +23 -0
- package/dist/scaler/backend-factory.d.ts +6 -1
- package/dist/scaler/bare-metal-backend.d.ts +17 -15
- package/dist/scaler/bare-metal-launch.d.ts +90 -0
- package/dist/scaler/firecracker-backend.d.ts +181 -7
- package/dist/scaler/live-vms.d.ts +57 -0
- package/dist/scaler/manager.d.ts +112 -3
- package/dist/scaler/orphan-requests.d.ts +23 -0
- package/dist/scaler/overlay-template.d.ts +38 -0
- package/dist/scaler/scaler-state-store.d.ts +7 -0
- package/dist/scaler/spawn-errors.d.ts +17 -0
- package/dist/scaler/startup-orphan-sweep.d.ts +15 -0
- package/dist/scaler/types.d.ts +21 -2
- package/dist/scaler/vm-job-bindings.d.ts +17 -0
- package/dist/secrets/rbac.d.ts +7 -1
- package/dist/server.js +5498 -2193
- package/dist/standalone.js +10754 -7451
- package/dist/worker/in-memory-execution-tracker.d.ts +5 -0
- package/dist/worker/in-memory-job-queue.d.ts +21 -1
- package/dist/worker/queued-reroute-release.d.ts +39 -0
- package/dist/worker/reroute-spawn-control.d.ts +58 -0
- package/dist/worker/spawn-retry-budget.d.ts +87 -0
- package/dist/worker-core.d.ts +11 -2
- package/installer-image-digests.json +3 -3
- package/package.json +4 -4
- package/sbom.spdx.json +53 -53
|
@@ -270,6 +270,13 @@ export declare class ScalerStateStore {
|
|
|
270
270
|
* has an unknown owner and is deliberately not returned to anybody.
|
|
271
271
|
*/
|
|
272
272
|
listSpawningAgentsForOwner(instanceId: string): Promise<SpawningAgentSnapshot[]>;
|
|
273
|
+
/**
|
|
274
|
+
* Whether `instanceId` adopted an event provision whose spawn row is still
|
|
275
|
+
* live: one of the rows `listReapCandidates` returns that the reaper judges
|
|
276
|
+
* by its adopter's liveness rather than by its own deadline. `peer forget`
|
|
277
|
+
* reads it, so forgetting such an adopter never cuts the reaper's grace short.
|
|
278
|
+
*/
|
|
279
|
+
hasAdoptedProvisions(instanceId: string): Promise<boolean>;
|
|
273
280
|
/**
|
|
274
281
|
* Every event row that is either past its spawn deadline without ever being
|
|
275
282
|
* adopted, or adopted by some instance. The reaper decides which to tear down;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Errors a scaler backend's `spawn()` throws to tell the manager how to treat
|
|
3
|
+
* the failure.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A spawn the host refused outright. Retrying cannot succeed until an operator
|
|
7
|
+
* changes something — the binary path, the label set's env — so the manager
|
|
8
|
+
* defers the scaler instead of freeing the capacity for an immediate retry.
|
|
9
|
+
* The backend emits `scaler.failed` before it throws this.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DeterministicSpawnError extends Error {
|
|
12
|
+
constructor(message: string, options?: {
|
|
13
|
+
cause?: unknown;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export declare function isDeterministicSpawnError(err: unknown): err is DeterministicSpawnError;
|
|
17
|
+
//# sourceMappingURL=spawn-errors.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ScalerBackend } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Reap each container and Firecracker backend's orphans once, and start the
|
|
4
|
+
* Firecracker periodic sweep. A failure is logged and never stops startup.
|
|
5
|
+
*
|
|
6
|
+
* The periodic sweep is what reclaims a VM chroot, TAP or IP that a failed
|
|
7
|
+
* spawn could not remove (the jailer had already taken the chroot, or the
|
|
8
|
+
* removal raced the jailer). Startup-only cleanup leaves those to accumulate
|
|
9
|
+
* for as long as the process stays up.
|
|
10
|
+
*/
|
|
11
|
+
export declare function reapOrphansAtStartup(backends: ReadonlyArray<{
|
|
12
|
+
name: string;
|
|
13
|
+
backend: ScalerBackend;
|
|
14
|
+
}>): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=startup-orphan-sweep.d.ts.map
|
package/dist/scaler/types.d.ts
CHANGED
|
@@ -200,9 +200,12 @@ export interface ManagedAgent {
|
|
|
200
200
|
* Result of a scaling decision.
|
|
201
201
|
* Discriminated union on 'action' for exhaustive pattern matching.
|
|
202
202
|
*/
|
|
203
|
-
export type ScaleResult =
|
|
203
|
+
export type ScaleResult =
|
|
204
|
+
/** A spawn started; `agentId` is the scaler-managed id the new agent will register with. */
|
|
205
|
+
{
|
|
204
206
|
action: 'spawning';
|
|
205
207
|
backendType: string;
|
|
208
|
+
agentId: string;
|
|
206
209
|
} | {
|
|
207
210
|
action: 'at-capacity';
|
|
208
211
|
} | {
|
|
@@ -212,10 +215,15 @@ export type ScaleResult = {
|
|
|
212
215
|
action: 'failed';
|
|
213
216
|
error: string;
|
|
214
217
|
}
|
|
215
|
-
/**
|
|
218
|
+
/**
|
|
219
|
+
* Scale-up declined without attempting a spawn (e.g. coordinator draining).
|
|
220
|
+
* `retryAfterMs` is set when the scaler is deferring after failed launches:
|
|
221
|
+
* a request before then is declined the same way.
|
|
222
|
+
*/
|
|
216
223
|
| {
|
|
217
224
|
action: 'skipped';
|
|
218
225
|
reason: string;
|
|
226
|
+
retryAfterMs?: number;
|
|
219
227
|
};
|
|
220
228
|
/**
|
|
221
229
|
* What triggered a pending-scale re-drive (`Dispatcher.retryPendingScaleRequests`):
|
|
@@ -297,6 +305,9 @@ export interface ScalerBackend {
|
|
|
297
305
|
* the provisioned resource for operator inspection.
|
|
298
306
|
* @returns The managed agent tracking object
|
|
299
307
|
* @throws If the label set is not supported by this backend
|
|
308
|
+
* @throws DeterministicSpawnError, after emitting `scaler.failed`, when the
|
|
309
|
+
* host refused the launch itself. The manager defers the scaler instead of
|
|
310
|
+
* freeing the capacity for an immediate retry.
|
|
300
311
|
*/
|
|
301
312
|
spawn(labelSet: string[], agentId: string, orchestratorUrl: string, onEvent?: ScalerEventCallback, effectiveLimits?: EffectiveLimits, spawnContext?: SpawnContext,
|
|
302
313
|
/**
|
|
@@ -316,6 +327,14 @@ export interface ScalerBackend {
|
|
|
316
327
|
* teardown or a spawn timeout. Local backends accept and ignore it.
|
|
317
328
|
*/
|
|
318
329
|
destroy(managedId: string, context?: ScalerDestroyContext): Promise<void>;
|
|
330
|
+
/**
|
|
331
|
+
* Record that a managed agent's process registered with the orchestrator.
|
|
332
|
+
* Called by ScalerManager when a spawn it started registers locally.
|
|
333
|
+
* Optional: a backend implements it when it must tell a compute that stops
|
|
334
|
+
* before registering (a failed spawn it tears down itself) from one that
|
|
335
|
+
* stops after (an agent whose disconnect triggers `destroy`).
|
|
336
|
+
*/
|
|
337
|
+
markRegistered?(managedId: string): void;
|
|
319
338
|
/**
|
|
320
339
|
* Reclaim the HOST-LOCAL compute of a managed agent this backend no longer
|
|
321
340
|
* tracks in memory, from whatever durable host state survived the loss.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable job-to-agent bindings, read from the coordinator's dispatch queue.
|
|
3
|
+
*
|
|
4
|
+
* A worker has no database, so this is the coordinator's half of the
|
|
5
|
+
* live-VM tracking: a VM whose agent holds a non-terminal job is tracked, even
|
|
6
|
+
* when the node that runs the VM has lost every in-memory trace of it.
|
|
7
|
+
*/
|
|
8
|
+
import type { Kysely } from 'kysely';
|
|
9
|
+
import type { Database } from '../db/types.js';
|
|
10
|
+
/**
|
|
11
|
+
* The non-terminal job each of `agentIds` holds, keyed by agent id. An agent
|
|
12
|
+
* holds a job it was dispatched (`agent_id`) and a job waiting for it to
|
|
13
|
+
* reconnect (`recovery_agent_id`). The value is the job id the queue
|
|
14
|
+
* dispatches by, `dispatch_queue.id`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function findActiveJobBindings(db: Kysely<Database>, agentIds: readonly string[]): Promise<Map<string, string>>;
|
|
17
|
+
//# sourceMappingURL=vm-job-bindings.d.ts.map
|
package/dist/secrets/rbac.d.ts
CHANGED
|
@@ -17,7 +17,13 @@ export type Permission = 'context.create' | 'context.read' | 'context.update' |
|
|
|
17
17
|
/** Read the org-wide CI trust policy that gates fork / unknown / workflow-change PRs. */
|
|
18
18
|
| 'ci_trust.read'
|
|
19
19
|
/** Modify org-wide trust policies (independent mode only — Platform-attached PATCH refuses). */
|
|
20
|
-
| 'ci_trust.admin'
|
|
20
|
+
| 'ci_trust.admin'
|
|
21
|
+
/** List the live Firecracker VMs on a node and how each is tracked. */
|
|
22
|
+
| 'scaler.read'
|
|
23
|
+
/** Stop live Firecracker VMs the node's orchestrator does not track. */
|
|
24
|
+
| 'scaler.manage'
|
|
25
|
+
/** Drop a departed peer from the coordinators' live peer registries. */
|
|
26
|
+
| 'peer.manage';
|
|
21
27
|
/**
|
|
22
28
|
* Error thrown when a role lacks the required permission.
|
|
23
29
|
*/
|