@kinotic-ai/system-api 5.0.0-beta.14 → 5.0.0-beta.16
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/index.cjs +4 -6
- package/dist/index.d.cts +28 -16
- package/dist/index.d.ts +28 -16
- package/dist/index.js +4 -6
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -99,9 +99,10 @@ class VmNode {
|
|
|
99
99
|
totalCpus = 0;
|
|
100
100
|
totalMemoryMb = 0;
|
|
101
101
|
totalDiskMb = 0;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
freeCpus = 0;
|
|
103
|
+
freeMemoryMb = 0;
|
|
104
|
+
freeDiskMb = 0;
|
|
105
|
+
reservations = [];
|
|
105
106
|
lastSeen = null;
|
|
106
107
|
workloadDataDir = null;
|
|
107
108
|
constructor(id, name, hostname) {
|
|
@@ -174,9 +175,6 @@ class WorkloadOrchestrationService {
|
|
|
174
175
|
deployWorkload(workload) {
|
|
175
176
|
return this.serviceProxy.invoke("deployWorkload", [workload]);
|
|
176
177
|
}
|
|
177
|
-
restartWorkload(workloadId) {
|
|
178
|
-
return this.serviceProxy.invoke("restartWorkload", [workloadId]);
|
|
179
|
-
}
|
|
180
178
|
stopWorkload(workloadId) {
|
|
181
179
|
return this.serviceProxy.invoke("stopWorkload", [workloadId]);
|
|
182
180
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -21,6 +21,21 @@ declare class VmNodeStatus {
|
|
|
21
21
|
*/
|
|
22
22
|
healthMessage: string | null;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The room one workload's run holds on a VmNode: the CPU, memory and disk its VM is sized for,
|
|
26
|
+
* from the moment it is placed until its run ends or it is destroyed. A workload holds at most
|
|
27
|
+
* one reservation per node, keyed by its id.
|
|
28
|
+
*/
|
|
29
|
+
interface WorkloadReservation {
|
|
30
|
+
/** The id of the workload holding the reservation. */
|
|
31
|
+
workloadId: string;
|
|
32
|
+
/** CPU the workload's VM is allotted, in cores; a fraction is a share of one core. */
|
|
33
|
+
cpus: number;
|
|
34
|
+
/** Memory the workload's VM is allotted, in megabytes. */
|
|
35
|
+
memoryMb: number;
|
|
36
|
+
/** Disk the workload's VM is allotted, in megabytes. */
|
|
37
|
+
diskMb: number;
|
|
38
|
+
}
|
|
24
39
|
declare enum VmProviderType {
|
|
25
40
|
BOXLITE = "BOXLITE",
|
|
26
41
|
CLOUD_HYPERVISOR = "CLOUD_HYPERVISOR"
|
|
@@ -64,18 +79,24 @@ declare class VmNode implements Identifiable<string> {
|
|
|
64
79
|
*/
|
|
65
80
|
totalDiskMb: number;
|
|
66
81
|
/**
|
|
67
|
-
*
|
|
68
|
-
* totalCpus -
|
|
82
|
+
* CPU not allocated to any workload, in cores. What is allocated is
|
|
83
|
+
* totalCpus - freeCpus, the sum of the reservations.
|
|
69
84
|
*/
|
|
70
|
-
|
|
85
|
+
freeCpus: number;
|
|
71
86
|
/**
|
|
72
87
|
* Memory not allocated to any workload, in megabytes.
|
|
73
88
|
*/
|
|
74
|
-
|
|
89
|
+
freeMemoryMb: number;
|
|
75
90
|
/**
|
|
76
91
|
* Disk space not allocated to any workload, in megabytes.
|
|
77
92
|
*/
|
|
78
|
-
|
|
93
|
+
freeDiskMb: number;
|
|
94
|
+
/**
|
|
95
|
+
* The room each workload running on this node holds, one entry per workload. The free*
|
|
96
|
+
* fields are the totals less what these hold, so a workload's room is reserved and released
|
|
97
|
+
* by its id and never counted twice.
|
|
98
|
+
*/
|
|
99
|
+
reservations: WorkloadReservation[];
|
|
79
100
|
/**
|
|
80
101
|
* The date and time the node was last seen/heartbeat.
|
|
81
102
|
*/
|
|
@@ -145,7 +166,7 @@ import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
|
|
|
145
166
|
interface IVmNodeService extends ICrudServiceProxy<VmNode> {
|
|
146
167
|
/**
|
|
147
168
|
* Finds a node with sufficient resources to host a workload with the given requirements.
|
|
148
|
-
* @param requiredCpus the
|
|
169
|
+
* @param requiredCpus the CPU required, in cores
|
|
149
170
|
* @param requiredMemoryMb the amount of memory required in megabytes
|
|
150
171
|
* @param requiredDiskMb the amount of disk space required in megabytes
|
|
151
172
|
* @return a Promise resolving to a suitable node, or null if none available
|
|
@@ -210,14 +231,6 @@ interface IWorkloadOrchestrationService {
|
|
|
210
231
|
*/
|
|
211
232
|
deployWorkload(workload: Workload2): Promise<Workload2>;
|
|
212
233
|
/**
|
|
213
|
-
* Restarts a stopped workload in place on the node it is deployed to. Fails unless the
|
|
214
|
-
* workload is stopped; a workload stopped with autoRemove true has no VM left to restart.
|
|
215
|
-
* Honors the workload's detached flag the same way as {@link deployWorkload}.
|
|
216
|
-
* @param workloadId the id of the workload to restart
|
|
217
|
-
* @return a Promise resolving to the restarted workload
|
|
218
|
-
*/
|
|
219
|
-
restartWorkload(workloadId: string): Promise<Workload2>;
|
|
220
|
-
/**
|
|
221
234
|
* Stops a running workload.
|
|
222
235
|
* @param workloadId the id of the workload to stop
|
|
223
236
|
* @return a Promise that resolves when the workload has been stopped
|
|
@@ -234,7 +247,6 @@ declare class WorkloadOrchestrationService implements IWorkloadOrchestrationServ
|
|
|
234
247
|
private readonly serviceProxy;
|
|
235
248
|
constructor(kinotic: IKinotic3);
|
|
236
249
|
deployWorkload(workload: Workload2): Promise<Workload2>;
|
|
237
|
-
restartWorkload(workloadId: string): Promise<Workload2>;
|
|
238
250
|
stopWorkload(workloadId: string): Promise<void>;
|
|
239
251
|
destroyWorkload(workloadId: string): Promise<void>;
|
|
240
252
|
}
|
|
@@ -496,4 +508,4 @@ declare class LogManager implements ILogManager {
|
|
|
496
508
|
declare module "@kinotic-ai/core" {
|
|
497
509
|
interface KinoticSingleton extends ISystemApiExtension {}
|
|
498
510
|
}
|
|
499
|
-
export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
|
|
511
|
+
export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadReservation, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,21 @@ declare class VmNodeStatus {
|
|
|
21
21
|
*/
|
|
22
22
|
healthMessage: string | null;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The room one workload's run holds on a VmNode: the CPU, memory and disk its VM is sized for,
|
|
26
|
+
* from the moment it is placed until its run ends or it is destroyed. A workload holds at most
|
|
27
|
+
* one reservation per node, keyed by its id.
|
|
28
|
+
*/
|
|
29
|
+
interface WorkloadReservation {
|
|
30
|
+
/** The id of the workload holding the reservation. */
|
|
31
|
+
workloadId: string;
|
|
32
|
+
/** CPU the workload's VM is allotted, in cores; a fraction is a share of one core. */
|
|
33
|
+
cpus: number;
|
|
34
|
+
/** Memory the workload's VM is allotted, in megabytes. */
|
|
35
|
+
memoryMb: number;
|
|
36
|
+
/** Disk the workload's VM is allotted, in megabytes. */
|
|
37
|
+
diskMb: number;
|
|
38
|
+
}
|
|
24
39
|
declare enum VmProviderType {
|
|
25
40
|
BOXLITE = "BOXLITE",
|
|
26
41
|
CLOUD_HYPERVISOR = "CLOUD_HYPERVISOR"
|
|
@@ -64,18 +79,24 @@ declare class VmNode implements Identifiable<string> {
|
|
|
64
79
|
*/
|
|
65
80
|
totalDiskMb: number;
|
|
66
81
|
/**
|
|
67
|
-
*
|
|
68
|
-
* totalCpus -
|
|
82
|
+
* CPU not allocated to any workload, in cores. What is allocated is
|
|
83
|
+
* totalCpus - freeCpus, the sum of the reservations.
|
|
69
84
|
*/
|
|
70
|
-
|
|
85
|
+
freeCpus: number;
|
|
71
86
|
/**
|
|
72
87
|
* Memory not allocated to any workload, in megabytes.
|
|
73
88
|
*/
|
|
74
|
-
|
|
89
|
+
freeMemoryMb: number;
|
|
75
90
|
/**
|
|
76
91
|
* Disk space not allocated to any workload, in megabytes.
|
|
77
92
|
*/
|
|
78
|
-
|
|
93
|
+
freeDiskMb: number;
|
|
94
|
+
/**
|
|
95
|
+
* The room each workload running on this node holds, one entry per workload. The free*
|
|
96
|
+
* fields are the totals less what these hold, so a workload's room is reserved and released
|
|
97
|
+
* by its id and never counted twice.
|
|
98
|
+
*/
|
|
99
|
+
reservations: WorkloadReservation[];
|
|
79
100
|
/**
|
|
80
101
|
* The date and time the node was last seen/heartbeat.
|
|
81
102
|
*/
|
|
@@ -145,7 +166,7 @@ import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
|
|
|
145
166
|
interface IVmNodeService extends ICrudServiceProxy<VmNode> {
|
|
146
167
|
/**
|
|
147
168
|
* Finds a node with sufficient resources to host a workload with the given requirements.
|
|
148
|
-
* @param requiredCpus the
|
|
169
|
+
* @param requiredCpus the CPU required, in cores
|
|
149
170
|
* @param requiredMemoryMb the amount of memory required in megabytes
|
|
150
171
|
* @param requiredDiskMb the amount of disk space required in megabytes
|
|
151
172
|
* @return a Promise resolving to a suitable node, or null if none available
|
|
@@ -210,14 +231,6 @@ interface IWorkloadOrchestrationService {
|
|
|
210
231
|
*/
|
|
211
232
|
deployWorkload(workload: Workload2): Promise<Workload2>;
|
|
212
233
|
/**
|
|
213
|
-
* Restarts a stopped workload in place on the node it is deployed to. Fails unless the
|
|
214
|
-
* workload is stopped; a workload stopped with autoRemove true has no VM left to restart.
|
|
215
|
-
* Honors the workload's detached flag the same way as {@link deployWorkload}.
|
|
216
|
-
* @param workloadId the id of the workload to restart
|
|
217
|
-
* @return a Promise resolving to the restarted workload
|
|
218
|
-
*/
|
|
219
|
-
restartWorkload(workloadId: string): Promise<Workload2>;
|
|
220
|
-
/**
|
|
221
234
|
* Stops a running workload.
|
|
222
235
|
* @param workloadId the id of the workload to stop
|
|
223
236
|
* @return a Promise that resolves when the workload has been stopped
|
|
@@ -234,7 +247,6 @@ declare class WorkloadOrchestrationService implements IWorkloadOrchestrationServ
|
|
|
234
247
|
private readonly serviceProxy;
|
|
235
248
|
constructor(kinotic: IKinotic3);
|
|
236
249
|
deployWorkload(workload: Workload2): Promise<Workload2>;
|
|
237
|
-
restartWorkload(workloadId: string): Promise<Workload2>;
|
|
238
250
|
stopWorkload(workloadId: string): Promise<void>;
|
|
239
251
|
destroyWorkload(workloadId: string): Promise<void>;
|
|
240
252
|
}
|
|
@@ -496,4 +508,4 @@ declare class LogManager implements ILogManager {
|
|
|
496
508
|
declare module "@kinotic-ai/core" {
|
|
497
509
|
interface KinoticSingleton extends ISystemApiExtension {}
|
|
498
510
|
}
|
|
499
|
-
export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
|
|
511
|
+
export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadReservation, WorkloadOrchestrationService, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
|
package/dist/index.js
CHANGED
|
@@ -33,9 +33,10 @@ class VmNode {
|
|
|
33
33
|
totalCpus = 0;
|
|
34
34
|
totalMemoryMb = 0;
|
|
35
35
|
totalDiskMb = 0;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
freeCpus = 0;
|
|
37
|
+
freeMemoryMb = 0;
|
|
38
|
+
freeDiskMb = 0;
|
|
39
|
+
reservations = [];
|
|
39
40
|
lastSeen = null;
|
|
40
41
|
workloadDataDir = null;
|
|
41
42
|
constructor(id, name, hostname) {
|
|
@@ -108,9 +109,6 @@ class WorkloadOrchestrationService {
|
|
|
108
109
|
deployWorkload(workload) {
|
|
109
110
|
return this.serviceProxy.invoke("deployWorkload", [workload]);
|
|
110
111
|
}
|
|
111
|
-
restartWorkload(workloadId) {
|
|
112
|
-
return this.serviceProxy.invoke("restartWorkload", [workloadId]);
|
|
113
|
-
}
|
|
114
112
|
stopWorkload(workloadId) {
|
|
115
113
|
return this.serviceProxy.invoke("stopWorkload", [workloadId]);
|
|
116
114
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/system-api",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Client API for the Kinotic platform's system plane: the workload and node orchestration services platform machines and operators use.",
|
|
6
6
|
"files": [
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@kinotic-ai/core": "^5.0.0-beta.13",
|
|
42
|
-
"@kinotic-ai/management-api": "^5.0.0-beta.
|
|
42
|
+
"@kinotic-ai/management-api": "^5.0.0-beta.34"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@kinotic-ai/core": "5.0.0-beta.13",
|
|
46
|
-
"@kinotic-ai/management-api": "5.0.0-beta.
|
|
46
|
+
"@kinotic-ai/management-api": "5.0.0-beta.34",
|
|
47
47
|
"@types/bun": "^1.3.9",
|
|
48
48
|
"typescript": "^5.9.3"
|
|
49
49
|
}
|