@camstack/system 1.2.471 → 1.2.472
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon-runner.js +202 -8
- package/dist/addon-runner.mjs +203 -9
- package/dist/addon-utils.mjs +1 -1
- package/dist/{agent-https-DHBvFZJS.mjs → agent-https-JhvY1axF.mjs} +1 -1
- package/dist/{agent-https-bH6bKDeK.js → agent-https-bnyFRK7Y.js} +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.d.ts +9 -25
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +240 -39
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +237 -38
- package/dist/builtins/liveness-monitor/liveness-reporter.d.ts +28 -0
- package/dist/builtins/liveness-monitor/storage-root-access.d.ts +53 -0
- package/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +8 -8
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-DRw_vBKH.mjs → composition-sources-BY6rFuAE.mjs} +1 -1
- package/dist/{composition-sources-B5uJZXZ1.js → composition-sources-D3h-tNoJ.js} +1 -1
- package/dist/{constants-CToE4OFp.js → constants-CqbO6e9i.js} +1 -1
- package/dist/{constants-5lA8Z9d8.mjs → constants-zBiEodEM.mjs} +1 -1
- package/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
- package/dist/{custom-action-registry-BGYDjTqY.mjs → custom-action-registry-DZSCLBuT.mjs} +37 -37
- package/dist/{device-ca-URrs1lxK.mjs → device-ca-BWTWWBcc.mjs} +1 -1
- package/dist/{device-ca-nOCYVFS4.js → device-ca-CfiIg3a9.js} +1 -1
- package/dist/{dist-5XUG7iYJ.mjs → dist-CdFkkmXW.mjs} +100 -254
- package/dist/{dist-BjcWEfRy.js → dist-DX5Fu3mV.js} +100 -254
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-vEWhJ_SD.js → hub-mdns-ciao-C174UDzO.js} +2 -2
- package/dist/{hub-mdns-ciao-zD3JojB_.mjs → hub-mdns-ciao-CYp1Gipm.mjs} +2 -2
- package/dist/index.js +234 -16
- package/dist/index.mjs +453 -235
- package/dist/kernel/hwaccel/hwaccel-resolver.d.ts +24 -4
- package/dist/kernel/hwaccel/vaapi-init-probe.d.ts +29 -0
- package/dist/kernel/moleculer/runner-process-group.d.ts +4 -0
- package/dist/{restore-archive-B64m2nAj.js → restore-archive-B2jIFfu_.js} +1 -1
- package/dist/{restore-archive-CN1pJTRn.mjs → restore-archive-BX0gaKtG.mjs} +94 -94
- package/dist/{wal-maintenance-BNXVX-ot.js → wal-maintenance-Dxqd5igw.js} +0 -0
- package/dist/{wal-maintenance-Bl2I-ZcR.mjs → wal-maintenance-KHzJXlF2.mjs} +0 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { Ta as userError } from "./dist-
|
|
2
|
+
import { Ta as userError } from "./dist-CdFkkmXW.mjs";
|
|
3
3
|
import { f as X509Certificate$1 } from "./x509.es-DK__ETIe.mjs";
|
|
4
|
-
import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-
|
|
4
|
+
import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-JhvY1axF.mjs";
|
|
5
5
|
import { X509Certificate, createPrivateKey } from "node:crypto";
|
|
6
6
|
import { writeOwnerOnlyFileSync } from "@camstack/types/node";
|
|
7
7
|
import { mkdir, writeFile } from "node:fs/promises";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
4
|
-
const require_device_ca = require("./device-ca-
|
|
3
|
+
const require_dist = require("./dist-DX5Fu3mV.js");
|
|
4
|
+
const require_device_ca = require("./device-ca-CfiIg3a9.js");
|
|
5
5
|
const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
|
|
6
6
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
7
7
|
require("./builtins/alerts/index.js");
|
|
@@ -26,21 +26,21 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
|
|
|
26
26
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
27
27
|
const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
|
|
28
28
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
29
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
29
|
+
const require_wal_maintenance = require("./wal-maintenance-Dxqd5igw.js");
|
|
30
30
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
31
31
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
32
32
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
33
33
|
require("./builtins/storage-orchestrator/index.js");
|
|
34
|
-
const require_agent_https = require("./agent-https-
|
|
35
|
-
const require_constants = require("./constants-
|
|
34
|
+
const require_agent_https = require("./agent-https-bnyFRK7Y.js");
|
|
35
|
+
const require_constants = require("./constants-CqbO6e9i.js");
|
|
36
36
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
37
37
|
require("./builtins/system-config/index.js");
|
|
38
38
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
39
39
|
const require_custom_action_registry = require("./custom-action-registry-MRyes5j0.js");
|
|
40
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao-
|
|
40
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-C174UDzO.js");
|
|
41
41
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
42
42
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
43
|
-
const require_restore_archive = require("./restore-archive-
|
|
43
|
+
const require_restore_archive = require("./restore-archive-B2jIFfu_.js");
|
|
44
44
|
const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
|
|
45
45
|
let zod = require("zod");
|
|
46
46
|
let node_crypto = require("node:crypto");
|
|
@@ -21789,7 +21789,7 @@ function toKebab(name) {
|
|
|
21789
21789
|
return name.replace(/[A-Z]/g, (m, i) => (i > 0 ? "-" : "") + m.toLowerCase());
|
|
21790
21790
|
}
|
|
21791
21791
|
/**
|
|
21792
|
-
* Parse an `op.path` (e.g. `"pipelineExecutor.
|
|
21792
|
+
* Parse an `op.path` (e.g. `"pipelineExecutor.getAvailableEngines"`) into
|
|
21793
21793
|
* the capability name (kebab-case) and the method name.
|
|
21794
21794
|
*/
|
|
21795
21795
|
function parsePath(path) {
|
|
@@ -22299,6 +22299,148 @@ function buildLinkChain(target, localResolver, hookup) {
|
|
|
22299
22299
|
return links;
|
|
22300
22300
|
}
|
|
22301
22301
|
//#endregion
|
|
22302
|
+
//#region src/kernel/hwaccel/vaapi-init-probe.ts
|
|
22303
|
+
/**
|
|
22304
|
+
* Can libva initialise the VA driver on this node's render node? (D926)
|
|
22305
|
+
*
|
|
22306
|
+
* Measured 2026-10-23 (intel-1.2.509, hub + little-unraid): Intel's iHD 25.2.4
|
|
22307
|
+
* exports only `__vaDriverInit_1_22`, the container's Ubuntu libva 2.20 looks
|
|
22308
|
+
* for `_1_20`, and `vaInitialize` failed — while the resolver kept offering
|
|
22309
|
+
* `qsv, vaapi`. Every session tried, failed and fell back to software: 722
|
|
22310
|
+
* `hwaccel 'vaapi' failed` lines a day and nothing that named the cause.
|
|
22311
|
+
*
|
|
22312
|
+
* One `vainfo --display drm --device <node>` per process answers it. A failure
|
|
22313
|
+
* reads the driver's exported `__vaDriverInit_1_N` so the verdict names the gap
|
|
22314
|
+
* (`driver iHD needs VA-API >= 1.22, libva has 1.20`). No `vainfo` on the host
|
|
22315
|
+
* (a bare install) is `unknown` — the resolver then behaves as it always did.
|
|
22316
|
+
*/
|
|
22317
|
+
var VAINFO_TIMEOUT_MS = 1e4;
|
|
22318
|
+
var INIT_SYMBOL = /__vaDriverInit_(\d+)_(\d+)/g;
|
|
22319
|
+
var VA_API_VERSION = /VA-API version:? (\d+)\.(\d+)/;
|
|
22320
|
+
var DRIVER_OPEN = /Trying to open (\S+_drv_video\.so)/g;
|
|
22321
|
+
function newestInitVersion(symbols) {
|
|
22322
|
+
let best = null;
|
|
22323
|
+
for (const symbol of symbols) for (const m of symbol.matchAll(INIT_SYMBOL)) {
|
|
22324
|
+
const v = {
|
|
22325
|
+
major: Number(m[1]),
|
|
22326
|
+
minor: Number(m[2])
|
|
22327
|
+
};
|
|
22328
|
+
if (!best || v.major > best.major || v.major === best.major && v.minor > best.minor) best = v;
|
|
22329
|
+
}
|
|
22330
|
+
return best;
|
|
22331
|
+
}
|
|
22332
|
+
function lastMatch(text, re) {
|
|
22333
|
+
let last = null;
|
|
22334
|
+
for (const m of text.matchAll(re)) last = m[1] ?? null;
|
|
22335
|
+
return last;
|
|
22336
|
+
}
|
|
22337
|
+
function lastLine(text) {
|
|
22338
|
+
const lines = text.split("\n").map((l) => l.trim()).filter((l) => l.length > 0);
|
|
22339
|
+
return lines[lines.length - 1] ?? "no output";
|
|
22340
|
+
}
|
|
22341
|
+
function driverName(driverPath) {
|
|
22342
|
+
if (!driverPath) return "unknown";
|
|
22343
|
+
return (0, node_path.basename)(driverPath).replace(/_drv_video\.so$/, "");
|
|
22344
|
+
}
|
|
22345
|
+
/** Classify one vainfo run plus the driver's exported init symbols. Pure. */
|
|
22346
|
+
function classifyVainfo(run, driverSymbols) {
|
|
22347
|
+
const va = VA_API_VERSION.exec(run.output);
|
|
22348
|
+
const vaApiVersion = va ? `${va[1]}.${va[2]}` : null;
|
|
22349
|
+
const driverPath = lastMatch(run.output, DRIVER_OPEN);
|
|
22350
|
+
const needs = newestInitVersion(driverSymbols);
|
|
22351
|
+
const driverNeedsVaApi = needs ? `${needs.major}.${needs.minor}` : null;
|
|
22352
|
+
const base = {
|
|
22353
|
+
vaApiVersion,
|
|
22354
|
+
driverPath,
|
|
22355
|
+
driverNeedsVaApi
|
|
22356
|
+
};
|
|
22357
|
+
if (run.spawnError !== null) return {
|
|
22358
|
+
...base,
|
|
22359
|
+
state: "unknown",
|
|
22360
|
+
summary: `vaapi: unknown (vainfo not run: ${run.spawnError})`
|
|
22361
|
+
};
|
|
22362
|
+
if (run.exitCode === 0) return {
|
|
22363
|
+
...base,
|
|
22364
|
+
state: "ok",
|
|
22365
|
+
summary: `vaapi: ok (VA-API ${vaApiVersion ?? "?"}, driver ${driverName(driverPath)})`
|
|
22366
|
+
};
|
|
22367
|
+
const reason = needs !== null && va !== null && (needs.major > Number(va[1]) || needs.major === Number(va[1]) && needs.minor > Number(va[2])) ? `driver ${driverName(driverPath)} needs VA-API >= ${driverNeedsVaApi}, libva has ${vaApiVersion}` : lastLine(run.output);
|
|
22368
|
+
return {
|
|
22369
|
+
...base,
|
|
22370
|
+
state: "init-failed",
|
|
22371
|
+
summary: `vaapi: init-failed (${reason})`
|
|
22372
|
+
};
|
|
22373
|
+
}
|
|
22374
|
+
/** Run `vainfo` against one render node; never throws. */
|
|
22375
|
+
function runVainfo(renderNode) {
|
|
22376
|
+
return new Promise((resolve) => {
|
|
22377
|
+
(0, node_child_process.execFile)("vainfo", [
|
|
22378
|
+
"--display",
|
|
22379
|
+
"drm",
|
|
22380
|
+
"--device",
|
|
22381
|
+
renderNode
|
|
22382
|
+
], {
|
|
22383
|
+
timeout: VAINFO_TIMEOUT_MS,
|
|
22384
|
+
encoding: "utf8"
|
|
22385
|
+
}, (err, stdout, stderr) => {
|
|
22386
|
+
const output = `${stdout}\n${stderr}`;
|
|
22387
|
+
if (err === null) {
|
|
22388
|
+
resolve({
|
|
22389
|
+
exitCode: 0,
|
|
22390
|
+
output,
|
|
22391
|
+
spawnError: null
|
|
22392
|
+
});
|
|
22393
|
+
return;
|
|
22394
|
+
}
|
|
22395
|
+
const code = err.code;
|
|
22396
|
+
if (typeof code === "number") {
|
|
22397
|
+
resolve({
|
|
22398
|
+
exitCode: code,
|
|
22399
|
+
output,
|
|
22400
|
+
spawnError: null
|
|
22401
|
+
});
|
|
22402
|
+
return;
|
|
22403
|
+
}
|
|
22404
|
+
resolve({
|
|
22405
|
+
exitCode: null,
|
|
22406
|
+
output,
|
|
22407
|
+
spawnError: code ?? (err.killed ? "timeout" : err.message)
|
|
22408
|
+
});
|
|
22409
|
+
});
|
|
22410
|
+
});
|
|
22411
|
+
}
|
|
22412
|
+
/**
|
|
22413
|
+
* The `__vaDriverInit_N_M` names in a driver file, streamed (iHD is ~43 MB),
|
|
22414
|
+
* with an overlap so a name split across two chunks is still found.
|
|
22415
|
+
*/
|
|
22416
|
+
function readDriverInitSymbols(driverPath) {
|
|
22417
|
+
return new Promise((resolve) => {
|
|
22418
|
+
const found = /* @__PURE__ */ new Set();
|
|
22419
|
+
let carry = "";
|
|
22420
|
+
const stream = (0, node_fs.createReadStream)(driverPath, {
|
|
22421
|
+
encoding: "latin1",
|
|
22422
|
+
highWaterMark: 64 * 1024
|
|
22423
|
+
});
|
|
22424
|
+
stream.on("data", (chunk) => {
|
|
22425
|
+
const text = carry + String(chunk);
|
|
22426
|
+
for (const m of text.matchAll(INIT_SYMBOL)) if (m.index + m[0].length < text.length) found.add(m[0]);
|
|
22427
|
+
carry = text.slice(-32);
|
|
22428
|
+
});
|
|
22429
|
+
stream.on("error", () => resolve([]));
|
|
22430
|
+
stream.on("end", () => {
|
|
22431
|
+
for (const m of carry.matchAll(INIT_SYMBOL)) found.add(m[0]);
|
|
22432
|
+
resolve([...found].sort());
|
|
22433
|
+
});
|
|
22434
|
+
});
|
|
22435
|
+
}
|
|
22436
|
+
/** Probe one render node: vainfo, and on failure the driver's init symbols. */
|
|
22437
|
+
async function probeVaapiInit(renderNode) {
|
|
22438
|
+
const run = await runVainfo(renderNode);
|
|
22439
|
+
if (run.spawnError !== null || run.exitCode === 0) return classifyVainfo(run, []);
|
|
22440
|
+
const driverPath = lastMatch(run.output, DRIVER_OPEN);
|
|
22441
|
+
return classifyVainfo(run, driverPath ? await readDriverInitSymbols(driverPath) : []);
|
|
22442
|
+
}
|
|
22443
|
+
//#endregion
|
|
22302
22444
|
//#region src/kernel/hwaccel/hwaccel-resolver.ts
|
|
22303
22445
|
/**
|
|
22304
22446
|
* Platform-probe for hardware video decode acceleration.
|
|
@@ -22368,7 +22510,23 @@ function probePlatform() {
|
|
|
22368
22510
|
coral: require_coral_accelerators.classifyCoralAccelerator(require_coral_accelerators.nodeCoralFs)
|
|
22369
22511
|
};
|
|
22370
22512
|
}
|
|
22371
|
-
|
|
22513
|
+
/** The backends that open their device through libva on Linux. */
|
|
22514
|
+
var LIBVA_BACKENDS = ["vaapi", "qsv"];
|
|
22515
|
+
/**
|
|
22516
|
+
* The preference list for these signals. A `vaapi` verdict of `init-failed`
|
|
22517
|
+
* (libva cannot initialise the driver — D926) removes every libva-backed
|
|
22518
|
+
* backend and names the cause in the rationale; `ok`, `unknown` or `null`
|
|
22519
|
+
* change nothing.
|
|
22520
|
+
*/
|
|
22521
|
+
function pickBackendsForPlatform(signals, vaapi = null) {
|
|
22522
|
+
const res = pickBackendsFromSignals(signals);
|
|
22523
|
+
if (signals.platform !== "linux" || vaapi?.state !== "init-failed") return res;
|
|
22524
|
+
return {
|
|
22525
|
+
preferred: res.preferred.filter((b) => !LIBVA_BACKENDS.includes(b)),
|
|
22526
|
+
rationale: `${res.rationale} ${vaapi.summary} — vaapi/qsv withheld, decode runs in software.`
|
|
22527
|
+
};
|
|
22528
|
+
}
|
|
22529
|
+
function pickBackendsFromSignals(signals) {
|
|
22372
22530
|
switch (signals.platform) {
|
|
22373
22531
|
case "darwin": return {
|
|
22374
22532
|
preferred: ["videotoolbox"],
|
|
@@ -22429,13 +22587,49 @@ function resolveHwAccel(prefer) {
|
|
|
22429
22587
|
};
|
|
22430
22588
|
return pickBackendsForPlatform(probePlatform());
|
|
22431
22589
|
}
|
|
22590
|
+
var RENDER_NODE = "/dev/dri/renderD128";
|
|
22591
|
+
/** Process-wide: the VA init failure is logged once per process, not per resolver. */
|
|
22592
|
+
var PROCESS_VAAPI_REPORT = { reported: false };
|
|
22593
|
+
/** Process-wide: hub-main builds one resolver per in-process addon; vainfo runs once. */
|
|
22594
|
+
var PROCESS_VAAPI_PROBES = /* @__PURE__ */ new Map();
|
|
22595
|
+
function probeVaapiOncePerProcess(renderNode) {
|
|
22596
|
+
const known = PROCESS_VAAPI_PROBES.get(renderNode);
|
|
22597
|
+
if (known) return known;
|
|
22598
|
+
const probe = probeVaapiInit(renderNode);
|
|
22599
|
+
PROCESS_VAAPI_PROBES.set(renderNode, probe);
|
|
22600
|
+
return probe;
|
|
22601
|
+
}
|
|
22432
22602
|
/**
|
|
22433
22603
|
* Build the `IKernelHwAccel` provider used to populate `ctx.kernel.hwaccel`.
|
|
22434
|
-
*
|
|
22435
|
-
*
|
|
22436
|
-
|
|
22437
|
-
|
|
22438
|
-
|
|
22604
|
+
* An auto resolve on a Linux host with a render node asks libva ONCE per
|
|
22605
|
+
* provider whether it can initialise the driver (D926); an explicit override
|
|
22606
|
+
* is never second-guessed.
|
|
22607
|
+
*/
|
|
22608
|
+
function createKernelHwAccel(options = {}) {
|
|
22609
|
+
const probeSignals = options.probeSignals ?? probePlatform;
|
|
22610
|
+
const probeVaapi = options.probeVaapi ?? probeVaapiOncePerProcess;
|
|
22611
|
+
const reportOnce = options.reportOnce ?? PROCESS_VAAPI_REPORT;
|
|
22612
|
+
let vaapi = null;
|
|
22613
|
+
const vaapiVerdict = async () => {
|
|
22614
|
+
if (vaapi === null) vaapi = probeVaapi(RENDER_NODE);
|
|
22615
|
+
const status = await vaapi;
|
|
22616
|
+
if (status.state === "init-failed" && !reportOnce.reported) {
|
|
22617
|
+
reportOnce.reported = true;
|
|
22618
|
+
options.logger?.error(`hwaccel: ${status.summary} — vaapi/qsv withheld, decode runs in software`, { meta: {
|
|
22619
|
+
renderNode: RENDER_NODE,
|
|
22620
|
+
vaApiVersion: status.vaApiVersion,
|
|
22621
|
+
driverPath: status.driverPath,
|
|
22622
|
+
driverNeedsVaApi: status.driverNeedsVaApi
|
|
22623
|
+
} });
|
|
22624
|
+
}
|
|
22625
|
+
return status;
|
|
22626
|
+
};
|
|
22627
|
+
return { resolve: async (prefer) => {
|
|
22628
|
+
if (prefer === "none" || prefer !== null && prefer !== void 0 && prefer.length > 0) return resolveHwAccel(prefer);
|
|
22629
|
+
const signals = probeSignals();
|
|
22630
|
+
if (signals.platform !== "linux" || !signals.hasRenderNode) return pickBackendsForPlatform(signals);
|
|
22631
|
+
return pickBackendsForPlatform(signals, await vaapiVerdict());
|
|
22632
|
+
} };
|
|
22439
22633
|
}
|
|
22440
22634
|
//#endregion
|
|
22441
22635
|
//#region src/kernel/inference/inference-resolver.ts
|
|
@@ -23828,7 +24022,7 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
23828
24022
|
value
|
|
23829
24023
|
})
|
|
23830
24024
|
};
|
|
23831
|
-
const hwaccel = createKernelHwAccel();
|
|
24025
|
+
const hwaccel = createKernelHwAccel({ logger: scopedLogger });
|
|
23832
24026
|
const inferenceEngine = createKernelInferenceEngine();
|
|
23833
24027
|
return {
|
|
23834
24028
|
localNodeId: nodeId,
|
|
@@ -25874,6 +26068,7 @@ function releaseRunnerGroup(pgid) {
|
|
|
25874
26068
|
* Returns how many groups were signalled.
|
|
25875
26069
|
*/
|
|
25876
26070
|
function signalAllRunnerGroups(signal) {
|
|
26071
|
+
beginRunnerShutdown();
|
|
25877
26072
|
let signalled = 0;
|
|
25878
26073
|
for (const [pgid, group] of ownedGroups) try {
|
|
25879
26074
|
group.kill(-pgid, signal);
|
|
@@ -25881,6 +26076,21 @@ function signalAllRunnerGroups(signal) {
|
|
|
25881
26076
|
} catch {}
|
|
25882
26077
|
return signalled;
|
|
25883
26078
|
}
|
|
26079
|
+
/**
|
|
26080
|
+
* Set once this process has begun an ORDERLY shutdown (hub-main's SIGTERM/SIGINT
|
|
26081
|
+
* handler, through {@link signalAllRunnerGroups}, which signals every runner
|
|
26082
|
+
* BEFORE the broker stops the process service). A runner that exits after this point is part of the
|
|
26083
|
+
* shutdown, not a crash: its exit is INFO and it is never respawned. Without it
|
|
26084
|
+
* a clean hub stop logged `ERROR Process exited (code=0)` once per runner and
|
|
26085
|
+
* scheduled a respawn into the dying node (CT200, 2026-10-23).
|
|
26086
|
+
*/
|
|
26087
|
+
var runnerShutdownInProgress = false;
|
|
26088
|
+
function beginRunnerShutdown() {
|
|
26089
|
+
runnerShutdownInProgress = true;
|
|
26090
|
+
}
|
|
26091
|
+
function isRunnerShutdownInProgress() {
|
|
26092
|
+
return runnerShutdownInProgress;
|
|
26093
|
+
}
|
|
25884
26094
|
//#endregion
|
|
25885
26095
|
//#region src/kernel/moleculer/process-service.ts
|
|
25886
26096
|
/**
|
|
@@ -26118,6 +26328,12 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26118
26328
|
console.error(`[process-service EXIT] runner=${runnerId} code=${String(code)} signal=${String(signal)} state=${entry.state}`);
|
|
26119
26329
|
const groupReap = reapRunnerGroup(entry);
|
|
26120
26330
|
if (entry.state === "stopped") return;
|
|
26331
|
+
if (isRunnerShutdownInProgress()) {
|
|
26332
|
+
entry.state = "stopped";
|
|
26333
|
+
emitStateChange(entry);
|
|
26334
|
+
capturedBroker?.logger.info(`[${runnerId}] Process exited during shutdown (code=${code}, signal=${signal})`, { tags: { runnerId } });
|
|
26335
|
+
return;
|
|
26336
|
+
}
|
|
26121
26337
|
const announced = entry.announcedRefusal;
|
|
26122
26338
|
entry.announcedRefusal = null;
|
|
26123
26339
|
if (code === 78) {
|
|
@@ -26145,7 +26361,9 @@ function createProcessService(parentNodeId, dataDir, deps, parentTcpPort, parent
|
|
|
26145
26361
|
}
|
|
26146
26362
|
entry.state = "crashed";
|
|
26147
26363
|
emitStateChange(entry);
|
|
26148
|
-
|
|
26364
|
+
const exitLine = `[${runnerId}] Process exited (code=${code}, signal=${signal})`;
|
|
26365
|
+
if (code === 0 && signal === null) capturedBroker?.logger.warn(`${exitLine} — unexpected clean exit, respawning`, { tags: { runnerId } });
|
|
26366
|
+
else capturedBroker?.logger.error(exitLine, { tags: { runnerId } });
|
|
26149
26367
|
const decision = crashSupervisor.recordCrash(runnerId);
|
|
26150
26368
|
emitRunnerEvent(require_dist.EventCategory.ProcessCrashed, runnerId, {
|
|
26151
26369
|
processId: runnerId,
|