rightsize 0.7.13 → 0.7.15
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 +3 -1
- package/dist/backend-msb/agent-relay.d.ts +47 -0
- package/dist/backend-msb/agent-relay.d.ts.map +1 -0
- package/dist/backend-msb/agent-relay.js +50 -0
- package/dist/backend-msb/agent-relay.js.map +1 -0
- package/dist/backend-msb/backend.d.ts +67 -24
- package/dist/backend-msb/backend.d.ts.map +1 -1
- package/dist/backend-msb/backend.js +144 -26
- package/dist/backend-msb/backend.js.map +1 -1
- package/dist/backend-msb/commands.d.ts +37 -20
- package/dist/backend-msb/commands.d.ts.map +1 -1
- package/dist/backend-msb/commands.js +72 -39
- package/dist/backend-msb/commands.js.map +1 -1
- package/dist/backend-msb/exec-tunnel.d.ts +8 -6
- package/dist/backend-msb/exec-tunnel.d.ts.map +1 -1
- package/dist/backend-msb/exec-tunnel.js +18 -11
- package/dist/backend-msb/exec-tunnel.js.map +1 -1
- package/dist/backend-msb/invoke.d.ts +7 -7
- package/dist/backend-msb/invoke.js +7 -7
- package/dist/backend-msb/provisioner.d.ts +1 -1
- package/dist/backend-msb/provisioner.js +1 -1
- package/dist/backend-msb/restore-missing-bindings.d.ts +38 -0
- package/dist/backend-msb/restore-missing-bindings.d.ts.map +1 -0
- package/dist/backend-msb/restore-missing-bindings.js +40 -0
- package/dist/backend-msb/restore-missing-bindings.js.map +1 -0
- package/dist/core/backend.d.ts +6 -0
- package/dist/core/backend.d.ts.map +1 -1
- package/dist/core/checkpoint/copied-files.d.ts +16 -0
- package/dist/core/checkpoint/copied-files.d.ts.map +1 -0
- package/dist/core/checkpoint/copied-files.js +29 -0
- package/dist/core/checkpoint/copied-files.js.map +1 -0
- package/dist/core/errors.d.ts +67 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +82 -2
- package/dist/core/errors.js.map +1 -1
- package/dist/core/generic-container.d.ts +28 -4
- package/dist/core/generic-container.d.ts.map +1 -1
- package/dist/core/generic-container.js +38 -4
- package/dist/core/generic-container.js.map +1 -1
- package/dist/core/model.d.ts +12 -3
- package/dist/core/model.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec-tunnel.js","sourceRoot":"","sources":["../../src/backend-msb/exec-tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,
|
|
1
|
+
{"version":3,"file":"exec-tunnel.js","sourceRoot":"","sources":["../../src/backend-msb/exec-tunnel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,sEAAsE;AACtE,+DAA+D;AAC/D,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,oEAAoE;AACpE,yEAAyE;AACzE,qBAAqB;AACrB,MAAM,sBAAsB,GAAG,MAAM,CAAC;AACtC,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE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,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;QACrB,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ExecResult } from "../core/model.js";
|
|
2
2
|
/**
|
|
3
|
-
* Every msb child this backend spawns
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* signals EOF immediately, which
|
|
9
|
-
* invocation here wants.
|
|
3
|
+
* Every msb child this backend spawns, other than the exec tunnel's, gets a
|
|
4
|
+
* closed/null stdin. `msb exec` forwards a non-terminal stdin to the guest
|
|
5
|
+
* command while it runs (before msb 0.7.5 it read host stdin to EOF before
|
|
6
|
+
* starting the command, so a held-open pipe hung the call). A Node `"pipe"`
|
|
7
|
+
* stdin option never closes on its own, so a guest command that reads stdin
|
|
8
|
+
* would wait on input nobody sends. `"ignore"` signals EOF immediately, which
|
|
9
|
+
* is exactly what every non-interactive invocation here wants.
|
|
10
10
|
*/
|
|
11
11
|
export declare const CLOSED_STDIN: "ignore";
|
|
12
12
|
/**
|
|
@@ -2,13 +2,13 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import * as readline from "node:readline";
|
|
3
3
|
import { BackendError } from "../core/errors.js";
|
|
4
4
|
/**
|
|
5
|
-
* Every msb child this backend spawns
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* signals EOF immediately, which
|
|
11
|
-
* invocation here wants.
|
|
5
|
+
* Every msb child this backend spawns, other than the exec tunnel's, gets a
|
|
6
|
+
* closed/null stdin. `msb exec` forwards a non-terminal stdin to the guest
|
|
7
|
+
* command while it runs (before msb 0.7.5 it read host stdin to EOF before
|
|
8
|
+
* starting the command, so a held-open pipe hung the call). A Node `"pipe"`
|
|
9
|
+
* stdin option never closes on its own, so a guest command that reads stdin
|
|
10
|
+
* would wait on input nobody sends. `"ignore"` signals EOF immediately, which
|
|
11
|
+
* is exactly what every non-interactive invocation here wants.
|
|
12
12
|
*/
|
|
13
13
|
export const CLOSED_STDIN = "ignore";
|
|
14
14
|
function drainLines(stream, onLine) {
|
|
@@ -4,7 +4,7 @@ import type { Platform } from "./platform.js";
|
|
|
4
4
|
* while msb 0.6.10-0.6.13 were broken on Windows (fixed upstream in 0.6.14).
|
|
5
5
|
* MSB_PATH users on Windows must avoid 0.6.10-0.6.13.
|
|
6
6
|
*/
|
|
7
|
-
export declare const MSB_VERSION = "0.7.
|
|
7
|
+
export declare const MSB_VERSION = "0.7.8";
|
|
8
8
|
/** Test seam: the full resolution logic parameterized over the release base URL, cache dir, and environment. */
|
|
9
9
|
export declare function ensureInstalledAt(baseUrl: string, cacheDir: string, env: Record<string, string | undefined>): Promise<string>;
|
|
10
10
|
/** Resolves (downloading and verifying if needed) a runnable `msb` binary path, using the real GitHub release base, `RIGHTSIZE_CACHE_DIR`, and `process.env`. */
|
|
@@ -12,7 +12,7 @@ import { PlatformInfo } from "./platform.js";
|
|
|
12
12
|
* while msb 0.6.10-0.6.13 were broken on Windows (fixed upstream in 0.6.14).
|
|
13
13
|
* MSB_PATH users on Windows must avoid 0.6.10-0.6.13.
|
|
14
14
|
*/
|
|
15
|
-
export const MSB_VERSION = "0.7.
|
|
15
|
+
export const MSB_VERSION = "0.7.8";
|
|
16
16
|
function releaseBaseUrl(version) {
|
|
17
17
|
return `https://github.com/superradcompany/microsandbox/releases/download/v${version}`;
|
|
18
18
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True if `output` (an `msb restore` invocation's combined stdout/stderr) is
|
|
3
|
+
* msb refusing to restore a snapshot whose source sandbox had files copied in
|
|
4
|
+
* at start (`withCopyFileToContainer`), because the restore did not supply a
|
|
5
|
+
* destination for each of them. A copied file is a start-time bind mount of a
|
|
6
|
+
* host file, so the snapshot holds no content for it; msb 0.7.8 records the
|
|
7
|
+
* mount in the snapshots it creates and refuses to restore without it.
|
|
8
|
+
* Captured from msb 0.7.8:
|
|
9
|
+
*
|
|
10
|
+
* ```text
|
|
11
|
+
* error: invalid config: restore requires destination bindings for: mount /etc/app/b.conf; provide a destination mount for each path or explicitly allow missing resources
|
|
12
|
+
* → map each path with -v SOURCE:GUEST or --mount-disk SOURCE:GUEST
|
|
13
|
+
* → or pass --allow-missing-resources to start without them
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The 0.7.6 binary carries the same sentence with `invalid config:` missing
|
|
17
|
+
* in front and a different tail (`; provide --volume mappings, select
|
|
18
|
+
* captured disks with --volume GUEST, or explicitly use
|
|
19
|
+
* --allow-missing-resources`), used for other restore shapes. A snapshot
|
|
20
|
+
* taken by 0.7.6 does not carry the mount record, so restoring it never
|
|
21
|
+
* produces this refusal: the file comes back empty.
|
|
22
|
+
*
|
|
23
|
+
* Matches only the stable sentence `restore requires destination bindings
|
|
24
|
+
* for`, with any run of whitespace (a wrapped line included) between the
|
|
25
|
+
* words. It does not depend on the `invalid config:` prefix, the version-
|
|
26
|
+
* specific tail, the hint lines, the arrows or the line structure, all of
|
|
27
|
+
* which change with the msb version and with how a Windows host captures the
|
|
28
|
+
* output (PowerShell decorates the first line with `msb.exe : ` and mangles
|
|
29
|
+
* the arrow). The entries after `for:` can be disk entries as well as `mount
|
|
30
|
+
* <path>`, so nothing here parses them.
|
|
31
|
+
*
|
|
32
|
+
* The caller must not retry on a match: the same restore is refused the same
|
|
33
|
+
* way every time. It must also never answer the refusal by passing
|
|
34
|
+
* `--allow-missing-resources`, which would start the sandbox with the copied
|
|
35
|
+
* files silently absent.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isRestoreMissingBindingsFailure(output: string): boolean;
|
|
38
|
+
//# sourceMappingURL=restore-missing-bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-missing-bindings.d.ts","sourceRoot":"","sources":["../../src/backend-msb/restore-missing-bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True if `output` (an `msb restore` invocation's combined stdout/stderr) is
|
|
3
|
+
* msb refusing to restore a snapshot whose source sandbox had files copied in
|
|
4
|
+
* at start (`withCopyFileToContainer`), because the restore did not supply a
|
|
5
|
+
* destination for each of them. A copied file is a start-time bind mount of a
|
|
6
|
+
* host file, so the snapshot holds no content for it; msb 0.7.8 records the
|
|
7
|
+
* mount in the snapshots it creates and refuses to restore without it.
|
|
8
|
+
* Captured from msb 0.7.8:
|
|
9
|
+
*
|
|
10
|
+
* ```text
|
|
11
|
+
* error: invalid config: restore requires destination bindings for: mount /etc/app/b.conf; provide a destination mount for each path or explicitly allow missing resources
|
|
12
|
+
* → map each path with -v SOURCE:GUEST or --mount-disk SOURCE:GUEST
|
|
13
|
+
* → or pass --allow-missing-resources to start without them
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The 0.7.6 binary carries the same sentence with `invalid config:` missing
|
|
17
|
+
* in front and a different tail (`; provide --volume mappings, select
|
|
18
|
+
* captured disks with --volume GUEST, or explicitly use
|
|
19
|
+
* --allow-missing-resources`), used for other restore shapes. A snapshot
|
|
20
|
+
* taken by 0.7.6 does not carry the mount record, so restoring it never
|
|
21
|
+
* produces this refusal: the file comes back empty.
|
|
22
|
+
*
|
|
23
|
+
* Matches only the stable sentence `restore requires destination bindings
|
|
24
|
+
* for`, with any run of whitespace (a wrapped line included) between the
|
|
25
|
+
* words. It does not depend on the `invalid config:` prefix, the version-
|
|
26
|
+
* specific tail, the hint lines, the arrows or the line structure, all of
|
|
27
|
+
* which change with the msb version and with how a Windows host captures the
|
|
28
|
+
* output (PowerShell decorates the first line with `msb.exe : ` and mangles
|
|
29
|
+
* the arrow). The entries after `for:` can be disk entries as well as `mount
|
|
30
|
+
* <path>`, so nothing here parses them.
|
|
31
|
+
*
|
|
32
|
+
* The caller must not retry on a match: the same restore is refused the same
|
|
33
|
+
* way every time. It must also never answer the refusal by passing
|
|
34
|
+
* `--allow-missing-resources`, which would start the sandbox with the copied
|
|
35
|
+
* files silently absent.
|
|
36
|
+
*/
|
|
37
|
+
export function isRestoreMissingBindingsFailure(output) {
|
|
38
|
+
return /restore\s+requires\s+destination\s+bindings\s+for/i.test(output);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=restore-missing-bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-missing-bindings.js","sourceRoot":"","sources":["../../src/backend-msb/restore-missing-bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,UAAU,+BAA+B,CAAC,MAAc;IAC5D,OAAO,oDAAoD,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3E,CAAC"}
|
package/dist/core/backend.d.ts
CHANGED
|
@@ -134,6 +134,12 @@ export interface SandboxBackend {
|
|
|
134
134
|
* the named-checkpoint registry and on the `Checkpoint` it hands back,
|
|
135
135
|
* never `ref` itself. Never called on a backend whose
|
|
136
136
|
* `capabilities.checkpoint` is `false`.
|
|
137
|
+
*
|
|
138
|
+
* Files copied in at start (`handle.spec.mounts`) are bind mounts of host
|
|
139
|
+
* files and are not part of what either backend captures. Docker leaves
|
|
140
|
+
* them as they are. Microsandbox boots the sandbox again from its snapshot,
|
|
141
|
+
* so it mounts each one again from its host file, and throws
|
|
142
|
+
* `CheckpointHostFileMissingError` before stopping anything if one is gone.
|
|
137
143
|
*/
|
|
138
144
|
createCheckpoint(handle: SandboxHandle, ref: string): Promise<string>;
|
|
139
145
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/core/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sEAAsE;IACtE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B;AAED,2FAA2F;AAC3F,MAAM,WAAW,YAAY;IAC3B,+HAA+H;IAC/H,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,0HAA0H;IAC1H,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC,kJAAkJ;IAClJ,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO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1,16 @@
|
|
|
1
|
+
import type { FileMount } from "../model.js";
|
|
2
|
+
/**
|
|
3
|
+
* Throws `CheckpointHostFileMissingError` for the first mount, in spec order,
|
|
4
|
+
* whose host file is gone. Used by the microsandbox checkpoint, which stops the
|
|
5
|
+
* container, snapshots it and boots it again with `msb restore --volume` for
|
|
6
|
+
* every copied file, so each host file has to exist before the first of those
|
|
7
|
+
* steps. A snapshot holds no content for a copied file, and a boot that finds
|
|
8
|
+
* the host file missing would come after the source sandbox is already gone.
|
|
9
|
+
*
|
|
10
|
+
* Only "no such file or directory" counts as missing. Any other `stat` failure
|
|
11
|
+
* (a permission error on a parent directory, say) is left for msb to report
|
|
12
|
+
* with its own message, so this never claims a file no longer exists when it
|
|
13
|
+
* might still.
|
|
14
|
+
*/
|
|
15
|
+
export declare function requireCopiedHostFilesExist(mounts: readonly FileMount[]): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=copied-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copied-files.d.ts","sourceRoot":"","sources":["../../../src/core/checkpoint/copied-files.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAsB,2BAA2B,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAW7F"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import { CheckpointHostFileMissingError } from "../errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* Throws `CheckpointHostFileMissingError` for the first mount, in spec order,
|
|
5
|
+
* whose host file is gone. Used by the microsandbox checkpoint, which stops the
|
|
6
|
+
* container, snapshots it and boots it again with `msb restore --volume` for
|
|
7
|
+
* every copied file, so each host file has to exist before the first of those
|
|
8
|
+
* steps. A snapshot holds no content for a copied file, and a boot that finds
|
|
9
|
+
* the host file missing would come after the source sandbox is already gone.
|
|
10
|
+
*
|
|
11
|
+
* Only "no such file or directory" counts as missing. Any other `stat` failure
|
|
12
|
+
* (a permission error on a parent directory, say) is left for msb to report
|
|
13
|
+
* with its own message, so this never claims a file no longer exists when it
|
|
14
|
+
* might still.
|
|
15
|
+
*/
|
|
16
|
+
export async function requireCopiedHostFilesExist(mounts) {
|
|
17
|
+
for (const mount of mounts) {
|
|
18
|
+
try {
|
|
19
|
+
await fs.stat(mount.hostPath);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
const code = err.code;
|
|
23
|
+
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
24
|
+
throw new CheckpointHostFileMissingError(mount.guestPath, mount.hostPath);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=copied-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copied-files.js","sourceRoot":"","sources":["../../../src/core/checkpoint/copied-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAG9D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,MAA4B;IAC5E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,GAAI,GAA6B,CAAC,IAAI,CAAC;YACjD,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC5C,MAAM,IAAI,8BAA8B,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -42,7 +42,11 @@ export declare class ContainerLaunchError extends Error {
|
|
|
42
42
|
}
|
|
43
43
|
/** Thrown on subprocess/daemon failures; message carries full stderr/body. */
|
|
44
44
|
export declare class BackendError extends Error {
|
|
45
|
-
|
|
45
|
+
/** The underlying error this one wraps, when there is one. */
|
|
46
|
+
readonly cause?: unknown | undefined;
|
|
47
|
+
constructor(message: string,
|
|
48
|
+
/** The underlying error this one wraps, when there is one. */
|
|
49
|
+
cause?: unknown | undefined);
|
|
46
50
|
}
|
|
47
51
|
/** Thrown when the msb toolchain provisioner can't get a runnable `msb` binary in place (download, checksum, or lock failure). */
|
|
48
52
|
export declare class ProvisionError extends Error {
|
|
@@ -300,4 +304,66 @@ export declare class CheckpointWorkloadCommandMissingError extends Error {
|
|
|
300
304
|
/** The checkpoint ref being restored. */
|
|
301
305
|
ref: string);
|
|
302
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Thrown by `checkpoint()` on microsandbox when a file added with
|
|
309
|
+
* `withCopyFileToContainer` has lost its host file. Copied files are not part
|
|
310
|
+
* of a checkpoint: they are start-time mounts of host files, so a snapshot
|
|
311
|
+
* holds no content for them. microsandbox's `checkpoint()` stops the
|
|
312
|
+
* container, snapshots it and boots it again, and that boot mounts each copied
|
|
313
|
+
* file again from its host file, so the host file has to still be there.
|
|
314
|
+
*
|
|
315
|
+
* Thrown from two places, both before any destructive step:
|
|
316
|
+
* `GenericContainer.checkpoint()` itself (ahead of the named-checkpoint replace
|
|
317
|
+
* semantics' removal of whatever currently sits under the same ref, so a
|
|
318
|
+
* refused re-checkpoint never replaces a prior checkpoint) and, redundantly,
|
|
319
|
+
* `MsbCliBackend.createCheckpoint` (ahead of stopping the sandbox) for any
|
|
320
|
+
* caller that reaches the backend directly. docker never throws it: its
|
|
321
|
+
* checkpoint is a commit of the running container and does not reboot it.
|
|
322
|
+
*/
|
|
323
|
+
export declare class CheckpointHostFileMissingError extends Error {
|
|
324
|
+
/** The guest path the copied file is mounted at. */
|
|
325
|
+
readonly guestPath: string;
|
|
326
|
+
/** The host file that was meant to back it and no longer exists. */
|
|
327
|
+
readonly hostPath: string;
|
|
328
|
+
constructor(
|
|
329
|
+
/** The guest path the copied file is mounted at. */
|
|
330
|
+
guestPath: string,
|
|
331
|
+
/** The host file that was meant to back it and no longer exists. */
|
|
332
|
+
hostPath: string);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Thrown when microsandbox refuses to restore a checkpoint because the
|
|
336
|
+
* container it was taken from had files copied in with
|
|
337
|
+
* `withCopyFileToContainer`. Those files are mounts of host files, not part of
|
|
338
|
+
* the checkpoint. msb 0.7.8 records them in the snapshots it creates and
|
|
339
|
+
* refuses a restore that does not supply each one again; a snapshot made by an
|
|
340
|
+
* older msb restores with the file empty instead. msb's own output lists the
|
|
341
|
+
* missing guest paths and is carried in `output` and in the message.
|
|
342
|
+
*
|
|
343
|
+
* The remedy is to add the same files again, at the same guest paths, on the
|
|
344
|
+
* container started from the checkpoint:
|
|
345
|
+
* `GenericContainer.fromCheckpoint(cp).withCopyFileToContainer(...)`. Never
|
|
346
|
+
* retried: another attempt would be refused the same way.
|
|
347
|
+
*
|
|
348
|
+
* Thrown by `start()` on a container built with `fromCheckpoint()`. It could
|
|
349
|
+
* also come from `checkpoint()`'s own reboot, which supplies the container's
|
|
350
|
+
* copied files itself, so only a container whose mounts the library could not
|
|
351
|
+
* see would reach that. docker never throws it: it cannot tell, and starts the
|
|
352
|
+
* container with the path left empty.
|
|
353
|
+
*/
|
|
354
|
+
export declare class CheckpointMissingCopiedFilesError extends Error {
|
|
355
|
+
/** The sandbox the restore was meant to create. */
|
|
356
|
+
readonly sandbox: string;
|
|
357
|
+
/** The checkpoint ref being restored. */
|
|
358
|
+
readonly ref: string;
|
|
359
|
+
/** msb's own output for the refused restore; it names the missing guest paths. */
|
|
360
|
+
readonly output: string;
|
|
361
|
+
constructor(
|
|
362
|
+
/** The sandbox the restore was meant to create. */
|
|
363
|
+
sandbox: string,
|
|
364
|
+
/** The checkpoint ref being restored. */
|
|
365
|
+
ref: string,
|
|
366
|
+
/** msb's own output for the refused restore; it names the missing guest paths. */
|
|
367
|
+
output: string);
|
|
368
|
+
}
|
|
303
369
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAEhD,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;;IALxB,uDAAuD;IAC9C,OAAO,EAAE,MAAM;IACxB,yDAAyD;IAChD,OAAO,EAAE,MAAM;IACxB,qFAAqF;IAC5E,MAAM,CAAC,EAAE,MAAM,YAAA;CAK3B;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAG5C,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;gBAFxB,OAAO,EAAE,MAAM;IACf,4FAA4F;IACnF,KAAK,CAAC,EAAE,OAAO,YAAA;CAK3B;AAED,gFAAgF;AAChF,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,8EAA8E;AAC9E,qBAAa,YAAa,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAEhD,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM;IAC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,mDAAmD;IAC1C,OAAO,EAAE,MAAM;IACxB,yCAAyC;IAChC,GAAG,EAAE,MAAM;IACpB,kFAAkF;IACzE,MAAM,EAAE,MAAM;CAa1B"}
|
package/dist/core/errors.js
CHANGED
|
@@ -51,8 +51,12 @@ export class ContainerLaunchError extends Error {
|
|
|
51
51
|
}
|
|
52
52
|
/** Thrown on subprocess/daemon failures; message carries full stderr/body. */
|
|
53
53
|
export class BackendError extends Error {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
cause;
|
|
55
|
+
constructor(message,
|
|
56
|
+
/** The underlying error this one wraps, when there is one. */
|
|
57
|
+
cause) {
|
|
58
|
+
super(message, cause !== undefined ? { cause } : undefined);
|
|
59
|
+
this.cause = cause;
|
|
56
60
|
this.name = "BackendError";
|
|
57
61
|
}
|
|
58
62
|
}
|
|
@@ -387,4 +391,80 @@ export class CheckpointWorkloadCommandMissingError extends Error {
|
|
|
387
391
|
this.name = "CheckpointWorkloadCommandMissingError";
|
|
388
392
|
}
|
|
389
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* Thrown by `checkpoint()` on microsandbox when a file added with
|
|
396
|
+
* `withCopyFileToContainer` has lost its host file. Copied files are not part
|
|
397
|
+
* of a checkpoint: they are start-time mounts of host files, so a snapshot
|
|
398
|
+
* holds no content for them. microsandbox's `checkpoint()` stops the
|
|
399
|
+
* container, snapshots it and boots it again, and that boot mounts each copied
|
|
400
|
+
* file again from its host file, so the host file has to still be there.
|
|
401
|
+
*
|
|
402
|
+
* Thrown from two places, both before any destructive step:
|
|
403
|
+
* `GenericContainer.checkpoint()` itself (ahead of the named-checkpoint replace
|
|
404
|
+
* semantics' removal of whatever currently sits under the same ref, so a
|
|
405
|
+
* refused re-checkpoint never replaces a prior checkpoint) and, redundantly,
|
|
406
|
+
* `MsbCliBackend.createCheckpoint` (ahead of stopping the sandbox) for any
|
|
407
|
+
* caller that reaches the backend directly. docker never throws it: its
|
|
408
|
+
* checkpoint is a commit of the running container and does not reboot it.
|
|
409
|
+
*/
|
|
410
|
+
export class CheckpointHostFileMissingError extends Error {
|
|
411
|
+
guestPath;
|
|
412
|
+
hostPath;
|
|
413
|
+
constructor(
|
|
414
|
+
/** The guest path the copied file is mounted at. */
|
|
415
|
+
guestPath,
|
|
416
|
+
/** The host file that was meant to back it and no longer exists. */
|
|
417
|
+
hostPath) {
|
|
418
|
+
super(`checkpoint() can't keep the copied file at ${guestPath}: its host file ${hostPath} no longer exists. ` +
|
|
419
|
+
"Copied files are not part of a checkpoint; on microsandbox, checkpoint() mounts them again from their " +
|
|
420
|
+
"host files when it reboots the container.");
|
|
421
|
+
this.guestPath = guestPath;
|
|
422
|
+
this.hostPath = hostPath;
|
|
423
|
+
this.name = "CheckpointHostFileMissingError";
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Thrown when microsandbox refuses to restore a checkpoint because the
|
|
428
|
+
* container it was taken from had files copied in with
|
|
429
|
+
* `withCopyFileToContainer`. Those files are mounts of host files, not part of
|
|
430
|
+
* the checkpoint. msb 0.7.8 records them in the snapshots it creates and
|
|
431
|
+
* refuses a restore that does not supply each one again; a snapshot made by an
|
|
432
|
+
* older msb restores with the file empty instead. msb's own output lists the
|
|
433
|
+
* missing guest paths and is carried in `output` and in the message.
|
|
434
|
+
*
|
|
435
|
+
* The remedy is to add the same files again, at the same guest paths, on the
|
|
436
|
+
* container started from the checkpoint:
|
|
437
|
+
* `GenericContainer.fromCheckpoint(cp).withCopyFileToContainer(...)`. Never
|
|
438
|
+
* retried: another attempt would be refused the same way.
|
|
439
|
+
*
|
|
440
|
+
* Thrown by `start()` on a container built with `fromCheckpoint()`. It could
|
|
441
|
+
* also come from `checkpoint()`'s own reboot, which supplies the container's
|
|
442
|
+
* copied files itself, so only a container whose mounts the library could not
|
|
443
|
+
* see would reach that. docker never throws it: it cannot tell, and starts the
|
|
444
|
+
* container with the path left empty.
|
|
445
|
+
*/
|
|
446
|
+
export class CheckpointMissingCopiedFilesError extends Error {
|
|
447
|
+
sandbox;
|
|
448
|
+
ref;
|
|
449
|
+
output;
|
|
450
|
+
constructor(
|
|
451
|
+
/** The sandbox the restore was meant to create. */
|
|
452
|
+
sandbox,
|
|
453
|
+
/** The checkpoint ref being restored. */
|
|
454
|
+
ref,
|
|
455
|
+
/** msb's own output for the refused restore; it names the missing guest paths. */
|
|
456
|
+
output) {
|
|
457
|
+
super(`msb refused to restore sandbox '${sandbox}' from checkpoint '${ref}': the container it was taken from ` +
|
|
458
|
+
"had files copied in with withCopyFileToContainer, and copied files are not part of a checkpoint (they " +
|
|
459
|
+
"are mounts of host files, so the checkpoint holds no content for them). Add the same files again, at " +
|
|
460
|
+
"the same guest paths, on the container you start from the checkpoint: " +
|
|
461
|
+
'GenericContainer.fromCheckpoint(cp).withCopyFileToContainer(MountableFile.forHostPath("<host file>"), ' +
|
|
462
|
+
'"<guest path>"). msb\'s output names the missing guest paths:\n' +
|
|
463
|
+
output);
|
|
464
|
+
this.sandbox = sandbox;
|
|
465
|
+
this.ref = ref;
|
|
466
|
+
this.output = output;
|
|
467
|
+
this.name = "CheckpointMissingCopiedFilesError";
|
|
468
|
+
}
|
|
469
|
+
}
|
|
390
470
|
//# sourceMappingURL=errors.js.map
|
package/dist/core/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAGvC;IAEA;IAEA;IANX;IACE,uDAAuD;IAC9C,OAAe;IACxB,yDAAyD;IAChD,OAAe;IACxB,qFAAqF;IAC5E,MAAe;QAExB,KAAK,CAAC,YAAY,OAAO,8BAA8B,OAAO,YAAY,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QANjG,YAAO,GAAP,OAAO,CAAQ;QAEf,YAAO,GAA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
68
68
|
* env/command/exposed ports/memory limit default to `cp.spec` — chain
|
|
69
69
|
* further builder calls (a different `waitingFor`, `withBackend`, …)
|
|
70
70
|
* before `start()`, the same as any other container. Never carries over
|
|
71
|
-
* `cp.spec`'s network/aliases
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
71
|
+
* `cp.spec`'s network/aliases (as with `withReuse()`'s own network
|
|
72
|
+
* restriction, network topology is never part of what a checkpoint
|
|
73
|
+
* captures) or mounts. Files added with `withCopyFileToContainer` are
|
|
74
|
+
* mounts of host files, not part of a checkpoint on either backend, so
|
|
75
|
+
* add them again on the returned container, at the same guest paths:
|
|
76
|
+
* `GenericContainer.fromCheckpoint(cp).withCopyFileToContainer(file,
|
|
77
|
+
* guestPath)`. On microsandbox a checkpoint taken by msb 0.7.8 refuses to
|
|
78
|
+
* restore without them, and `start()` throws
|
|
79
|
+
* `CheckpointMissingCopiedFilesError` (a checkpoint taken by an older msb
|
|
80
|
+
* restores with the file empty); on docker the path is left empty.
|
|
81
|
+
* `start()` throws `CheckpointBackendMismatchError` before any
|
|
75
82
|
* backend call if the active backend isn't the one that created `cp`, and
|
|
76
83
|
* `ReuseFromCheckpointError` if this container is also marked
|
|
77
84
|
* `withReuse()` — reuse's identity hash never covers a checkpoint ref. On
|
|
@@ -122,6 +129,13 @@ export declare class GenericContainer implements AsyncDisposable, NetworkMember
|
|
|
122
129
|
* The mount is read-write, and it is a view of the host file rather than a copy of it —
|
|
123
130
|
* docker binds the host path directly, microsandbox hard-links it into its staging
|
|
124
131
|
* directory — so a guest write reaches the host file itself.
|
|
132
|
+
*
|
|
133
|
+
* A copied file is not part of a checkpoint, on either backend: the snapshot holds no
|
|
134
|
+
* content for it. `checkpoint()` on microsandbox keeps it by mounting it again from its
|
|
135
|
+
* host file when it reboots the container (the host file must still exist); a container
|
|
136
|
+
* started from a checkpoint has to add it again with this method. See
|
|
137
|
+
* `GenericContainer.fromCheckpoint`. Files put into a running container with
|
|
138
|
+
* `copyFileToContainer` / `copyContentToContainer` are ordinary guest files, unlike this.
|
|
125
139
|
*/
|
|
126
140
|
withCopyFileToContainer(file: MountableFile, guestPath: string): this;
|
|
127
141
|
/** Sets the readiness check `start()` waits on before returning. Defaults to `Wait.forListeningPort()`. */
|
|
@@ -412,6 +426,16 @@ export declare class GenericContainer implements AsyncDisposable, NetworkMember
|
|
|
412
426
|
* before the rejection propagates, so a revived-but-never-ready workload
|
|
413
427
|
* never sits around as an orphan.
|
|
414
428
|
*
|
|
429
|
+
* Files added with `withCopyFileToContainer` are mounts of host files, not
|
|
430
|
+
* part of a checkpoint on either backend. On microsandbox this container
|
|
431
|
+
* keeps them: the reboot above mounts each one again from its host file, so
|
|
432
|
+
* the host file has to still exist, and a missing one throws
|
|
433
|
+
* `CheckpointHostFileMissingError` before the container is stopped or any
|
|
434
|
+
* prior checkpoint under `name` is replaced. docker's commit leaves the
|
|
435
|
+
* running container alone, so there is nothing to keep and nothing to check.
|
|
436
|
+
* A container started from the checkpoint has to add the files again; see
|
|
437
|
+
* `GenericContainer.fromCheckpoint`.
|
|
438
|
+
*
|
|
415
439
|
* Checkpoints are never auto-reaped (a committed image or a disk snapshot
|
|
416
440
|
* is not a container) — see the checkpoints guide for the manual cleanup
|
|
417
441
|
* one-liners and the `Checkpoints.remove` cleanup affordance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-container.d.ts","sourceRoot":"","sources":["../../src/core/generic-container.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"generic-container.d.ts","sourceRoot":"","sources":["../../src/core/generic-container.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAqBlD,OAAO,KAAK,E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