@smoothbricks/nx-plugin 0.6.0 → 0.6.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/README.md +13 -2
- package/dist/.build-inputs.json +13 -10
- package/dist/ensure-built-receipt.d.ts +9 -0
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +42 -1
- package/dist/executors/bounded-exec/cpu-pool-thread.d.ts +28 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-pool-thread.js +20 -0
- package/dist/executors/bounded-exec/cpu-pool.d.ts +4 -4
- package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/cpu-pool.js +7 -6
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +20 -2
- package/dist/executors/bounded-exec/gateway-lease.d.ts +3 -2
- package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
- package/dist/executors/bounded-exec/gateway-lease.js +23 -3
- package/dist/executors/bounded-exec/lease-wait.d.ts +23 -2
- package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -1
- package/dist/executors/bounded-exec/lease-wait.js +15 -11
- package/dist/executors/bounded-exec/mbx-pool.d.ts +31 -0
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -0
- package/dist/executors/bounded-exec/mbx-pool.js +24 -0
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts +9 -3
- package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/run-cpu-pool.js +109 -12
- package/dist/executors/bounded-exec/verdict.d.ts +8 -0
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +1 -1
- package/dist/executors/typescript-emit/emit-overrides.d.ts +14 -0
- package/dist/executors/typescript-emit/emit-overrides.d.ts.map +1 -0
- package/dist/executors/typescript-emit/emit-overrides.js +24 -0
- package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
- package/dist/executors/typescript-emit/executor.js +1 -19
- package/dist/managed-files/publish-workflow.js +14 -11
- package/dist/producer-receipts.d.ts.map +1 -1
- package/dist/producer-receipts.js +441 -1
- package/package.json +19 -2
- package/src/ensure-built-receipt.ts +41 -0
- package/src/executors/bounded-exec/cpu-pool-thread.ts +43 -0
- package/src/executors/bounded-exec/cpu-pool.ts +7 -6
- package/src/executors/bounded-exec/executor.ts +20 -2
- package/src/executors/bounded-exec/gateway-lease.ts +17 -7
- package/src/executors/bounded-exec/lease-wait.ts +39 -12
- package/src/executors/bounded-exec/mbx-pool.ts +48 -0
- package/src/executors/bounded-exec/run-cpu-pool.ts +117 -15
- package/src/executors/bounded-exec/verdict.ts +8 -1
- package/src/executors/typescript-emit/emit-overrides.ts +24 -0
- package/src/executors/typescript-emit/executor.ts +1 -20
- package/src/managed-files/publish-workflow.ts +20 -15
- package/src/producer-receipts.ts +28 -0
- package/test-timings.json +119 -118
package/README.md
CHANGED
|
@@ -2276,11 +2276,22 @@ instead of each sizing its runner to the whole host. Its scope is one run. A com
|
|
|
2276
2276
|
as configured, sized only by the ceilings it inherits, and nothing is said; a cowshed job's own jobserver fifo still
|
|
2277
2277
|
reaches it by Cargo's own rule ("Cargo reads its holder's jobserver").
|
|
2278
2278
|
|
|
2279
|
+
The pool runs on a worker thread of its own (`cpu-pool-thread.ts`). The process that serves the run, the Nx daemon when
|
|
2280
|
+
installed plugins load in it or the Nx CLI without one, hashes tasks and builds the project graph in synchronous calls
|
|
2281
|
+
on its main thread; a pool on that thread wrote no heartbeat behind a 14.2 s `hashPlans`, and every runner queued on it
|
|
2282
|
+
failed `SILENT` while it was alive. Under Bun, which tests the source, the thread takes the transform preload the
|
|
2283
|
+
package's bunfig names, since a Bun worker starts without its parent's preloads. The `test-pool-silence` target proves
|
|
2284
|
+
the thread: a runner in another process, queued on a 1-token run pool, stays queued while the test's own thread blocks
|
|
2285
|
+
for 20 s, and is granted when the holder returns its token. Its file is not `*.test.ts`, so the shards skip its
|
|
2286
|
+
real-time waits.
|
|
2287
|
+
|
|
2279
2288
|
CPU admission connects and sends within the 5 s control bound, then waits for the queue acknowledgement and grant under
|
|
2280
2289
|
15 s of actor silence, not a total queue deadline (`specs/cowshed/05_gateway.md`, "Deadlines"). A queued reply past 2 s
|
|
2281
2290
|
is accepted; the disk gateway's old-protocol half-close is not CPU admission policy. While tokens are held, the pool
|
|
2282
|
-
actor sends an advancing heartbeat every 5 s, so a live queue waits until tokens return.
|
|
2283
|
-
|
|
2291
|
+
actor sends an advancing heartbeat every 5 s, so a live queue waits until tokens return. The queue acknowledgement names
|
|
2292
|
+
the pid of the process the pool runs in. A silent actor fails admission as `SILENT` with its endpoint, that pid, bound,
|
|
2293
|
+
waited time and last progress, and the refused run's verdict record keeps the failure as its typed `cpuWait` row; the
|
|
2294
|
+
command never runs outside the pool.
|
|
2284
2295
|
|
|
2285
2296
|
A granted executor serves a private `BOUNDED_EXEC_CPU_POOL` with its actual token count, and the same count as a make
|
|
2286
2297
|
jobserver fifo beside it: `g − 1` token bytes, the command holding the implicit first, which the pool lends a socket
|
package/dist/.build-inputs.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"packages/nx-plugin/src/cross-check-policy.ts": "fc45eefdcf7ea3975affb4b89d91093b9cbfc3504756103a18353aef3a264db6",
|
|
24
24
|
"packages/nx-plugin/src/deploy-policy.ts": "8456e2f896c489e5f4905383a0294d1b7a33c2d95c5ca718458cc40ed8672c5c",
|
|
25
25
|
"packages/nx-plugin/src/disk-command-policy.ts": "fb8731ccf41cff47b88f30165b08dc8d551068c436f4e49cb2b62aa4b49be43c",
|
|
26
|
-
"packages/nx-plugin/src/ensure-built-receipt.ts": "
|
|
26
|
+
"packages/nx-plugin/src/ensure-built-receipt.ts": "f80084d91d37c5132822bf26b45e6a9ae35e54e366cedbb9d69a2abd663ca419",
|
|
27
27
|
"packages/nx-plugin/src/ensure-built-witness.ts": "428b3bde289d4f10cdc2b2442a84ebc653f3da8955f9ea596dddf3c759029b1c",
|
|
28
28
|
"packages/nx-plugin/src/ensure-built.ts": "cced1cdc9090c820320492c6bf40b853dd02e461651484193af89dc29173984f",
|
|
29
29
|
"packages/nx-plugin/src/eslint-config-closure.ts": "0cd5a9da34df914c2d6033b7d3de49728cd71229065a2e1b43dba923001e0826",
|
|
@@ -31,13 +31,15 @@
|
|
|
31
31
|
"packages/nx-plugin/src/executors/all-verdicts/executor.ts": "e8abe81c29074b6517a6251cc1c1ee87ba126d6f0959e182a9dd46b5a977ce6d",
|
|
32
32
|
"packages/nx-plugin/src/executors/all-verdicts/schema.ts": "9d2372b64ec77ae82b686df68a2843c11268920064909aa871edc538414ef13c",
|
|
33
33
|
"packages/nx-plugin/src/executors/bounded-exec/bounds.ts": "bb192e95fe56659e958c200282b9248653ea350e61dcb1eb84065b6e1b746c2b",
|
|
34
|
-
"packages/nx-plugin/src/executors/bounded-exec/cpu-pool.ts": "
|
|
34
|
+
"packages/nx-plugin/src/executors/bounded-exec/cpu-pool-thread.ts": "4b914385f7ab73cfb3afdc75c0e3c462e7c103c5061f7f7720d7b95f6655e32d",
|
|
35
|
+
"packages/nx-plugin/src/executors/bounded-exec/cpu-pool.ts": "a4be1280a0ea4b5aa0f04170ce75ce4b813631264c50fab5cdd05d34926fc890",
|
|
35
36
|
"packages/nx-plugin/src/executors/bounded-exec/disk-lease.ts": "1a3f6a6fa590d9a2550490bb6906dc91b6c05fbef235b025eaf257eb5310e92d",
|
|
36
|
-
"packages/nx-plugin/src/executors/bounded-exec/executor.ts": "
|
|
37
|
-
"packages/nx-plugin/src/executors/bounded-exec/gateway-lease.ts": "
|
|
37
|
+
"packages/nx-plugin/src/executors/bounded-exec/executor.ts": "0d1284c1f3e9718a2b2ff5d7139b048cae7d9a7fe3db96d01110bf0937a7ecfc",
|
|
38
|
+
"packages/nx-plugin/src/executors/bounded-exec/gateway-lease.ts": "f3f73bd92db30e4857f98fb8bd2b9a75b2a5a2a318f094e075ed803c1f9a0117",
|
|
38
39
|
"packages/nx-plugin/src/executors/bounded-exec/hang-diagnostics.ts": "088e31d641872fc3629f1e04138d5c856fd56fa4c69f45729e8e21fa3507a3af",
|
|
39
|
-
"packages/nx-plugin/src/executors/bounded-exec/lease-wait.ts": "
|
|
40
|
+
"packages/nx-plugin/src/executors/bounded-exec/lease-wait.ts": "59d8ac94d0b8b75858971c5bb28ee421fca4f7685577274fe8bbaf0c01ba462a",
|
|
40
41
|
"packages/nx-plugin/src/executors/bounded-exec/lock-wait.ts": "b14a23b49759a777f4b3338ced003adaf76837c2c38462458f76a7fef1b95d9e",
|
|
42
|
+
"packages/nx-plugin/src/executors/bounded-exec/mbx-pool.ts": "ed35855d8c989358e78a8487b47658319d38efd52f4b1b9a3e95d74dee4002b8",
|
|
41
43
|
"packages/nx-plugin/src/executors/bounded-exec/no-space.ts": "ec032968d89f9e853796012705a06c06cfc4da54bf6e6f10a526f98daca3d077",
|
|
42
44
|
"packages/nx-plugin/src/executors/bounded-exec/owned-subtree.ts": "cb5edf2b5fe2c1b5b961f8c0ff16ec7bfae3c22ad75dfd671b74f1a4a865863f",
|
|
43
45
|
"packages/nx-plugin/src/executors/bounded-exec/progress.ts": "353f415cc869fca65a75e5e89bd826292e1421ce1609002e4e47477cbb5ea6b4",
|
|
@@ -46,13 +48,13 @@
|
|
|
46
48
|
"packages/nx-plugin/src/executors/bounded-exec/ram-temp-fixtures.ts": "075da4ecfd1cf7dd98fc8c894599dcf2720faba07ac30b8e5592964178849359",
|
|
47
49
|
"packages/nx-plugin/src/executors/bounded-exec/ram-temp-held.ts": "7c32555bc6dab3f767925b55b68684d33a69393050342d06f055fb81e8e5332b",
|
|
48
50
|
"packages/nx-plugin/src/executors/bounded-exec/ram-temp.ts": "8d66e6ac13c4ccf6172586b9857d5114b48e027bdcb305f94f6828076c1f7eb4",
|
|
49
|
-
"packages/nx-plugin/src/executors/bounded-exec/run-cpu-pool.ts": "
|
|
51
|
+
"packages/nx-plugin/src/executors/bounded-exec/run-cpu-pool.ts": "3fc4bfe04862a756d9f74743e399d902a6ce6052a0a3ff4e7edf17f875f33266",
|
|
50
52
|
"packages/nx-plugin/src/executors/bounded-exec/runner-hook.ts": "606eab5db826e571eb15df618315e01cc773d09fd647beb1c00f6434df58ffad",
|
|
51
53
|
"packages/nx-plugin/src/executors/bounded-exec/runner-lifecycle.ts": "dc5c10634b8ccda82c71887bf55aaa67f322b1dace53383d45bd8863469af8a1",
|
|
52
54
|
"packages/nx-plugin/src/executors/bounded-exec/runner-sizing.ts": "bb8ecbc6acad99e077885ef096f61bf04fe017aa4184c34c98a578c3d3ef5a93",
|
|
53
55
|
"packages/nx-plugin/src/executors/bounded-exec/runtime-pin.ts": "8e7fecaf6dd01ce6e065020f8c87edfcdc04e995934e018ab3b69b36acdc5e4f",
|
|
54
56
|
"packages/nx-plugin/src/executors/bounded-exec/schema.ts": "18c2b0b6e8c5377f3cd520798da26a0fe2d04ebc35e16035af6432b85d038a2c",
|
|
55
|
-
"packages/nx-plugin/src/executors/bounded-exec/verdict.ts": "
|
|
57
|
+
"packages/nx-plugin/src/executors/bounded-exec/verdict.ts": "c9b6746839602f14d92c48b9013e86d1fa4c3dd5446384146c7c22d1fd7b712c",
|
|
56
58
|
"packages/nx-plugin/src/executors/cargo-zigbuild/executor.ts": "d20b73cc90ae1a9c3f96996cdde4d97347395ca875c4801ab67842ec89f9acd7",
|
|
57
59
|
"packages/nx-plugin/src/executors/cargo-zigbuild/schema.ts": "e5cf3b0cc91a2d003a63ca0c9a93f1ec08263469b8a19dbe338b2dc0c0810747",
|
|
58
60
|
"packages/nx-plugin/src/executors/clean-outputs/executor.ts": "acf82d9560451d76d9357217f5f57645135a393a6deadf8f217b57b481022c46",
|
|
@@ -62,7 +64,8 @@
|
|
|
62
64
|
"packages/nx-plugin/src/executors/scriptc-native/schema.ts": "41e48a9032ce93b2e6965861c73776e23015f44a0ebd1e011a0786e17b22a108",
|
|
63
65
|
"packages/nx-plugin/src/executors/shard-timings/executor.ts": "b5a84156fe2b71022603990a9c3e7721de7995987770b14ae60bd7e8117b1adf",
|
|
64
66
|
"packages/nx-plugin/src/executors/shard-timings/schema.ts": "e509fc7be7a5752f1636f3006440e747d8381c40a46229627b11d7cdad633f69",
|
|
65
|
-
"packages/nx-plugin/src/executors/typescript-emit/
|
|
67
|
+
"packages/nx-plugin/src/executors/typescript-emit/emit-overrides.ts": "3021aeb756492632d3e5da7a7ae15dded0a9399f73734c0d1fea1c69a2bd4b85",
|
|
68
|
+
"packages/nx-plugin/src/executors/typescript-emit/executor.ts": "efea02d08b3112d1927562f09dd8641d8a5e1653af876d89314e35fc381e6a53",
|
|
66
69
|
"packages/nx-plugin/src/executors/typescript-emit/schema.ts": "20edee20fee80198bbfbb743848d4ac3e41e734050abd511fceafcea9cd6da28",
|
|
67
70
|
"packages/nx-plugin/src/forbidden-spelling-policy.ts": "d6c2c17665770432e53ae4b49986dc88eb8e5205be915c6baf34cd819ca9470c",
|
|
68
71
|
"packages/nx-plugin/src/generators/bounded-test-targets/generator.ts": "fd77c72df6c8457f25c73e512546229ef11001974cba0a05d8700e523d990131",
|
|
@@ -87,7 +90,7 @@
|
|
|
87
90
|
"packages/nx-plugin/src/managed-files/paths.ts": "0727cde9a3eea88420290b63cb4c9a3ffab857b39e0411eed3c4ddeb4e563745",
|
|
88
91
|
"packages/nx-plugin/src/managed-files/pr-preview-cleanup-workflow.ts": "0f34805a6d737f364c23801da62aefcd4afdc7ba87e911019dd6301be640b385",
|
|
89
92
|
"packages/nx-plugin/src/managed-files/private-npm-policy.ts": "795882f98b2c2434e7c0115e93a7b4c0da6142ae0602274b362893c49a46d5a7",
|
|
90
|
-
"packages/nx-plugin/src/managed-files/publish-workflow.ts": "
|
|
93
|
+
"packages/nx-plugin/src/managed-files/publish-workflow.ts": "3552ac2aef74447e5b2e0681aa62d7ff35cbf348993a23e5d69834bc9668e8c6",
|
|
91
94
|
"packages/nx-plugin/src/managed-files/tree.ts": "a6b7dc515796a3824199938ce70af7d2b45347ed32064b487f3d5f381509dc54",
|
|
92
95
|
"packages/nx-plugin/src/manifest-hash.ts": "26cb2598853801cf70785386e1847feba7f04780b43809597004b7fb7ecbc2b6",
|
|
93
96
|
"packages/nx-plugin/src/nextest-code-bound.ts": "e1036934a35f1b65e0f43bddbea259e01a1100e553cdeaefc2db8823a4517340",
|
|
@@ -100,7 +103,7 @@
|
|
|
100
103
|
"packages/nx-plugin/src/process-children.ts": "eb59f25c02213942b85c16f9f758acf37112b5a5a550152c80656dc1ffcf8b30",
|
|
101
104
|
"packages/nx-plugin/src/process-group.ts": "2fcfb039c7dd2467319eb7377a3097b2ef7296ad31183595d0c98c1c2ead1189",
|
|
102
105
|
"packages/nx-plugin/src/process-listing.ts": "70e7b75d1dda4e813d6fd43800f38ea890cd816fd9b652dfb2eae4b598ff9e46",
|
|
103
|
-
"packages/nx-plugin/src/producer-receipts.ts": "
|
|
106
|
+
"packages/nx-plugin/src/producer-receipts.ts": "7b3bc6ad60333015e35861da1d85443cc7954cd08cde8488e863aa856f120490",
|
|
104
107
|
"packages/nx-plugin/src/release-config-policy.ts": "850fefcddefff6a76c596abea4d9e569f932fd3f94782b26ac6c8e29e3ac4c98",
|
|
105
108
|
"packages/nx-plugin/src/runtime-input-policy.ts": "a16545693909fa9b8271af51f73570b392c5c99a864bfd1eae4db40775e1d53f",
|
|
106
109
|
"packages/nx-plugin/src/runtime-input.ts": "56e748e0b7835d65efbb3be109c201bb4f10dc601a7ac5c8a8a51521501329a7",
|
|
@@ -58,6 +58,15 @@ export declare function captureProducerSources(root: string, targets: ReadonlyMa
|
|
|
58
58
|
export declare function producerSourceUnchanged(root: string, before: ProducerSourceWitness): ReceiptEvidence<true>;
|
|
59
59
|
/** Enumerate exact public nodes; never exempt a broad directory of tracked source. */
|
|
60
60
|
export declare function producerOutputPaths(root: string, tasks: readonly Task[], expand: typeof expandOutputs): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Remove what a producer's previous receipt declared as task outputs and its current task graph no longer declares,
|
|
63
|
+
* inside the declaring task's project root. A layout change (an output moved, a target renamed) otherwise leaves the
|
|
64
|
+
* old layout's files where a package's published `files` still packs them, so a consumer's capture hashes them as the
|
|
65
|
+
* producer's tools and ships them. A previously declared directory that holds a currently declared output loses only
|
|
66
|
+
* its other entries. A previous task that left this graph while its target still exists is not this producer's to
|
|
67
|
+
* clean: `defined` says whether a task's target still exists. Returns the removed paths, relative to `root`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function removeOrphanedOutputs(root: string, previous: readonly Task[], current: readonly Task[], expand: typeof expandOutputs, defined: (task: Task) => boolean): string[];
|
|
61
70
|
export declare function providerReceipt(root: string, taskId: string, tasks: readonly Task[], proof: ProviderInputProof, expand: typeof expandOutputs, source: ProducerSourceWitness, producer: Omit<EnsureBuiltProducerReceipt, 'outputSha256'>): {
|
|
62
71
|
readonly disposition: 'hit';
|
|
63
72
|
readonly receipt: EnsureBuiltReceipt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-built-receipt.d.ts","sourceRoot":"","sources":["../src/ensure-built-receipt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ensure-built-receipt.d.ts","sourceRoot":"","sources":["../src/ensure-built-receipt.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,UAAU,EAIf,KAAK,WAAW,EAEhB,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,eAAe,CAAC,CAAC,IACzB;IAAE,QAAQ,CA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EAAE,OAAO,aAAa,EAC5B,MAAM,EAAE,qBAAqB,EAC7B,QAAQ,EAAE,IAAI,CAAC,0BAA0B,EAAE,cAAc,CAAC,GACzD;IAAE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,GAAG,uBAAuB,CAyFjG;AACD,2IAA2I;AAC3I,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EAC5C,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,kBAAkB,EAAE,OAAO,GAC1B,kBAAkB,CAAC,eAAe,CAAC,CAsBrC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
|
-
import { closeSync, lstatSync, openSync, readdirSync, readFileSync, readlinkSync, readSync, realpathSync, } from 'node:fs';
|
|
3
|
+
import { closeSync, lstatSync, openSync, readdirSync, readFileSync, readlinkSync, readSync, realpathSync, rmSync, } from 'node:fs';
|
|
4
4
|
import { isAbsolute, join, relative } from 'node:path';
|
|
5
5
|
import { CARGO_TOOLCHAIN_PIN_INPUTS, cargoRuntimeInput, cargoToolchainPathsInput } from './cargo-toolchain-policy.js';
|
|
6
6
|
import { censusStart, directoryMembers, movedNodes, recordedStamp, } from './ensure-built-witness.js';
|
|
@@ -352,6 +352,47 @@ export function producerOutputPaths(root, tasks, expand) {
|
|
|
352
352
|
visit(path);
|
|
353
353
|
return [...paths].sort();
|
|
354
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Remove what a producer's previous receipt declared as task outputs and its current task graph no longer declares,
|
|
357
|
+
* inside the declaring task's project root. A layout change (an output moved, a target renamed) otherwise leaves the
|
|
358
|
+
* old layout's files where a package's published `files` still packs them, so a consumer's capture hashes them as the
|
|
359
|
+
* producer's tools and ships them. A previously declared directory that holds a currently declared output loses only
|
|
360
|
+
* its other entries. A previous task that left this graph while its target still exists is not this producer's to
|
|
361
|
+
* clean: `defined` says whether a task's target still exists. Returns the removed paths, relative to `root`.
|
|
362
|
+
*/
|
|
363
|
+
export function removeOrphanedOutputs(root, previous, current, expand, defined) {
|
|
364
|
+
const declared = current.flatMap((task) => expand(root, task.outputs));
|
|
365
|
+
const currentIds = new Set(current.map((task) => task.id));
|
|
366
|
+
const removed = [];
|
|
367
|
+
function prune(path) {
|
|
368
|
+
if (declared.some((output) => path === output || path.startsWith(`${output}/`)))
|
|
369
|
+
return;
|
|
370
|
+
const stats = lstatSync(join(root, path), { throwIfNoEntry: false });
|
|
371
|
+
if (stats === undefined)
|
|
372
|
+
return;
|
|
373
|
+
if (!declared.some((output) => output.startsWith(`${path}/`))) {
|
|
374
|
+
rmSync(join(root, path), { recursive: true, force: true });
|
|
375
|
+
removed.push(path);
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
if (stats.isDirectory())
|
|
379
|
+
for (const name of readdirSync(join(root, path)))
|
|
380
|
+
prune(join(path, name));
|
|
381
|
+
}
|
|
382
|
+
for (const task of previous) {
|
|
383
|
+
if (!currentIds.has(task.id) && defined(task))
|
|
384
|
+
continue;
|
|
385
|
+
const project = task.projectRoot ?? '';
|
|
386
|
+
for (const output of expand(root, task.outputs)) {
|
|
387
|
+
if (isAbsolute(output) || output.split('/').includes('..'))
|
|
388
|
+
continue;
|
|
389
|
+
if (project !== '' && project !== '.' && output !== project && !output.startsWith(`${project}/`))
|
|
390
|
+
continue;
|
|
391
|
+
prune(output);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return removed.sort();
|
|
395
|
+
}
|
|
355
396
|
export function providerReceipt(root, taskId, tasks, proof, expand, source, producer) {
|
|
356
397
|
const failed = (detail) => ({
|
|
357
398
|
disposition: 'failed',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type CloseOutcome } from './cpu-pool.js';
|
|
2
|
+
/**
|
|
3
|
+
* The thread an Nx run's CPU pool runs on (`run-cpu-pool.ts`; specs/cowshed/05_gateway.md, "Every Nx run budgets
|
|
4
|
+
* itself"). The process that serves a run's pool, the Nx daemon when installed plugins load in it or the Nx CLI without
|
|
5
|
+
* one, hashes tasks and builds the project graph in synchronous calls on its main thread. A pool there writes no
|
|
6
|
+
* heartbeat while one runs, and every runner queued on it fails `SILENT` while it still works. Here the pool's socket,
|
|
7
|
+
* jobserver fifo and heartbeat share an event loop that runs nothing else, so the heartbeat proves that the actor which
|
|
8
|
+
* admits and grants is turning.
|
|
9
|
+
*
|
|
10
|
+
* The thread is started with the pool's count. It says once that the pool serves, with the environment a task inherits,
|
|
11
|
+
* or why it cannot; the host's one message is its close, after which the thread says how the pool closed.
|
|
12
|
+
*/
|
|
13
|
+
/** What the thread is started with. */
|
|
14
|
+
export interface CpuPoolThreadData {
|
|
15
|
+
readonly tokens: number;
|
|
16
|
+
}
|
|
17
|
+
/** What the thread says, in order: the pool serves or failed; after the host's close, how the pool closed. */
|
|
18
|
+
export type CpuPoolThreadReport = {
|
|
19
|
+
readonly kind: 'serving';
|
|
20
|
+
readonly environment: Record<string, string>;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: 'failed';
|
|
23
|
+
readonly error: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: 'closed';
|
|
26
|
+
readonly outcome: CloseOutcome;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=cpu-pool-thread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpu-pool-thread.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/cpu-pool-thread.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,eAAe,CAAC;AAEjE;;;;;;;;;;GAUG;AAEH,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,8GAA8G;AAC9G,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAC1E;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { parentPort, workerData } from 'node:worker_threads';
|
|
2
|
+
import { createCpuPool } from './cpu-pool.js';
|
|
3
|
+
const host = parentPort;
|
|
4
|
+
if (host === null) {
|
|
5
|
+
throw new Error('cpu-pool-thread runs as the worker thread run-cpu-pool starts, never as a module of its own');
|
|
6
|
+
}
|
|
7
|
+
const report = (message) => host.postMessage(message);
|
|
8
|
+
const data = workerData;
|
|
9
|
+
// The pool lives until its host closes it, or with the thread.
|
|
10
|
+
const made = await createCpuPool(data.tokens, new Promise(() => { }));
|
|
11
|
+
if (made.ok) {
|
|
12
|
+
const { pool } = made;
|
|
13
|
+
host.once('message', () => {
|
|
14
|
+
void pool.close().then((outcome) => report({ kind: 'closed', outcome }));
|
|
15
|
+
});
|
|
16
|
+
report({ kind: 'serving', environment: pool.environment });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
report({ kind: 'failed', error: made.error });
|
|
20
|
+
}
|
|
@@ -2,8 +2,9 @@ import { type Unleased } from './gateway-lease.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* A CPU pool: the tokens a process lends the runners it starts, held live rather than inherited as a
|
|
4
4
|
* bare count (specs/cowshed/05_gateway.md, "Host scheduling", "Parallelism inside a job"). An Nx run
|
|
5
|
-
* serves one (`run-cpu-pool.ts`), and every granted bounded-exec serves a
|
|
6
|
-
* its own descendants, so the runners of one build tree together stay
|
|
5
|
+
* serves one on a thread of its own (`run-cpu-pool.ts`), and every granted bounded-exec serves a
|
|
6
|
+
* sub-pool of its grant to its own descendants, so the runners of one build tree together stay
|
|
7
|
+
* within the tree's count.
|
|
7
8
|
*
|
|
8
9
|
* The pool is a private Unix socket in a directory the process owns: the directory 0700, the socket
|
|
9
10
|
* 0600. A child asks it for a count with one request line, in `holdLease`'s framing. The pool
|
|
@@ -37,7 +38,7 @@ export interface CpuPool {
|
|
|
37
38
|
*/
|
|
38
39
|
close(): Promise<CloseOutcome>;
|
|
39
40
|
}
|
|
40
|
-
type CloseOutcome = {
|
|
41
|
+
export type CloseOutcome = {
|
|
41
42
|
ok: true;
|
|
42
43
|
} | {
|
|
43
44
|
ok: false;
|
|
@@ -78,5 +79,4 @@ export declare function createCpuPool(tokens: number, closed: Promise<void>): Pr
|
|
|
78
79
|
ok: false;
|
|
79
80
|
error: string;
|
|
80
81
|
}>;
|
|
81
|
-
export {};
|
|
82
82
|
//# sourceMappingURL=cpu-pool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cpu-pool.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/cpu-pool.ts"],"names":[],"mappings":"AAQA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9D
|
|
1
|
+
{"version":3,"file":"cpu-pool.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/cpu-pool.ts"],"names":[],"mappings":"AAQA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,yGAAyG;AACzG,eAAO,MAAM,YAAY,0BAA0B,CAAC;AAEpD,6FAA6F;AAC7F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,QAAQ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a process lends the runners it starts, held live rather than inherited as a
|
|
18
18
|
* bare count (specs/cowshed/05_gateway.md, "Host scheduling", "Parallelism inside a job"). An Nx run
|
|
19
|
-
* serves one (`run-cpu-pool.ts`), and every granted bounded-exec serves a
|
|
20
|
-
* its own descendants, so the runners of one build tree together stay
|
|
19
|
+
* serves one on a thread of its own (`run-cpu-pool.ts`), and every granted bounded-exec serves a
|
|
20
|
+
* sub-pool of its grant to its own descendants, so the runners of one build tree together stay
|
|
21
|
+
* within the tree's count.
|
|
21
22
|
*
|
|
22
23
|
* The pool is a private Unix socket in a directory the process owns: the directory 0700, the socket
|
|
23
24
|
* 0600. A child asks it for a count with one request line, in `holdLease`'s framing. The pool
|
|
@@ -49,7 +50,7 @@ const isRequest = (() => {
|
|
|
49
50
|
const stringifyReply = (() => {
|
|
50
51
|
const _ip0 = input => true === input["ok"];
|
|
51
52
|
const _so0 = input => `{"ok":${String(input.ok)},"progress":${String(_jsonStringifyNumber_1._jsonStringifyNumber(input.progress))}}`;
|
|
52
|
-
const _so1 = input => `{"ok":${String(input.ok)},"lease":${"\"" + input.lease + "\""}}`;
|
|
53
|
+
const _so1 = input => `{"ok":${String(input.ok)},"lease":${"\"" + input.lease + "\""},"server":${String(_jsonStringifyNumber_1._jsonStringifyNumber(input.server))}}`;
|
|
53
54
|
const _so2 = input => `{"ok":${String(input.ok)},"lease":${"\"" + input.lease + "\""},"tokens":${String(_jsonStringifyNumber_1._jsonStringifyNumber(input.tokens))}}`;
|
|
54
55
|
const _so3 = input => `{"ok":${String(input.ok)},"code":${"\"" + input.code + "\""},"error":${_jsonStringifyString_1._jsonStringifyString(input.error)}}`;
|
|
55
56
|
const _su0 = input => (() => {
|
|
@@ -64,12 +65,12 @@ const stringifyReply = (() => {
|
|
|
64
65
|
else
|
|
65
66
|
_throwTypeGuardError_1._throwTypeGuardError({
|
|
66
67
|
method: "typia.json.createStringify",
|
|
67
|
-
expected: "(CpuLeaseProgress |
|
|
68
|
+
expected: "(CpuLeaseProgress | CpuLeaseQueued | { ok: true; lease: \"granted\"; tokens: number; } | { ok: false; code: \"invalid-request\"; error: string; })",
|
|
68
69
|
value: input
|
|
69
70
|
});
|
|
70
71
|
})();
|
|
71
72
|
const _io0 = input => _ip0(input) && "number" === typeof input.progress;
|
|
72
|
-
const _io1 = input => _ip0(input) && "queued" === input.lease;
|
|
73
|
+
const _io1 = input => _ip0(input) && "queued" === input.lease && ("number" === typeof input.server && _isTypeUint32_1._isTypeUint32(input.server));
|
|
73
74
|
const _io2 = input => _ip0(input) && "granted" === input.lease && "number" === typeof input.tokens;
|
|
74
75
|
const _io3 = input => false === input.ok && "invalid-request" === input.code && "string" === typeof input.error;
|
|
75
76
|
return input => _su0(input);
|
|
@@ -484,7 +485,7 @@ export async function createCpuPool(tokens, closed) {
|
|
|
484
485
|
const request = parsed;
|
|
485
486
|
child.phase = { kind: 'queued' };
|
|
486
487
|
queue.push({ child, want: request.want });
|
|
487
|
-
socket.write(frame({ ok: true, lease: 'queued' }));
|
|
488
|
+
socket.write(frame({ ok: true, lease: 'queued', server: process.pid }));
|
|
488
489
|
drain(0);
|
|
489
490
|
});
|
|
490
491
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/executor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAIL,KAAK,gBAAgB,EAItB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,sBAAsB,EAAmB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/executor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAIL,KAAK,gBAAgB,EAItB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,sBAAsB,EAAmB,MAAM,uBAAuB,CAAC;AAKhF,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EASL,aAAa,EAEd,M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SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAOzB,GACA,MAAM,GAAG,SAAS,CAiBpB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAE5B;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAc5B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,UAAU,GAAG,IAAI,GACzD,OAAO,CAAC,iBAAiB,CAAC,CAsB5B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB,CAiBxE;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,GAAG,IAAI,EAC7B,SAAS,GAAE,gBAAgB,GAAG,IAAW,EACzC,kBAAkB,GAAE,OAAO,sBAA+C,EAC1E,KAAK,GAAE,YAAY,GAAG,IAAW,GAChC,OAAO,CAAC,iBAAiB,CAAC,CA6wB5B;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAM3D"}
|
|
@@ -11,6 +11,7 @@ import { earliestBound, stepBounds, UNARMED } from './bounds.js';
|
|
|
11
11
|
import { CPU_POOL_ENV, createCpuPool, readInheritedCpuPool, takeParentCpuTokens, } from './cpu-pool.js';
|
|
12
12
|
import { GATEWAY_SOCKET } from './gateway-lease.js';
|
|
13
13
|
import { captureHangDiagnostics, HANG_CAPTURE_MS } from './hang-diagnostics.js';
|
|
14
|
+
import { mbxLeaf, mbxPool, withMbxLeaf } from './mbx-pool.js';
|
|
14
15
|
import { createNoSpaceWatch } from './no-space.js';
|
|
15
16
|
import { COWSHED_EXECUTABLE_ENV, cowshedSubtreeOwner, HANDLE_FD, readAdmission, SUPERVISOR_SOCKET_ENV, } from './owned-subtree.js';
|
|
16
17
|
import { createRunProgress, withProgressReport } from './progress.js';
|
|
@@ -354,6 +355,7 @@ export async function runBoundedExec(options, context, killer, tempVolume, inher
|
|
|
354
355
|
// instead. A pool whose endpoint is gone (its holder exited) lends nothing, and the run goes on as asked.
|
|
355
356
|
let grant = null;
|
|
356
357
|
let parentRefusal = null;
|
|
358
|
+
let parentWait;
|
|
357
359
|
if (inherited !== null) {
|
|
358
360
|
const fromParent = await takeParentCpuTokens(inherited, demand.want);
|
|
359
361
|
if (fromParent.granted) {
|
|
@@ -364,16 +366,25 @@ export async function runBoundedExec(options, context, killer, tempVolume, inher
|
|
|
364
366
|
}
|
|
365
367
|
else {
|
|
366
368
|
parentRefusal = fromParent.reason;
|
|
369
|
+
parentWait = fromParent.wait;
|
|
367
370
|
}
|
|
368
371
|
}
|
|
369
372
|
const waitedMs = Date.now() - asked;
|
|
370
373
|
let cpu;
|
|
371
374
|
let sized = { command: requested, env: {} };
|
|
375
|
+
// With mbx the leaf's admission is mbx's one pool, not a parent's tokens: its runner is sized to the job's count,
|
|
376
|
+
// and a non-Cargo leaf holds that much of the pool for its run (specs/cowshed/05_gateway.md, "Parallelism inside a
|
|
377
|
+
// job"). No grant and no sub-pool beside it.
|
|
378
|
+
const mbx = mbxPool(process.env);
|
|
379
|
+
const leaf = mbx === null ? null : mbxLeaf(mbx, demand.kind, demand.want);
|
|
372
380
|
if (grant !== null) {
|
|
373
381
|
sized = sizeRunner(demand, requested, grant.tokens);
|
|
374
382
|
cpu = { tokens: grant.tokens, want: demand.want, waitedMs };
|
|
375
383
|
appendStderr(`cowshed: cpu-pool wait done elapsed=${waitedMs}ms status=ok tokens=${grant.tokens}/${demand.want} runner=${demand.kind}\n`);
|
|
376
384
|
}
|
|
385
|
+
else if (leaf !== null) {
|
|
386
|
+
sized = sizeRunner(demand, requested, demand.want);
|
|
387
|
+
}
|
|
377
388
|
// The run's sub-pool and grant are given back exactly once, however the run ends. The sub-pool closes first, so no
|
|
378
389
|
// descendant still draws on tokens the grant has returned.
|
|
379
390
|
let pool = null;
|
|
@@ -408,7 +419,13 @@ export async function runBoundedExec(options, context, killer, tempVolume, inher
|
|
|
408
419
|
if (verdict.outcome === 'bound' && verdict.bound === 'test') {
|
|
409
420
|
appendStderr(`Every failing test failed only on its per-test timeout: ${verdict.tests.join(', ')}\n`);
|
|
410
421
|
}
|
|
411
|
-
await writeRecord(recordDirectory, {
|
|
422
|
+
await writeRecord(recordDirectory, {
|
|
423
|
+
task: task.id,
|
|
424
|
+
hash: task.hash,
|
|
425
|
+
verdict,
|
|
426
|
+
...(cpu ? { cpu } : {}),
|
|
427
|
+
...(parentWait ? { cpuWait: parentWait } : {}),
|
|
428
|
+
});
|
|
412
429
|
};
|
|
413
430
|
// A run refused before its command starts says why, gives back its grant and RAM, and records the failure.
|
|
414
431
|
const refuse = async (message) => {
|
|
@@ -457,7 +474,8 @@ export async function runBoundedExec(options, context, killer, tempVolume, inher
|
|
|
457
474
|
const startedAt = Date.now();
|
|
458
475
|
// With a supervisor, `cowshed subtree-root` asks it for a handle on itself, writes the answer to the handle
|
|
459
476
|
// descriptor, and execs `/bin/sh -c command` in the same process: the command's pid, group and life are unchanged.
|
|
460
|
-
const
|
|
477
|
+
const unadmitted = hooked?.command ?? (fixture === null ? command : `${fixture.command} && ${command}`);
|
|
478
|
+
const shellCommand = leaf === null ? unadmitted : withMbxLeaf(unadmitted, leaf);
|
|
461
479
|
const root = owner?.rootArgv(shellCommand);
|
|
462
480
|
let child;
|
|
463
481
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CpuLeaseWait } from './lease-wait.js';
|
|
1
|
+
import { CpuLeaseWait, type CpuWaitRow } from './lease-wait.js';
|
|
2
2
|
/**
|
|
3
3
|
* The client half of a lease held on a unix socket: the gateway's host disk-lifecycle lease
|
|
4
4
|
* (`disk-lease.ts`) and a parent's CPU pool (`cpu-pool.ts`) speak the same protocol
|
|
@@ -26,12 +26,13 @@ export interface LeaseBounds {
|
|
|
26
26
|
* other refusal, silence or breakage.
|
|
27
27
|
*/
|
|
28
28
|
export type UnleasedCause = 'absent' | 'predates' | 'predates-field' | 'other';
|
|
29
|
-
/** A refusal: the lease is not held, and why. */
|
|
29
|
+
/** A refusal: the lease is not held, and why. A CPU wait that expired carries its typed row. */
|
|
30
30
|
export type Unleased = {
|
|
31
31
|
granted: false;
|
|
32
32
|
cause: UnleasedCause;
|
|
33
33
|
reason: string;
|
|
34
34
|
code?: string;
|
|
35
|
+
wait?: CpuWaitRow;
|
|
35
36
|
};
|
|
36
37
|
/**
|
|
37
38
|
* A granted lease with its `granted` answer, held until released, or why there is none. `closed`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-lease.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/gateway-lease.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"gateway-lease.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/gateway-lease.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8C,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK5G;;;;;;;;;;GAUG;AAEH,oFAAoF;AACpF,eAAO,MAAM,cAAc,wCAAwC,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,gBAAgB,GAAG,OAAO,CAAC;AAE/E,gGAAgG;AAChG,MAAM,MAAM,QAAQ,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAElH;;;;GAIG;AACH,MAAM,MAAM,SAAS,GACjB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,GACxG,QAAQ,CAAC;AAEb;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC1C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,GAAG,YAAY,EAClC,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,OAAO,CAAC,SAAS,CAAC,CA2KpB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _isTypeUint32_1 from "typia/lib/internal/_isTypeUint32";
|
|
1
2
|
import { connect } from 'node:net';
|
|
2
3
|
import typia from 'typia';
|
|
3
4
|
import { CpuLeaseWait } from './lease-wait.js';
|
|
@@ -12,6 +13,17 @@ const isCpuProgress = (() => {
|
|
|
12
13
|
}));
|
|
13
14
|
return (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true);
|
|
14
15
|
})();
|
|
16
|
+
const isCpuQueued = (() => {
|
|
17
|
+
const _io0 = (input, _exceptionable = true) => true === input.ok && "queued" === input.lease && ("number" === typeof input.server && _isTypeUint32_1._isTypeUint32(input.server)) && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
18
|
+
if (["ok", "lease", "server"].some(prop => key === prop))
|
|
19
|
+
return true;
|
|
20
|
+
const value = input[key];
|
|
21
|
+
if (undefined === value)
|
|
22
|
+
return true;
|
|
23
|
+
return false;
|
|
24
|
+
}));
|
|
25
|
+
return (input, _exceptionable = true) => "object" === typeof input && null !== input && _io0(input, true);
|
|
26
|
+
})();
|
|
15
27
|
/**
|
|
16
28
|
* The client half of a lease held on a unix socket: the gateway's host disk-lifecycle lease
|
|
17
29
|
* (`disk-lease.ts`) and a parent's CPU pool (`cpu-pool.ts`) speak the same protocol
|
|
@@ -61,7 +73,13 @@ export function holdLease(socket, request, what, bounds, onQueued) {
|
|
|
61
73
|
}
|
|
62
74
|
resolve(outcome);
|
|
63
75
|
};
|
|
64
|
-
const unleased = (reason, cause = 'other', code) => settle({
|
|
76
|
+
const unleased = (reason, cause = 'other', code, wait) => settle({
|
|
77
|
+
granted: false,
|
|
78
|
+
cause,
|
|
79
|
+
reason,
|
|
80
|
+
...(code === undefined ? {} : { code }),
|
|
81
|
+
...(wait === undefined ? {} : { wait }),
|
|
82
|
+
});
|
|
65
83
|
const wait = (ms, onExpiry) => {
|
|
66
84
|
clearTimeout(timer);
|
|
67
85
|
timer = setTimeout(onExpiry, ms);
|
|
@@ -76,7 +94,8 @@ export function holdLease(socket, request, what, bounds, onQueued) {
|
|
|
76
94
|
armCpu();
|
|
77
95
|
return;
|
|
78
96
|
}
|
|
79
|
-
|
|
97
|
+
const peer = failure.server === null ? socket : `${socket} (pid ${failure.server})`;
|
|
98
|
+
unleased(`${failure.code}: cpu-pool: the lease endpoint ${peer} exceeded ${failure.boundMs} ms (waited ${failure.elapsedMs} ms; last progress: ${failure.last})`, 'other', failure.code, { ...failure, socket });
|
|
80
99
|
});
|
|
81
100
|
};
|
|
82
101
|
armCpu();
|
|
@@ -126,7 +145,8 @@ export function holdLease(socket, request, what, bounds, onQueued) {
|
|
|
126
145
|
state = 'queued';
|
|
127
146
|
onQueued?.();
|
|
128
147
|
if (bounds instanceof CpuLeaseWait) {
|
|
129
|
-
|
|
148
|
+
// A pool from before its acknowledgement named its process names none.
|
|
149
|
+
bounds.queued(isCpuQueued(parsed) ? parsed.server : null);
|
|
130
150
|
armCpu();
|
|
131
151
|
}
|
|
132
152
|
else if (bounds.grantMs === null) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { tags } from 'typia';
|
|
1
2
|
/** Peer wait classes from specs/cowshed/05_gateway.md, "Deadlines". */
|
|
2
3
|
export declare const CONTROL_MS = 5000;
|
|
3
4
|
export declare const HEARTBEAT_MS = 5000;
|
|
@@ -7,12 +8,29 @@ export interface CpuLeaseProgress {
|
|
|
7
8
|
ok: true;
|
|
8
9
|
progress: number;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* The CPU pool's queue acknowledgement, shared by its server and lease client. `server` is the pid of the process the
|
|
13
|
+
* pool runs in, so a wait that falls silent names the process to look at.
|
|
14
|
+
*/
|
|
15
|
+
export interface CpuLeaseQueued {
|
|
16
|
+
ok: true;
|
|
17
|
+
lease: 'queued';
|
|
18
|
+
server: number & tags.Type<'uint32'>;
|
|
19
|
+
}
|
|
10
20
|
/** A failed wait, not a failed command: expiry ends this client's admission only. */
|
|
11
21
|
export interface CpuWaitFailure {
|
|
12
22
|
code: 'TIMEOUT' | 'SILENT';
|
|
13
23
|
boundMs: number;
|
|
14
24
|
elapsedMs: number;
|
|
15
25
|
last: string;
|
|
26
|
+
/** The last advancing heartbeat sequence the client read; 0 before the first. */
|
|
27
|
+
sequence: number;
|
|
28
|
+
/** The pool's pid as its queue acknowledgement named it; null before one, or from a pool that names none. */
|
|
29
|
+
server: number | null;
|
|
30
|
+
}
|
|
31
|
+
/** An expired CPU wait as its client keeps it: the failure, and the socket of the pool it waited on. */
|
|
32
|
+
export interface CpuWaitRow extends CpuWaitFailure {
|
|
33
|
+
socket: string;
|
|
16
34
|
}
|
|
17
35
|
/** Pure CPU admission policy; its injected monotonic clock performs no I/O or scheduling. */
|
|
18
36
|
export declare class CpuLeaseWait {
|
|
@@ -24,8 +42,11 @@ export declare class CpuLeaseWait {
|
|
|
24
42
|
constructor(now?: () => number);
|
|
25
43
|
/** The kernel took the complete request; only peer silence bounds the answer from here. */
|
|
26
44
|
sent(): void;
|
|
27
|
-
/**
|
|
28
|
-
|
|
45
|
+
/**
|
|
46
|
+
* A queue entry proves actor progress, not a deadline for returning a token. It names the pool's pid when the pool
|
|
47
|
+
* says it.
|
|
48
|
+
*/
|
|
49
|
+
queued(server: number | null): void;
|
|
29
50
|
/** Only an advancing actor sequence renews silence; duplicate or invalid progress proves nothing. */
|
|
30
51
|
heartbeat(sequence: number): boolean;
|
|
31
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lease-wait.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/lease-wait.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,eAAO,MAAM,UAAU,OAAQ,CAAC;AAChC,eAAO,MAAM,YAAY,OAAQ,CAAC;AAClC,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,qFAAqF;AACrF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"lease-wait.d.ts","sourceRoot":"","sources":["../../../src/executors/bounded-exec/lease-wait.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,uEAAuE;AACvE,eAAO,MAAM,UAAU,OAAQ,CAAC;AAChC,eAAO,MAAM,YAAY,OAAQ,CAAC;AAClC,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,qFAAqF;AACrF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,IAAI,CAAC;IACT,QAAQ,EAAE,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
|
|
20
20
|
if (this.state.kind === 'sending') {
|
|
21
|
-
this.state = { kind: 'waiting', at: this.now(), last: 'request sent', sequence: 0 };
|
|
21
|
+
this.state = { kind: 'waiting', at: this.now(), last: 'request sent', sequence: 0, server: null };
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* A queue entry proves actor progress, not a deadline for returning a token. It names the pool's pid when the pool
|
|
26
|
+
* says it.
|
|
27
|
+
*/
|
|
28
|
+
queued(server) {
|
|
26
29
|
this.sent();
|
|
27
30
|
if (this.state.kind === 'waiting') {
|
|
28
|
-
this.state = { ...this.state, at: this.now(), last: 'queued' };
|
|
31
|
+
this.state = { ...this.state, at: this.now(), last: 'queued', server };
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
/** Only an advancing actor sequence renews silence; duplicate or invalid progress proves nothing. */
|
|
@@ -33,7 +36,7 @@ export class CpuLeaseWait {
|
|
|
33
36
|
this.sent();
|
|
34
37
|
if (this.state.kind !== 'waiting' || !Number.isSafeInteger(sequence) || sequence <= this.state.sequence)
|
|
35
38
|
return false;
|
|
36
|
-
this.state = {
|
|
39
|
+
this.state = { ...this.state, at: this.now(), last: `heartbeat ${sequence}`, sequence };
|
|
37
40
|
return true;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
@@ -58,11 +61,12 @@ export class CpuLeaseWait {
|
|
|
58
61
|
expired() {
|
|
59
62
|
if (this.remainingMs() > 0)
|
|
60
63
|
return null;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
elapsedMs:
|
|
65
|
-
|
|
66
|
-
};
|
|
64
|
+
const elapsedMs = this.now() - this.started;
|
|
65
|
+
if (this.state.kind === 'sending') {
|
|
66
|
+
const last = 'connecting or sending request';
|
|
67
|
+
return { code: 'TIMEOUT', boundMs: CONTROL_MS, elapsedMs, last, sequence: 0, server: null };
|
|
68
|
+
}
|
|
69
|
+
const { last, sequence, server } = this.state;
|
|
70
|
+
return { code: 'SILENT', boundMs: HEARTBEAT_SILENCE_MS, elapsedMs, last, sequence, server };
|
|
67
71
|
}
|
|
68
72
|
}
|