@aerol-ai/aerolvm-sdk 0.1.3 → 0.1.4
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/MicroVM.js +1 -1
- package/dist/types.d.ts +37 -0
- package/package.json +1 -1
package/dist/MicroVM.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIClient } from "./internal/client.js";
|
|
2
2
|
import { Sandbox } from "./Sandbox.js";
|
|
3
|
-
const defaultAPIURL = "http://127.0.0.1:
|
|
3
|
+
const defaultAPIURL = "http://127.0.0.1:21212";
|
|
4
4
|
const authRequiredErrorMessage = "PAT token is required. Set patToken or SB_PAT_TOKEN.";
|
|
5
5
|
export class MicroVM {
|
|
6
6
|
apiUrl;
|
package/dist/types.d.ts
CHANGED
|
@@ -32,6 +32,34 @@ export interface Lifecycle {
|
|
|
32
32
|
destroyAtAge?: number;
|
|
33
33
|
}
|
|
34
34
|
export type UpdateLifecycleOptions = Lifecycle;
|
|
35
|
+
export type GPUVendor = "nvidia" | "amd" | "apple";
|
|
36
|
+
export interface GPUOptions {
|
|
37
|
+
/**
|
|
38
|
+
* GPU hardware vendor. Required when gpus is set.
|
|
39
|
+
* - "nvidia": NVIDIA GPUs via nvidia-container-runtime. Requires
|
|
40
|
+
* nvidia-container-toolkit on the host.
|
|
41
|
+
* - "amd": AMD GPUs via ROCm (/dev/kfd + /dev/dri). Requires ROCm
|
|
42
|
+
* drivers on the host.
|
|
43
|
+
* - "apple": Apple Silicon GPU via Docker Desktop's experimental Metal
|
|
44
|
+
* support. Only functional on macOS with Docker Desktop.
|
|
45
|
+
*
|
|
46
|
+
* GPU access is not supported with runtime="gvisor" — the API returns
|
|
47
|
+
* an error if both gpus and runtime="gvisor" are set.
|
|
48
|
+
*/
|
|
49
|
+
vendor: GPUVendor;
|
|
50
|
+
/**
|
|
51
|
+
* Number of GPUs to allocate. Use -1 to request all GPUs on the host.
|
|
52
|
+
* Defaults to 1 when omitted. Ignored for AMD (all AMD GPUs are exposed
|
|
53
|
+
* via /dev/kfd and /dev/dri).
|
|
54
|
+
*/
|
|
55
|
+
count?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Pin the sandbox to specific GPU device indices or UUIDs.
|
|
58
|
+
* For NVIDIA: indices ("0", "1") or UUIDs ("GPU-abc123...").
|
|
59
|
+
* For AMD and Apple: ignored.
|
|
60
|
+
*/
|
|
61
|
+
deviceIDs?: string[];
|
|
62
|
+
}
|
|
35
63
|
export interface CreateOptions {
|
|
36
64
|
image: string;
|
|
37
65
|
/** Number of CPU cores to allocate. Fractional values are supported (e.g. 0.5 = half a core). */
|
|
@@ -52,8 +80,15 @@ export interface CreateOptions {
|
|
|
52
80
|
* privileged containers and ignores per-sandbox disk quotas. `"kata"` is
|
|
53
81
|
* reserved for future Kata Containers support and is rejected by the API
|
|
54
82
|
* today.
|
|
83
|
+
*
|
|
84
|
+
* GPU access is not supported with `"gvisor"`.
|
|
55
85
|
*/
|
|
56
86
|
runtime?: "docker" | "gvisor" | "kata";
|
|
87
|
+
/**
|
|
88
|
+
* Attach GPU resources to the sandbox. Omit for CPU-only workloads.
|
|
89
|
+
* Not compatible with runtime="gvisor".
|
|
90
|
+
*/
|
|
91
|
+
gpus?: GPUOptions;
|
|
57
92
|
}
|
|
58
93
|
export interface ResizeOptions {
|
|
59
94
|
/** Number of CPU cores. Fractional values supported (e.g. 0.5). */
|
|
@@ -122,6 +157,8 @@ export interface Sandbox {
|
|
|
122
157
|
* a pre-migration row that resolves to the host default at start time.
|
|
123
158
|
*/
|
|
124
159
|
runtime: "" | "docker" | "gvisor" | "kata";
|
|
160
|
+
/** GPU configuration this sandbox was created with. Absent means no GPU. */
|
|
161
|
+
gpus?: GPUOptions;
|
|
125
162
|
}
|
|
126
163
|
export interface ExecRequest {
|
|
127
164
|
command: string;
|