bitfab 0.63.3 → 0.64.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/cloudReplay.py +664 -777
- package/dist/{chunk-2SHMY7VT.js → chunk-2Y4FK7ND.js} +2 -2
- package/dist/{chunk-2SHMY7VT.js.map → chunk-2Y4FK7ND.js.map} +1 -1
- package/dist/{chunk-DISN55EE.js → chunk-BBBAQPIW.js} +6 -6
- package/dist/{chunk-2UXFKQAO.js → chunk-EQBRW3MC.js} +3 -3
- package/dist/{chunk-7J4PWCMT.js → chunk-RQ7HWX2T.js} +2 -2
- package/dist/{chunk-7J4PWCMT.js.map → chunk-RQ7HWX2T.js.map} +1 -1
- package/dist/{chunk-ZVBOAKPF.js → chunk-WX5DWEZM.js} +2 -2
- package/dist/{http-T57OQRSM.js → http-5F6I4E2K.js} +2 -2
- package/dist/{http-TNAMJGTM.js → http-QJV2QWDF.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/node.cjs +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +3 -3
- package/dist/{replay-GMHI5FIV.js → replay-DA2IX4KM.js} +3 -3
- package/dist/replayCli.js +29 -83
- package/dist/replayCli.js.map +1 -1
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-DISN55EE.js.map → chunk-BBBAQPIW.js.map} +0 -0
- /package/dist/{chunk-2UXFKQAO.js.map → chunk-EQBRW3MC.js.map} +0 -0
- /package/dist/{chunk-ZVBOAKPF.js.map → chunk-WX5DWEZM.js.map} +0 -0
- /package/dist/{http-T57OQRSM.js.map → http-5F6I4E2K.js.map} +0 -0
- /package/dist/{http-TNAMJGTM.js.map → http-QJV2QWDF.js.map} +0 -0
- /package/dist/{replay-GMHI5FIV.js.map → replay-DA2IX4KM.js.map} +0 -0
package/dist/node.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
getCurrentTrace,
|
|
37
37
|
reseedFromRegistry,
|
|
38
38
|
seedFromRegistry
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-BBBAQPIW.js";
|
|
40
40
|
import "./chunk-YWXQM6J3.js";
|
|
41
41
|
import {
|
|
42
42
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
ReplayError,
|
|
46
46
|
reportReplayProgress,
|
|
47
47
|
serializeReplayResult
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-WX5DWEZM.js";
|
|
49
49
|
import {
|
|
50
50
|
BitfabError,
|
|
51
51
|
DEFAULT_SERVICE_URL,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
MixedTracingError,
|
|
54
54
|
__version__,
|
|
55
55
|
flushTraces
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-2Y4FK7ND.js";
|
|
57
57
|
import {
|
|
58
58
|
assertAsyncStorageRegistered,
|
|
59
59
|
registerAsyncLocalStorageClass
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
sleepForReplayPersistence,
|
|
11
11
|
waitForReplayPersistence,
|
|
12
12
|
warnJudgeAssertionsDeprecated
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-WX5DWEZM.js";
|
|
14
|
+
import "./chunk-2Y4FK7ND.js";
|
|
15
15
|
import "./chunk-MT36GJMW.js";
|
|
16
16
|
export {
|
|
17
17
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
waitForReplayPersistence,
|
|
27
27
|
warnJudgeAssertionsDeprecated
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=replay-
|
|
29
|
+
//# sourceMappingURL=replay-DA2IX4KM.js.map
|
package/dist/replayCli.js
CHANGED
|
@@ -7,17 +7,15 @@ import {
|
|
|
7
7
|
runRegistryMain,
|
|
8
8
|
runReplayCli,
|
|
9
9
|
runSeedCli
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import
|
|
12
|
-
BitfabError
|
|
13
|
-
} from "./chunk-7J4PWCMT.js";
|
|
10
|
+
} from "./chunk-EQBRW3MC.js";
|
|
11
|
+
import "./chunk-RQ7HWX2T.js";
|
|
14
12
|
|
|
15
13
|
// src/cloudReplayCli.ts
|
|
16
14
|
var CLOUD_REPLAY_HINT = "Add --cloud to run the same replay on GitHub Actions; bitfab-replay --cloud --help explains it.";
|
|
17
15
|
function isCloudReplayCommand(argv) {
|
|
18
16
|
return argv.some((arg) => arg === "--cloud" || arg.startsWith("--cloud-"));
|
|
19
17
|
}
|
|
20
|
-
async function runCloudReplayCommand(argv,
|
|
18
|
+
async function runCloudReplayCommand(argv, helper) {
|
|
21
19
|
const [{ spawn }, { fileURLToPath }] = await Promise.all([
|
|
22
20
|
import("child_process"),
|
|
23
21
|
import("url")
|
|
@@ -28,85 +26,33 @@ async function runCloudReplayCommand(argv, io = {}, helper) {
|
|
|
28
26
|
...process.execArgv.filter((flag) => !/^--(inspect|debug)/.test(flag)),
|
|
29
27
|
fileURLToPath(new URL("./replayCli.js", import.meta.url))
|
|
30
28
|
];
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
child.stdout.setEncoding("utf8");
|
|
43
|
-
child.stderr.setEncoding("utf8");
|
|
44
|
-
child.stdout.on("data", (chunk) => {
|
|
45
|
-
stdout += chunk;
|
|
46
|
-
});
|
|
47
|
-
child.stderr.on("data", (chunk) => {
|
|
48
|
-
;
|
|
49
|
-
(io.stderr ?? ((text) => process.stderr.write(text)))(chunk);
|
|
50
|
-
});
|
|
51
|
-
child.on(
|
|
52
|
-
"error",
|
|
53
|
-
() => reject(new BitfabError("Cloud replay requires Python 3.10+ on PATH"))
|
|
54
|
-
);
|
|
55
|
-
child.on("close", (code) => {
|
|
56
|
-
if (code !== 0) {
|
|
57
|
-
if (stdout.trim() !== "") {
|
|
58
|
-
;
|
|
59
|
-
(io.stdout ?? console.log)(stdout.trim());
|
|
29
|
+
const keepWaiting = () => {
|
|
30
|
+
};
|
|
31
|
+
process.on("SIGINT", keepWaiting);
|
|
32
|
+
try {
|
|
33
|
+
return await new Promise((resolve) => {
|
|
34
|
+
const child = spawn("python3", [script, ...argv], {
|
|
35
|
+
stdio: "inherit",
|
|
36
|
+
env: {
|
|
37
|
+
...process.env,
|
|
38
|
+
BITFAB_REPLAY_COMMAND: JSON.stringify(replayCommand),
|
|
39
|
+
BITFAB_SDK_LANGUAGE: "typescript"
|
|
60
40
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
41
|
+
});
|
|
42
|
+
child.on("error", () => {
|
|
43
|
+
process.stderr.write(
|
|
44
|
+
"Cloud replay needs Python 3.10+ on PATH as python3\n"
|
|
65
45
|
);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
resolve(1);
|
|
47
|
+
});
|
|
48
|
+
child.on(
|
|
49
|
+
"close",
|
|
50
|
+
(code, signal) => resolve(code ?? (signal === "SIGINT" ? 130 : 1))
|
|
51
|
+
);
|
|
69
52
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
;
|
|
73
|
-
(io.stdout ?? console.log)(output.trimEnd());
|
|
74
|
-
return {};
|
|
53
|
+
} finally {
|
|
54
|
+
process.off("SIGINT", keepWaiting);
|
|
75
55
|
}
|
|
76
|
-
const result = parseCloudReplayResult(output, io);
|
|
77
|
-
(io.stdout ?? console.log)(JSON.stringify(result, null, 2));
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
function parseCloudReplayResult(output, io) {
|
|
81
|
-
const rest = [];
|
|
82
|
-
for (const line of output.split("\n")) {
|
|
83
|
-
if (line.startsWith("::")) {
|
|
84
|
-
;
|
|
85
|
-
(io.stdout ?? console.log)(line);
|
|
86
|
-
} else {
|
|
87
|
-
rest.push(line);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
for (let start = rest.length - 1; start >= 0; start -= 1) {
|
|
91
|
-
if (!rest[start].startsWith("{")) {
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
const value = JSON.parse(rest.slice(start).join("\n"));
|
|
96
|
-
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
97
|
-
return value;
|
|
98
|
-
}
|
|
99
|
-
} catch {
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const text = rest.join("\n").trim();
|
|
103
|
-
if (text !== "") {
|
|
104
|
-
;
|
|
105
|
-
(io.stdout ?? console.log)(text);
|
|
106
|
-
}
|
|
107
|
-
throw new BitfabError(
|
|
108
|
-
"Cloud replay did not print a JSON result; its output is above"
|
|
109
|
-
);
|
|
110
56
|
}
|
|
111
57
|
|
|
112
58
|
// src/replayCli.ts
|
|
@@ -116,9 +62,6 @@ var USAGE = `Usage: bitfab-replay --registry <path> <pipeline> [options]
|
|
|
116
62
|
Run bitfab-replay --registry <path> --help to list replay options.
|
|
117
63
|
${CLOUD_REPLAY_HINT}`;
|
|
118
64
|
async function runReplayCommand(argv, io = {}, importer = importRegistry) {
|
|
119
|
-
if (isCloudReplayCommand(argv)) {
|
|
120
|
-
return runCloudReplayCommand(argv, io);
|
|
121
|
-
}
|
|
122
65
|
const { registryPath, commandArgs } = await parseRegistryCommandArgs(
|
|
123
66
|
argv,
|
|
124
67
|
USAGE
|
|
@@ -130,6 +73,9 @@ async function runReplayCommand(argv, io = {}, importer = importRegistry) {
|
|
|
130
73
|
return runReplayCli(registry, commandArgs, io, registryPath);
|
|
131
74
|
}
|
|
132
75
|
async function runReplayMain(argv, io = {}) {
|
|
76
|
+
if (isCloudReplayCommand(argv)) {
|
|
77
|
+
return runCloudReplayCommand(argv);
|
|
78
|
+
}
|
|
133
79
|
return runRegistryMain(() => runReplayCommand(argv, io), io);
|
|
134
80
|
}
|
|
135
81
|
runIfEntrypoint(import.meta.url, () => runReplayMain(process.argv.slice(2)));
|
package/dist/replayCli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cloudReplayCli.ts","../src/replayCli.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/cloudReplayCli.ts","../src/replayCli.ts"],"sourcesContent":["export const CLOUD_REPLAY_HINT =\n \"Add --cloud to run the same replay on GitHub Actions; bitfab-replay --cloud --help explains it.\"\n\nexport function isCloudReplayCommand(argv: readonly string[]): boolean {\n return argv.some((arg) => arg === \"--cloud\" || arg.startsWith(\"--cloud-\"))\n}\n\nexport async function runCloudReplayCommand(\n argv: readonly string[],\n helper?: string,\n): Promise<number> {\n const [{ spawn }, { fileURLToPath }] = await Promise.all([\n import(\"node:child_process\"),\n import(\"node:url\"),\n ])\n const script =\n helper ?? fileURLToPath(new URL(\"../cloudReplay.py\", import.meta.url))\n const replayCommand = [\n process.execPath,\n ...process.execArgv.filter((flag) => !/^--(inspect|debug)/.test(flag)),\n fileURLToPath(new URL(\"./replayCli.js\", import.meta.url)),\n ]\n const keepWaiting = () => {}\n process.on(\"SIGINT\", keepWaiting)\n try {\n return await new Promise<number>((resolve) => {\n const child = spawn(\"python3\", [script, ...argv], {\n stdio: \"inherit\",\n env: {\n ...process.env,\n BITFAB_REPLAY_COMMAND: JSON.stringify(replayCommand),\n BITFAB_SDK_LANGUAGE: \"typescript\",\n },\n })\n child.on(\"error\", () => {\n process.stderr.write(\n \"Cloud replay needs Python 3.10+ on PATH as python3\\n\",\n )\n resolve(1)\n })\n child.on(\"close\", (code, signal) =>\n resolve(code ?? (signal === \"SIGINT\" ? 130 : 1)),\n )\n })\n } finally {\n process.off(\"SIGINT\", keepWaiting)\n }\n}\n","#!/usr/bin/env node\n\nimport {\n CLOUD_REPLAY_HINT,\n isCloudReplayCommand,\n runCloudReplayCommand,\n} from \"./cloudReplayCli.js\"\nimport {\n importRegistry,\n parseRegistryCommandArgs,\n type RegistryImporter,\n resolveRegistry,\n runIfEntrypoint,\n runRegistryMain,\n} from \"./registryCommand.js\"\nimport type { ReplayResult } from \"./replay.js\"\nimport {\n type ReplayCliIo,\n type ReseedRegistryResult,\n runReplayCli,\n runSeedCli,\n type SeedResult,\n} from \"./replayRegistry.js\"\n\nconst USAGE = `Usage: bitfab-replay --registry <path> <pipeline> [options]\\n bitfab-replay --registry <path> <pipeline> --resume <experimentId>\\n bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]\\nRun bitfab-replay --registry <path> --help to list replay options.\\n${CLOUD_REPLAY_HINT}`\n\nexport async function runReplayCommand(\n argv: readonly string[],\n io: ReplayCliIo = {},\n importer: RegistryImporter = importRegistry,\n): Promise<ReplayResult<unknown> | SeedResult | ReseedRegistryResult> {\n const { registryPath, commandArgs } = await parseRegistryCommandArgs(\n argv,\n USAGE,\n )\n const registry = resolveRegistry(await importer(registryPath), registryPath)\n if (commandArgs.includes(\"--seed\")) {\n return runSeedCli(registry, commandArgs, io)\n }\n return runReplayCli(registry, commandArgs, io, registryPath)\n}\n\nexport async function runReplayMain(\n argv: readonly string[],\n io: ReplayCliIo = {},\n): Promise<number> {\n if (isCloudReplayCommand(argv)) {\n return runCloudReplayCommand(argv)\n }\n return runRegistryMain(() => runReplayCommand(argv, io), io)\n}\n\nrunIfEntrypoint(import.meta.url, () => runReplayMain(process.argv.slice(2)))\n"],"mappings":";;;;;;;;;;;;;AAAO,IAAM,oBACX;AAEK,SAAS,qBAAqB,MAAkC;AACrE,SAAO,KAAK,KAAK,CAAC,QAAQ,QAAQ,aAAa,IAAI,WAAW,UAAU,CAAC;AAC3E;AAEA,eAAsB,sBACpB,MACA,QACiB;AACjB,QAAM,CAAC,EAAE,MAAM,GAAG,EAAE,cAAc,CAAC,IAAI,MAAM,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Y,SAAS,QAAQ,GAAG;AAClC,WAAO,WAAW,UAAU,aAAa,EAAE;AAAA,EAC7C;AACA,SAAO,aAAa,UAAU,aAAa,IAAI,YAAY;AAC7D;AAEA,eAAsB,cACpB,MACA,KAAkB,CAAC,GACF;AACjB,MAAI,qBAAqB,IAAI,GAAG;AAC9B,WAAO,sBAAsB,IAAI;AAAA,EACnC;AACA,SAAO,gBAAgB,MAAM,iBAAiB,MAAM,EAAE,GAAG,EAAE;AAC7D;AAEA,gBAAgB,YAAY,KAAK,MAAM,cAAc,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;","names":[]}
|
package/dist/seedCli.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
runIfEntrypoint,
|
|
7
7
|
runRegistryMain,
|
|
8
8
|
runSeedCli
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-EQBRW3MC.js";
|
|
10
|
+
import "./chunk-RQ7HWX2T.js";
|
|
11
11
|
|
|
12
12
|
// src/seedCli.ts
|
|
13
13
|
var USAGE = "Usage: bitfab-seed --registry <path> <pipeline> --from-trace <id>[,<id>...]\n bitfab-seed --registry <path> <pipeline> --cases <cases.jsonl> [--run]\nRun bitfab-seed --registry <path> <pipeline> --help for details.";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|