@norskvideo/ctl-dev-kit 0.1.100 → 0.1.102
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.
|
@@ -32,6 +32,28 @@ support code that hits a studio/media port must route through a `TEST_HOST`
|
|
|
32
32
|
helper** (`process.env.NORSK_TEST_HOST ?? "localhost"`), never a hardcoded
|
|
33
33
|
`localhost`. Daemon/backend fetches stay on `localhost`.
|
|
34
34
|
|
|
35
|
+
### A studio host port binds loopback unless you ask otherwise
|
|
36
|
+
|
|
37
|
+
norsk-ctl gives the **`studio`** service's compose ports (`STUDIO_HOST_PORT`) an
|
|
38
|
+
explicit `127.0.0.1` bind at launch — docker publishes an unbound port on every
|
|
39
|
+
interface and its rules sit ahead of ufw. No other service's ports are touched.
|
|
40
|
+
|
|
41
|
+
A loopback bind is **unreachable via `host.docker.internal`**. So in the DooD
|
|
42
|
+
runner, one of these must hold:
|
|
43
|
+
|
|
44
|
+
- `NORSK_TEST_NET=direct` — the preferred answer, and what the canonical
|
|
45
|
+
`integration.yml` / `smoke.yml` / `build-docs.yml` topology step already sets.
|
|
46
|
+
Instances are reached by compose name on `norsk-net` at the **container** port,
|
|
47
|
+
so no host publish is involved at all.
|
|
48
|
+
- the launch passes `--publish-debug-ports`, restoring the old binding. The
|
|
49
|
+
shared `runProductSmoke` and demo drivers do this for you when the host they
|
|
50
|
+
fetch from is not loopback, and only after probing that the resolved ctl
|
|
51
|
+
advertises the flag (the CLI is `.strict()`, and a product pins a released ctl
|
|
52
|
+
independently of the harness). A product's own launch code must do both.
|
|
53
|
+
|
|
54
|
+
A harness reaching a studio port at `${NORSK_TEST_HOST}` while neither holds
|
|
55
|
+
will see every studio gate time out with connection refused.
|
|
56
|
+
|
|
35
57
|
## Host-shared working directory (or studio EACCESes on boot)
|
|
36
58
|
|
|
37
59
|
Studio bind-mounts its instance working directory as `${workdir}:/data` and runs
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// screen) added by FEATURE, not by a second copy of the skeleton.
|
|
11
11
|
//
|
|
12
12
|
// The convention layer is shared verbatim across every shape.
|
|
13
|
-
import { mkdirSync, writeFileSync } from "node:fs";
|
|
13
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { dirname, join } from "node:path";
|
|
15
15
|
import { type Canon, loadAsset, loadCanon, PRODUCT_SENTINEL } from "./canon.ts";
|
|
16
16
|
import { turnkey } from "./turnkey.ts";
|
|
@@ -101,13 +101,28 @@ const SHAPES: Record<ProductShape, ShapeModule> = {
|
|
|
101
101
|
turnkey,
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
/** A pin from the dev-kit's own package.json — the coherent set set-sdk-source.ts
|
|
105
|
+
* moves as one line, and the only copy that travels with the published package. */
|
|
106
|
+
export function devKitPin(pkg: { devDependencies?: Record<string, string> }, name: string): string {
|
|
107
|
+
const pin = pkg.devDependencies?.[name];
|
|
108
|
+
if (pin === undefined) {
|
|
109
|
+
throw new Error(`the dev-kit's package.json pins no ${name}; a generated product would carry no version`);
|
|
110
|
+
}
|
|
111
|
+
return pin;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const devKitPackageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")) as {
|
|
115
|
+
devDependencies?: Record<string, string>;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// Derived, never a second copy of the tag: a hardcoded default silently missed
|
|
119
|
+
// every nightly sdk-bump, which moves the package.json line and nothing else.
|
|
120
|
+
// Media's npm packages and image are built from one commit, so they share a tag.
|
|
121
|
+
const DEFAULT_MEDIA_IMAGE = `norskvideo/norsk:${devKitPin(devKitPackageJson, "@norskvideo/norsk-sdk")}`;
|
|
122
|
+
// Studio's npm packages and image ship from different commits, so its image tag
|
|
123
|
+
// cannot be derived; it only has to sit on the lib pin's version line.
|
|
107
124
|
const DEFAULT_STUDIO_IMAGE = "norskvideo/norsk-studio:1.29.0-2026-09-10-dcf40e7c";
|
|
108
|
-
|
|
109
|
-
// lib pin can't be derived from the default image's tag.
|
|
110
|
-
const DEFAULT_STUDIO_LIB = "1.29.0-2026-09-10-b21d9013";
|
|
125
|
+
const DEFAULT_STUDIO_LIB = devKitPin(devKitPackageJson, "@norskvideo/norsk-studio");
|
|
111
126
|
|
|
112
127
|
const bareTag = (ref: string) => ref.slice(ref.lastIndexOf(":") + 1);
|
|
113
128
|
|
|
@@ -17,7 +17,12 @@ export declare function startInstanceProxy(opts: {
|
|
|
17
17
|
* instead of `NORSK_TEST_HOST:studioHostPort` — a `noPublish` instance binds
|
|
18
18
|
* no host port, so the caller supplies its `norsk-net` reach
|
|
19
19
|
* (`<id>-studio-1:8000`) via `resolveEndpoint`. Omitted = today's
|
|
20
|
-
* host-published behaviour.
|
|
20
|
+
* host-published behaviour.
|
|
21
|
+
*
|
|
22
|
+
* Supply it whenever `NORSK_TEST_HOST` is not loopback: ctl binds a
|
|
23
|
+
* product's STUDIO_HOST_PORT to `127.0.0.1`, which the host-gateway alias
|
|
24
|
+
* cannot reach. The alternative is launching with `--publish-debug-ports`.
|
|
25
|
+
* See conventions/integration-testing.md. */
|
|
21
26
|
upstream?: {
|
|
22
27
|
host: string;
|
|
23
28
|
port: number;
|