signalk-container-helper 0.1.0
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/LICENSE +201 -0
- package/README.md +288 -0
- package/SPEC.md +309 -0
- package/dist/adopted-container.d.ts +55 -0
- package/dist/adopted-container.d.ts.map +1 -0
- package/dist/adopted-container.js +76 -0
- package/dist/adopted-container.js.map +1 -0
- package/dist/http.d.ts +66 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +76 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/managed-container.d.ts +203 -0
- package/dist/managed-container.d.ts.map +1 -0
- package/dist/managed-container.js +397 -0
- package/dist/managed-container.js.map +1 -0
- package/dist/manager.d.ts +44 -0
- package/dist/manager.d.ts.map +1 -0
- package/dist/manager.js +50 -0
- package/dist/manager.js.map +1 -0
- package/dist/types.d.ts +493 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +20 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +36 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +56 -0
- package/dist/util.js.map +1 -0
- package/dist/version-source.d.ts +23 -0
- package/dist/version-source.d.ts.map +1 -0
- package/dist/version-source.js +12 -0
- package/dist/version-source.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ContainerManagerApi, ContainerRuntimeInfo } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read the cross-plugin manager global. signalk-container publishes its API
|
|
4
|
+
* on `globalThis` (each plugin only gets a shallow copy of `app`, so `app`
|
|
5
|
+
* properties don't cross plugin boundaries). Returns undefined until
|
|
6
|
+
* signalk-container's start() has run, or when it is disabled/uninstalled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getContainerManager(): ContainerManagerApi | undefined;
|
|
9
|
+
export interface WaitForManagerOptions {
|
|
10
|
+
/** Overall deadline for both phases. Default 60_000. */
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
/** Poll interval while the global is absent. Default 500. */
|
|
13
|
+
intervalMs?: number;
|
|
14
|
+
/** Progress callback, e.g. to update the plugin status line per phase. */
|
|
15
|
+
onWaiting?: (phase: "manager" | "runtime") => void;
|
|
16
|
+
}
|
|
17
|
+
export interface ManagerWaitResult {
|
|
18
|
+
/**
|
|
19
|
+
* The manager global, or undefined if signalk-container never appeared
|
|
20
|
+
* within the deadline (not installed / not enabled).
|
|
21
|
+
*/
|
|
22
|
+
manager: ContainerManagerApi | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Detected runtime, or null when detection failed or hasn't settled —
|
|
25
|
+
* `manager && !runtime` means "signalk-container is present but found no
|
|
26
|
+
* usable podman/docker", which deserves a different error message than a
|
|
27
|
+
* missing manager.
|
|
28
|
+
*/
|
|
29
|
+
runtime: ContainerRuntimeInfo | null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Two-phase wait for a usable container manager:
|
|
33
|
+
*
|
|
34
|
+
* 1. Poll `globalThis.__signalk_containerManager` — plugins start in
|
|
35
|
+
* alphabetical order, so consumers loading before signalk-container see
|
|
36
|
+
* undefined for a while.
|
|
37
|
+
* 2. Wait for runtime detection to settle: `whenReady()` when available
|
|
38
|
+
* (signalk-container 1.6.0+), otherwise poll `getRuntime()`. whenReady
|
|
39
|
+
* resolves on success OR failure, so the runtime is re-checked after.
|
|
40
|
+
*
|
|
41
|
+
* Never throws; inspect the result to pick the right error message.
|
|
42
|
+
*/
|
|
43
|
+
export declare function waitForContainerManager(options?: WaitForManagerOptions): Promise<ManagerWaitResult>;
|
|
44
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAG5E;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,mBAAmB,GAAG,SAAS,CAErE;AAED,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACzC;;;;;OAKG;IACH,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,iBAAiB,CAAC,CA4B5B"}
|
package/dist/manager.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { sleep } from "./util.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read the cross-plugin manager global. signalk-container publishes its API
|
|
4
|
+
* on `globalThis` (each plugin only gets a shallow copy of `app`, so `app`
|
|
5
|
+
* properties don't cross plugin boundaries). Returns undefined until
|
|
6
|
+
* signalk-container's start() has run, or when it is disabled/uninstalled.
|
|
7
|
+
*/
|
|
8
|
+
export function getContainerManager() {
|
|
9
|
+
return globalThis.__signalk_containerManager;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Two-phase wait for a usable container manager:
|
|
13
|
+
*
|
|
14
|
+
* 1. Poll `globalThis.__signalk_containerManager` — plugins start in
|
|
15
|
+
* alphabetical order, so consumers loading before signalk-container see
|
|
16
|
+
* undefined for a while.
|
|
17
|
+
* 2. Wait for runtime detection to settle: `whenReady()` when available
|
|
18
|
+
* (signalk-container 1.6.0+), otherwise poll `getRuntime()`. whenReady
|
|
19
|
+
* resolves on success OR failure, so the runtime is re-checked after.
|
|
20
|
+
*
|
|
21
|
+
* Never throws; inspect the result to pick the right error message.
|
|
22
|
+
*/
|
|
23
|
+
export async function waitForContainerManager(options = {}) {
|
|
24
|
+
const { timeoutMs = 60_000, intervalMs = 500, onWaiting } = options;
|
|
25
|
+
const deadline = Date.now() + timeoutMs;
|
|
26
|
+
let manager = getContainerManager();
|
|
27
|
+
while (!manager && Date.now() < deadline) {
|
|
28
|
+
onWaiting?.("manager");
|
|
29
|
+
await sleep(intervalMs);
|
|
30
|
+
manager = getContainerManager();
|
|
31
|
+
}
|
|
32
|
+
if (!manager) {
|
|
33
|
+
return { manager: undefined, runtime: null };
|
|
34
|
+
}
|
|
35
|
+
if (!manager.getRuntime()) {
|
|
36
|
+
onWaiting?.("runtime");
|
|
37
|
+
if (typeof manager.whenReady === "function") {
|
|
38
|
+
const remaining = Math.max(0, deadline - Date.now());
|
|
39
|
+
await Promise.race([manager.whenReady(), sleep(remaining)]);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
// Pre-1.6.0 fallback: poll until detection settles or the deadline hits.
|
|
43
|
+
while (!manager.getRuntime() && Date.now() < deadline) {
|
|
44
|
+
await sleep(intervalMs);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return { manager, runtime: manager.getRuntime() };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,0BAA0B,CAAC;AAC/C,CAAC;AA0BD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,UAAiC,EAAE;IAEnC,MAAM,EAAE,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
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical TypeScript mirror of signalk-container's public API surface.
|
|
3
|
+
*
|
|
4
|
+
* signalk-container is a runtime-only dependency: consumer plugins must NOT
|
|
5
|
+
* import it at compile time or declare it in npm dependencies/peerDependencies
|
|
6
|
+
* (its prerelease versioning breaks npm semver ranges). The coupling happens
|
|
7
|
+
* exclusively through `globalThis.__signalk_containerManager`, declared at the
|
|
8
|
+
* bottom of this file. Declare the relationship in package.json instead:
|
|
9
|
+
*
|
|
10
|
+
* "signalk": { "requires": ["signalk-container"] }
|
|
11
|
+
*
|
|
12
|
+
* Source of truth: https://github.com/dirkwa/signalk-container
|
|
13
|
+
* (src/types.ts and src/updates/types.ts)
|
|
14
|
+
* Last synced against signalk-container: v1.22.0
|
|
15
|
+
* Supported baseline: v1.6.0 — members newer than the baseline are optional
|
|
16
|
+
* here so call sites are forced to feature-detect. Version floors are noted
|
|
17
|
+
* on each member.
|
|
18
|
+
*/
|
|
19
|
+
export type RuntimeName = "podman" | "docker";
|
|
20
|
+
export interface ContainerRuntimeInfo {
|
|
21
|
+
runtime: RuntimeName;
|
|
22
|
+
version: string;
|
|
23
|
+
/** @deprecated Always `false` since the move to the socket client. */
|
|
24
|
+
isPodmanDockerShim?: boolean;
|
|
25
|
+
/** cgroup v2 controllers available to this runtime; `null` = not probed. */
|
|
26
|
+
cgroupControllers?: string[] | null;
|
|
27
|
+
/** Whether the runtime operates rootless; `null` = not probed. */
|
|
28
|
+
isRootless?: boolean | null;
|
|
29
|
+
/** Effective host uid/gid of the Signal K process; `null` on Windows. */
|
|
30
|
+
hostUser?: {
|
|
31
|
+
uid: number;
|
|
32
|
+
gid: number;
|
|
33
|
+
} | null;
|
|
34
|
+
/** Unix socket the runtime client resolved to (diagnostic). */
|
|
35
|
+
socketPath?: string;
|
|
36
|
+
}
|
|
37
|
+
export type ContainerState = "running" | "stopped" | "missing" | "no-runtime";
|
|
38
|
+
/**
|
|
39
|
+
* Per-volume policy when the host source path is missing at create time.
|
|
40
|
+
* Named volumes (no leading `/` or `.`) always pass through.
|
|
41
|
+
*/
|
|
42
|
+
export interface VolumeSpec {
|
|
43
|
+
/** Host path or named-volume string — same shape as the bare-string form. */
|
|
44
|
+
source: string;
|
|
45
|
+
/**
|
|
46
|
+
* - `'create'` (default): runtime creates the host dir. Plugin state dirs.
|
|
47
|
+
* - `'skip'`: drop the mount when missing. Optional USB/NFS mounts.
|
|
48
|
+
* - `'abort'`: throw from ensureRunning. Required mounts (certs, secrets).
|
|
49
|
+
*/
|
|
50
|
+
ifMissing?: "create" | "skip" | "abort";
|
|
51
|
+
}
|
|
52
|
+
/** Event delivered to `EnsureRunningOptions.onVolumeIssue`. */
|
|
53
|
+
export interface VolumeIssue {
|
|
54
|
+
containerPath: string;
|
|
55
|
+
source: string;
|
|
56
|
+
action: "skipped" | "aborted" | "recovered";
|
|
57
|
+
reason: string;
|
|
58
|
+
}
|
|
59
|
+
/** Event delivered to `EnsureRunningOptions.onUlimitClamped` (1.17.0+). */
|
|
60
|
+
export interface UlimitClamp {
|
|
61
|
+
ulimit: string;
|
|
62
|
+
requested: number;
|
|
63
|
+
granted: number;
|
|
64
|
+
reason: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Explicit healthcheck for a managed container (config field is 1.14.0+;
|
|
68
|
+
* silently ignored by older versions). `false` emits `--no-healthcheck`.
|
|
69
|
+
*/
|
|
70
|
+
export type HealthcheckOverride = false | {
|
|
71
|
+
/** Docker HEALTHCHECK array form: ["CMD", ...] or ["CMD-SHELL", "<shell>"]. */
|
|
72
|
+
test: string[];
|
|
73
|
+
/** e.g. "30s" — durations are passed to the runtime verbatim. */
|
|
74
|
+
interval?: string;
|
|
75
|
+
timeout?: string;
|
|
76
|
+
/** Grace period before failures count, e.g. "15s". */
|
|
77
|
+
startPeriod?: string;
|
|
78
|
+
retries?: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Resource limits applied via podman/docker run flags. Omitted = no limit;
|
|
82
|
+
* `null` in a user override explicitly removes a plugin-set limit.
|
|
83
|
+
*/
|
|
84
|
+
export interface ContainerResourceLimits {
|
|
85
|
+
/** Hard CPU cap (CFS quota), e.g. 1.5 = 1.5 cores. */
|
|
86
|
+
cpus?: number | null;
|
|
87
|
+
/** Soft CPU weight under contention (default 1024). */
|
|
88
|
+
cpuShares?: number | null;
|
|
89
|
+
/** Pin to specific cores, e.g. "0,1" or "1-3". */
|
|
90
|
+
cpusetCpus?: string | null;
|
|
91
|
+
/** Hard memory cap, e.g. "512m", "2g". */
|
|
92
|
+
memory?: string | null;
|
|
93
|
+
/** Total memory + swap; set equal to `memory` to disable swap. */
|
|
94
|
+
memorySwap?: string | null;
|
|
95
|
+
/** Soft floor — kernel reclaims from containers above this first. */
|
|
96
|
+
memoryReservation?: string | null;
|
|
97
|
+
/** Process/thread cap. */
|
|
98
|
+
pidsLimit?: number | null;
|
|
99
|
+
/** OOM score adjustment, -1000..1000. Higher = killed first. */
|
|
100
|
+
oomScoreAdj?: number | null;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Declarative desired state for a managed container. Pass the same config to
|
|
104
|
+
* `ensureRunning` on every plugin start — signalk-container diffs it against
|
|
105
|
+
* the live container and removes + recreates when `image`, `tag`, `command`,
|
|
106
|
+
* `networkMode`, `env`, `volumes`, or `ports` differ. `restart`, `labels`,
|
|
107
|
+
* `healthcheck`, and `ulimits` are NOT part of drift detection.
|
|
108
|
+
*/
|
|
109
|
+
export interface ContainerConfig {
|
|
110
|
+
/** Image repo without tag, e.g. "ghcr.io/questdb/questdb". */
|
|
111
|
+
image: string;
|
|
112
|
+
tag: string;
|
|
113
|
+
/** Manifest digest ("sha256:<64-hex>"); pulls `image@digest` when set. */
|
|
114
|
+
digest?: string;
|
|
115
|
+
/** Update channel: "tag:<pattern>" | "tag:latest" | "digest:explicit". */
|
|
116
|
+
updateChannel?: string;
|
|
117
|
+
/**
|
|
118
|
+
* When true and `tag` is floating (latest/main/edge/…), every
|
|
119
|
+
* ensureRunning pulls and recreates on digest drift. Offline pull
|
|
120
|
+
* failures are silently skipped. 1.9.0+.
|
|
121
|
+
*/
|
|
122
|
+
autoUpdateOnFloatingTag?: boolean;
|
|
123
|
+
/** "containerPort/proto" → "hostIp:hostPort". Ignored with networkMode. */
|
|
124
|
+
ports?: Record<string, string>;
|
|
125
|
+
/** container path → host path | named volume | VolumeSpec. */
|
|
126
|
+
volumes?: Record<string, string | VolumeSpec>;
|
|
127
|
+
/**
|
|
128
|
+
* Mount the plugin's Signal K data dir (app.getDataDirPath()) at this
|
|
129
|
+
* container path; the host-side source is resolved automatically for
|
|
130
|
+
* bare-metal and containerized Signal K deployments.
|
|
131
|
+
*/
|
|
132
|
+
signalkDataMount?: string;
|
|
133
|
+
/** Mount the whole Signal K config root (~/.signalk) here. 1.5.0+. */
|
|
134
|
+
signalkConfigRootMount?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Container ports the Signal K process must reach back into; networking
|
|
137
|
+
* strategy is chosen automatically. Read the result with
|
|
138
|
+
* `resolveContainerAddress()` after `ensureRunning()`.
|
|
139
|
+
*/
|
|
140
|
+
signalkAccessiblePorts?: number[];
|
|
141
|
+
env?: Record<string, string>;
|
|
142
|
+
/** Defaults to "unless-stopped" when omitted. */
|
|
143
|
+
restart?: "no" | "unless-stopped" | "always";
|
|
144
|
+
/**
|
|
145
|
+
* Set consistently across calls: toggling between an explicit command and
|
|
146
|
+
* undefined looks like drift on every ensureRunning.
|
|
147
|
+
*/
|
|
148
|
+
command?: string[];
|
|
149
|
+
networkMode?: string;
|
|
150
|
+
/** hostname → IP (or "host-gateway") entries for /etc/hosts. */
|
|
151
|
+
extraHosts?: Record<string, string>;
|
|
152
|
+
/**
|
|
153
|
+
* Host-UID ownership mapping. Omit for the default (image runs as root,
|
|
154
|
+
* files on bind mounts owned by the Signal K user). Set
|
|
155
|
+
* `{ inImageUid, inImageGid }` when the image declares a non-root USER.
|
|
156
|
+
* `false` opts out entirely.
|
|
157
|
+
*/
|
|
158
|
+
user?: {
|
|
159
|
+
inImageUid?: number;
|
|
160
|
+
inImageGid?: number;
|
|
161
|
+
} | false;
|
|
162
|
+
/** Plugin-default resource limits; users override per-field. */
|
|
163
|
+
resources?: ContainerResourceLimits;
|
|
164
|
+
/**
|
|
165
|
+
* Per-process ulimits, e.g. `{ nofile: 1048576 }`. `nofile` is clamped
|
|
166
|
+
* to the host ceiling (see onUlimitClamped). 1.17.0+ (ignored earlier).
|
|
167
|
+
*/
|
|
168
|
+
ulimits?: Record<string, number | {
|
|
169
|
+
soft: number;
|
|
170
|
+
hard: number;
|
|
171
|
+
}>;
|
|
172
|
+
/** Informational labels (not drift-detected). */
|
|
173
|
+
labels?: Record<string, string>;
|
|
174
|
+
/** Explicit healthcheck override. 1.14.0+ (ignored earlier). */
|
|
175
|
+
healthcheck?: HealthcheckOverride;
|
|
176
|
+
}
|
|
177
|
+
export interface ContainerInfo {
|
|
178
|
+
/** Full name as the runtime sees it, e.g. "sk-questdb". */
|
|
179
|
+
name: string;
|
|
180
|
+
/**
|
|
181
|
+
* `name` with the namespace prefix removed, e.g. "questdb" — the form
|
|
182
|
+
* consumer plugins pass to ensureRunning. The namespace is "sk" only by
|
|
183
|
+
* default (configurable via SIGNALK_CONTAINER_NAMESPACE), so this is the
|
|
184
|
+
* only reliable key for matching a container by its unprefixed name.
|
|
185
|
+
* Present in every signalk-container that supports namespacing; when
|
|
186
|
+
* absent (a very old version), fall back to a namespace-agnostic
|
|
187
|
+
* name-suffix match rather than assuming an "sk-" prefix.
|
|
188
|
+
*/
|
|
189
|
+
unprefixedName?: string;
|
|
190
|
+
image: string;
|
|
191
|
+
state: ContainerState;
|
|
192
|
+
created?: string;
|
|
193
|
+
/** e.g. ["127.0.0.1:3010->3010/tcp"] */
|
|
194
|
+
ports?: string[];
|
|
195
|
+
managedBy?: string;
|
|
196
|
+
}
|
|
197
|
+
/** Options bag accepted by `ensureRunning` / `recreate`. */
|
|
198
|
+
export interface EnsureRunningOptions {
|
|
199
|
+
/** Custom app-level health probe (legacy HealthCheckOptions). */
|
|
200
|
+
healthCheck?: () => Promise<boolean>;
|
|
201
|
+
onUnhealthy?: (name: string, error: string) => void;
|
|
202
|
+
/** Fires for volume skip/abort/recovery events. Never awaited. */
|
|
203
|
+
onVolumeIssue?: (event: VolumeIssue) => void | Promise<void>;
|
|
204
|
+
/** Stream the container's stdout/stderr lines (1.7.0+). Never awaited. */
|
|
205
|
+
onContainerLog?: (line: string) => void | Promise<void>;
|
|
206
|
+
/** Backfill the last N lines when (re)attaching the log stream. */
|
|
207
|
+
onContainerLogStartTail?: number;
|
|
208
|
+
/** Fired when a requested ulimit was lowered to the host ceiling (1.17.0+). */
|
|
209
|
+
onUlimitClamped?: (event: UlimitClamp) => void;
|
|
210
|
+
/** npm package name — opt-in to digest pinning manifests. */
|
|
211
|
+
pluginId?: string;
|
|
212
|
+
pluginVersion?: string;
|
|
213
|
+
}
|
|
214
|
+
export interface ContainerJobConfig {
|
|
215
|
+
image: string;
|
|
216
|
+
command: string[];
|
|
217
|
+
/** Override the image's baked ENTRYPOINT. */
|
|
218
|
+
entrypoint?: string[];
|
|
219
|
+
/** container path → host path, mounted read-only. */
|
|
220
|
+
inputs?: Record<string, string>;
|
|
221
|
+
/** container path → host path, mounted read-write. */
|
|
222
|
+
outputs?: Record<string, string>;
|
|
223
|
+
env?: Record<string, string>;
|
|
224
|
+
/** Seconds. */
|
|
225
|
+
timeout?: number;
|
|
226
|
+
onProgress?: (msg: string) => void;
|
|
227
|
+
onStdoutLine?: (line: string) => void;
|
|
228
|
+
onStderrLine?: (line: string) => void;
|
|
229
|
+
resources?: ContainerResourceLimits;
|
|
230
|
+
label?: string;
|
|
231
|
+
/** Strongly recommended: enables cleanupOrphanedJobs reaping (1.3.0+). */
|
|
232
|
+
ownerPluginId?: string;
|
|
233
|
+
user?: {
|
|
234
|
+
inImageUid?: number;
|
|
235
|
+
inImageGid?: number;
|
|
236
|
+
} | false;
|
|
237
|
+
/** Cancel mid-run; resolves with status "cancelled" (1.16.0+). */
|
|
238
|
+
signal?: AbortSignal;
|
|
239
|
+
}
|
|
240
|
+
export type ContainerJobStatus = "pending" | "pulling" | "running" | "completed" | "failed" | "cancelled";
|
|
241
|
+
export interface ContainerJobResult {
|
|
242
|
+
id: string;
|
|
243
|
+
status: ContainerJobStatus;
|
|
244
|
+
image: string;
|
|
245
|
+
command: string[];
|
|
246
|
+
label?: string;
|
|
247
|
+
exitCode?: number;
|
|
248
|
+
log: string[];
|
|
249
|
+
error?: string;
|
|
250
|
+
createdAt: string;
|
|
251
|
+
startedAt?: string;
|
|
252
|
+
completedAt?: string;
|
|
253
|
+
runtime?: RuntimeName;
|
|
254
|
+
}
|
|
255
|
+
export interface PruneResult {
|
|
256
|
+
imagesRemoved: number;
|
|
257
|
+
spaceReclaimed: string;
|
|
258
|
+
}
|
|
259
|
+
export interface OrphanJobInfo {
|
|
260
|
+
name: string;
|
|
261
|
+
image: string;
|
|
262
|
+
ownerPluginId: string;
|
|
263
|
+
label?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface CleanupOrphansResult {
|
|
266
|
+
reaped: OrphanJobInfo[];
|
|
267
|
+
}
|
|
268
|
+
export interface UpdateResourcesResult {
|
|
269
|
+
method: "live" | "recreated";
|
|
270
|
+
warnings?: string[];
|
|
271
|
+
}
|
|
272
|
+
export type VersionSourceResult = {
|
|
273
|
+
kind: "version";
|
|
274
|
+
latest: string;
|
|
275
|
+
metadata?: Record<string, unknown>;
|
|
276
|
+
} | {
|
|
277
|
+
kind: "digest";
|
|
278
|
+
remoteDigest: string;
|
|
279
|
+
} | {
|
|
280
|
+
kind: "error";
|
|
281
|
+
error: string;
|
|
282
|
+
};
|
|
283
|
+
/** Pluggable "latest available version" strategy. Built via `updates.sources`. */
|
|
284
|
+
export interface VersionSource {
|
|
285
|
+
fetch(runtime: ContainerRuntimeInfo): Promise<VersionSourceResult>;
|
|
286
|
+
}
|
|
287
|
+
export interface UpdateRegistration {
|
|
288
|
+
/** Registration key — your plugin id. */
|
|
289
|
+
pluginId: string;
|
|
290
|
+
/** Container name as passed to ensureRunning (unprefixed). */
|
|
291
|
+
containerName: string;
|
|
292
|
+
/** Image repo without tag. */
|
|
293
|
+
image: string;
|
|
294
|
+
/**
|
|
295
|
+
* MUST be a function (not a captured value) so live config edits are
|
|
296
|
+
* picked up without re-registering.
|
|
297
|
+
*/
|
|
298
|
+
currentTag: () => string;
|
|
299
|
+
versionSource: VersionSource;
|
|
300
|
+
/**
|
|
301
|
+
* Query the running container for its version directly; when non-null it
|
|
302
|
+
* takes precedence over currentTag() for the comparison.
|
|
303
|
+
*/
|
|
304
|
+
currentVersion?: () => Promise<string | null>;
|
|
305
|
+
/** e.g. "24h" (default), "1h" minimum. */
|
|
306
|
+
checkInterval?: string;
|
|
307
|
+
}
|
|
308
|
+
export type UpdateReason = "newer-version" | "digest-drift" | "older-than-pinned" | "up-to-date" | "offline" | "unknown" | "error";
|
|
309
|
+
export type TagKind = "semver" | "floating" | "unknown";
|
|
310
|
+
export interface UpdateCheckResult {
|
|
311
|
+
pluginId: string;
|
|
312
|
+
containerName: string;
|
|
313
|
+
runningTag: string;
|
|
314
|
+
tagKind: TagKind;
|
|
315
|
+
currentVersion: string | null;
|
|
316
|
+
latestVersion: string | null;
|
|
317
|
+
updateAvailable: boolean;
|
|
318
|
+
reason: UpdateReason;
|
|
319
|
+
error?: string;
|
|
320
|
+
checkedAt: string;
|
|
321
|
+
lastSuccessfulCheckAt: string | null;
|
|
322
|
+
/** True when reason === "offline" and cached data was returned. */
|
|
323
|
+
fromCache: boolean;
|
|
324
|
+
}
|
|
325
|
+
export interface UpdateServiceApi {
|
|
326
|
+
register(reg: UpdateRegistration): void;
|
|
327
|
+
unregister(pluginId: string): void;
|
|
328
|
+
checkOne(pluginId: string): Promise<UpdateCheckResult>;
|
|
329
|
+
checkAll(): Promise<UpdateCheckResult[]>;
|
|
330
|
+
getLastResult(pluginId: string): UpdateCheckResult | null;
|
|
331
|
+
sources: {
|
|
332
|
+
githubReleases(repo: string, options?: {
|
|
333
|
+
allowPrerelease?: boolean;
|
|
334
|
+
tagPrefix?: string;
|
|
335
|
+
token?: string;
|
|
336
|
+
}): VersionSource;
|
|
337
|
+
dockerHubTags(image: string, options?: {
|
|
338
|
+
filter?: (tag: string) => boolean;
|
|
339
|
+
}): VersionSource;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
export interface HistoryEntry {
|
|
343
|
+
ts: string;
|
|
344
|
+
from: string | null;
|
|
345
|
+
to: string;
|
|
346
|
+
reason: "plugin-install" | "plugin-update" | "user-pull" | "auto-update" | "manual-check";
|
|
347
|
+
triggeredBy?: string;
|
|
348
|
+
}
|
|
349
|
+
export interface ConsumerManifest {
|
|
350
|
+
schemaVersion: 1;
|
|
351
|
+
pluginId: string;
|
|
352
|
+
pluginVersion: string;
|
|
353
|
+
registeredAt: string;
|
|
354
|
+
containers: Record<string, {
|
|
355
|
+
image: string;
|
|
356
|
+
declaredTag: string;
|
|
357
|
+
declaredDigest: string | null;
|
|
358
|
+
resolvedDigest: string;
|
|
359
|
+
resolvedAt: string;
|
|
360
|
+
updateChannel: string;
|
|
361
|
+
history: HistoryEntry[];
|
|
362
|
+
}>;
|
|
363
|
+
}
|
|
364
|
+
export interface ManifestApi {
|
|
365
|
+
get(pluginId: string): Promise<ConsumerManifest | null>;
|
|
366
|
+
list(): Promise<ConsumerManifest[]>;
|
|
367
|
+
getContainerHistory(containerName: string): Promise<HistoryEntry[]>;
|
|
368
|
+
}
|
|
369
|
+
export type SelfDeploymentStatus = "ok" | "no-runtime" | "socket-unreachable" | "permission-denied" | "self-id-unresolved";
|
|
370
|
+
export interface SelfDeploymentResult {
|
|
371
|
+
status: SelfDeploymentStatus;
|
|
372
|
+
/** Copy-pasteable remediation lines for failure statuses. */
|
|
373
|
+
remediation?: string[];
|
|
374
|
+
[key: string]: unknown;
|
|
375
|
+
}
|
|
376
|
+
export interface SetupSnippetResult {
|
|
377
|
+
snippet: string;
|
|
378
|
+
dockerfile?: string;
|
|
379
|
+
notes?: string[];
|
|
380
|
+
}
|
|
381
|
+
export interface DoctorApi {
|
|
382
|
+
/** Probe an image under the host-UID mapping. Never throws (1.8.0+). */
|
|
383
|
+
imageRunsAsUser(image: string, user?: {
|
|
384
|
+
inImageUid?: number;
|
|
385
|
+
inImageGid?: number;
|
|
386
|
+
} | false): Promise<{
|
|
387
|
+
ok: boolean;
|
|
388
|
+
output: string;
|
|
389
|
+
error?: string;
|
|
390
|
+
}>;
|
|
391
|
+
/** Diagnose the Signal K deployment itself. Never throws (1.9.0+). */
|
|
392
|
+
selfDeployment(): Promise<SelfDeploymentResult>;
|
|
393
|
+
/** Templated compose/run snippet for socket wiring (1.10.0+). */
|
|
394
|
+
generateSetupSnippet(format?: "compose" | "run", result?: SelfDeploymentResult): Promise<SetupSnippetResult>;
|
|
395
|
+
}
|
|
396
|
+
export interface ContainerManagerApi {
|
|
397
|
+
/** Detected runtime, or null while detection is in flight / failed. */
|
|
398
|
+
getRuntime(): ContainerRuntimeInfo | null;
|
|
399
|
+
/**
|
|
400
|
+
* Resolves once runtime detection settles (success OR failure) — re-check
|
|
401
|
+
* `getRuntime()` afterwards to tell the two apart. 1.6.0+.
|
|
402
|
+
*/
|
|
403
|
+
whenReady(): Promise<void>;
|
|
404
|
+
/** `image` is the joined "repo:tag" form here (unlike ContainerConfig). */
|
|
405
|
+
pullImage(image: string, onProgress?: (msg: string) => void): Promise<void>;
|
|
406
|
+
imageExists(image: string): Promise<boolean>;
|
|
407
|
+
/** Local sha256 image id for an image ref or container name. 1.6.0+. */
|
|
408
|
+
getImageDigest(imageOrContainer: string): Promise<string | null>;
|
|
409
|
+
/**
|
|
410
|
+
* Idempotent declarative reconcile: create+start if missing, start if
|
|
411
|
+
* stopped, remove+recreate on config drift.
|
|
412
|
+
*/
|
|
413
|
+
ensureRunning(name: string, config: ContainerConfig, options?: EnsureRunningOptions): Promise<void>;
|
|
414
|
+
/**
|
|
415
|
+
* Force-recreate regardless of drift detection ("update now", startup
|
|
416
|
+
* self-heal). 1.12.0+ — feature-detect.
|
|
417
|
+
*/
|
|
418
|
+
recreate?(name: string, config: ContainerConfig, options?: EnsureRunningOptions): Promise<void>;
|
|
419
|
+
start(name: string): Promise<void>;
|
|
420
|
+
/** Idempotent. */
|
|
421
|
+
stop(name: string): Promise<void>;
|
|
422
|
+
/** Stops and removes. Idempotent. */
|
|
423
|
+
remove(name: string): Promise<void>;
|
|
424
|
+
/**
|
|
425
|
+
* Remove a container AND its bind-mount data dir, handling the
|
|
426
|
+
* rootless-Podman subuid ownership trap. 1.18.0+ — feature-detect.
|
|
427
|
+
*/
|
|
428
|
+
removeManagedData?(name: string, hostPath: string, options?: {
|
|
429
|
+
ownerPluginId?: string;
|
|
430
|
+
}): Promise<void>;
|
|
431
|
+
getState(name: string): Promise<ContainerState>;
|
|
432
|
+
/** Lists managed (namespace-prefixed) containers. */
|
|
433
|
+
listContainers(): Promise<ContainerInfo[]>;
|
|
434
|
+
/** Live-update resource limits, falling back to recreate. */
|
|
435
|
+
updateResources(name: string, limits: ContainerResourceLimits): Promise<UpdateResourcesResult>;
|
|
436
|
+
/** Effective merged limits ({} when untracked). */
|
|
437
|
+
getResources(name: string): ContainerResourceLimits;
|
|
438
|
+
/**
|
|
439
|
+
* host:port (or container-name:port) for a port declared via
|
|
440
|
+
* `signalkAccessiblePorts`, after ensureRunning.
|
|
441
|
+
*/
|
|
442
|
+
resolveContainerAddress(containerName: string, containerPort: number): Promise<string | null>;
|
|
443
|
+
/** Host source backing app.getDataDirPath() in this deployment. */
|
|
444
|
+
resolveSignalkDataMount?(): Promise<string | null>;
|
|
445
|
+
/**
|
|
446
|
+
* Translate an absolute path to the (source, subPath) mountable by the
|
|
447
|
+
* host runtime. Null when unreachable. 1.7.0+ — feature-detect.
|
|
448
|
+
*/
|
|
449
|
+
resolveHostPath?(absPath: string): Promise<{
|
|
450
|
+
source: string;
|
|
451
|
+
subPath: string;
|
|
452
|
+
} | null>;
|
|
453
|
+
/** Run a one-shot helper container to completion. */
|
|
454
|
+
runJob(config: ContainerJobConfig): Promise<ContainerJobResult>;
|
|
455
|
+
/** Last N lines of combined stdout/stderr. 1.7.0+ — feature-detect. */
|
|
456
|
+
getLogs?(name: string, options?: {
|
|
457
|
+
tail?: number;
|
|
458
|
+
since?: number;
|
|
459
|
+
}): Promise<string[]>;
|
|
460
|
+
/** Reap sk-job-* containers leaked by a crash. 1.3.0+. */
|
|
461
|
+
cleanupOrphanedJobs(filter: {
|
|
462
|
+
ownerPluginId: string;
|
|
463
|
+
}): Promise<CleanupOrphansResult>;
|
|
464
|
+
prune(): Promise<PruneResult>;
|
|
465
|
+
execInContainer?(name: string, command: string[]): Promise<{
|
|
466
|
+
exitCode: number;
|
|
467
|
+
stdout: string;
|
|
468
|
+
stderr: string;
|
|
469
|
+
}>;
|
|
470
|
+
ensureNetwork?(name: string): Promise<void>;
|
|
471
|
+
removeNetwork?(name: string): Promise<void>;
|
|
472
|
+
connectToNetwork?(containerName: string, networkName: string): Promise<void>;
|
|
473
|
+
disconnectFromNetwork?(containerName: string, networkName: string): Promise<void>;
|
|
474
|
+
updates: UpdateServiceApi;
|
|
475
|
+
/** 1.13.0+ — feature-detect. */
|
|
476
|
+
manifest?: ManifestApi;
|
|
477
|
+
/** 1.8.0+ — feature-detect. */
|
|
478
|
+
doctor?: DoctorApi;
|
|
479
|
+
}
|
|
480
|
+
declare global {
|
|
481
|
+
var __signalk_containerManager: ContainerManagerApi | undefined;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Minimal slice of the Signal K plugin `app` object the helpers need.
|
|
485
|
+
* Status/error setters take ONE argument — the server pre-binds the plugin id.
|
|
486
|
+
*/
|
|
487
|
+
export interface AppLike {
|
|
488
|
+
debug: (msg: string) => void;
|
|
489
|
+
error?: (msg: string) => void;
|
|
490
|
+
setPluginStatus: (msg: string) => void;
|
|
491
|
+
setPluginError: (msg: string) => void;
|
|
492
|
+
}
|
|
493
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACpC,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/C,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;CACzC;AAED,+DAA+D;AAC/D,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,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AC/B,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,0BAA0B,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACjE;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical TypeScript mirror of signalk-container's public API surface.
|
|
3
|
+
*
|
|
4
|
+
* signalk-container is a runtime-only dependency: consumer plugins must NOT
|
|
5
|
+
* import it at compile time or declare it in npm dependencies/peerDependencies
|
|
6
|
+
* (its prerelease versioning breaks npm semver ranges). The coupling happens
|
|
7
|
+
* exclusively through `globalThis.__signalk_containerManager`, declared at the
|
|
8
|
+
* bottom of this file. Declare the relationship in package.json instead:
|
|
9
|
+
*
|
|
10
|
+
* "signalk": { "requires": ["signalk-container"] }
|
|
11
|
+
*
|
|
12
|
+
* Source of truth: https://github.com/dirkwa/signalk-container
|
|
13
|
+
* (src/types.ts and src/updates/types.ts)
|
|
14
|
+
* Last synced against signalk-container: v1.22.0
|
|
15
|
+
* Supported baseline: v1.6.0 — members newer than the baseline are optional
|
|
16
|
+
* here so call sites are forced to feature-detect. Version floors are noted
|
|
17
|
+
* on each member.
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|