@norskvideo/ctl-dev-kit 0.2.76 → 0.2.78
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/create-product/turnkey.ts +140 -6
- package/package.json +1 -1
|
@@ -170,11 +170,16 @@ pinned in \`flake.nix\` and put on PATH by the nix shell:
|
|
|
170
170
|
\`norsk-ctl product add --dev-url http://localhost:${ctx.devPort}\` registers the
|
|
171
171
|
running backend as a dev product.
|
|
172
172
|
|
|
173
|
+
**Licence:** commit a non-production dev licence for this product at
|
|
174
|
+
licensing/${ctx.name}-dev.json and \`bun run iterate\` uses it whenever
|
|
175
|
+
\`NORSK_LICENSE_FILE\` is unset; export it yourself for \`bun run demo\`.
|
|
176
|
+
|
|
173
177
|
**Demo:** \`bun run demo -- up\` runs \`tests/demo.spec.ts\` (the
|
|
174
178
|
@norskvideo/ctl-test-harness demo driver) from source on a private daemon —
|
|
175
179
|
dev backend, registration, launch, the camera1 sample on the ingest, ready
|
|
176
180
|
gates, URLs; Ctrl-C tears down. \`check\` is the headless form CI runs,
|
|
177
|
-
\`spec\` prints the plan. \`
|
|
181
|
+
\`spec\` prints the plan. \`DEMO_SOURCES=none\` skips the sample, for feeds
|
|
182
|
+
pushed in by hand. \`scripts/demo\` is the same entry re-exec'd under
|
|
178
183
|
\`nix develop .#dev\` when the pinned ctl is not on PATH.
|
|
179
184
|
|
|
180
185
|
**Outer loop (real image):** \`bun run iterate\` — \`bun run build:image\` (the
|
|
@@ -323,7 +328,7 @@ function rootPackageJson(ctx: ShapeContext): string {
|
|
|
323
328
|
"check:drift": "bun run node_modules/@norskvideo/ctl-dev-kit/conventions/check-drift.ts",
|
|
324
329
|
"docs:check":
|
|
325
330
|
"bun run node_modules/@norskvideo/ctl-dev-kit/docs/path-existence.ts && bun run node_modules/@norskvideo/ctl-dev-kit/docs/light-pages.ts && bun run node_modules/@norskvideo/ctl-dev-kit/docs/journeys.ts",
|
|
326
|
-
"docs:manual": `bun run node_modules/@norskvideo/ctl-dev-kit/doc-guide/prose-bundle.js --brand "${ctx.name}" --title "${ctx.name} — Documentation" --link "norsk.video=https://norsk.video/" --out docs/generated/bundle docs/handover.md docs/operating.md docs/known-limitations.md`,
|
|
331
|
+
"docs:manual": `bun run node_modules/@norskvideo/ctl-dev-kit/doc-guide/prose-bundle.js --brand "${ctx.name}" --title "${ctx.name} — Documentation" --link "norsk.video=https://norsk.video/" --out docs/generated/bundle docs/handover.md docs/administering.md docs/operating.md docs/known-limitations.md`,
|
|
327
332
|
"docs:handover": "bash scripts/docs-handover.sh",
|
|
328
333
|
"docs:handover:check": "bash scripts/docs-handover.sh --check",
|
|
329
334
|
// The docs SITE (website/) — a standalone package, so its install is its
|
|
@@ -1817,7 +1822,8 @@ function iterateSh(ctx: ShapeContext): string {
|
|
|
1817
1822
|
# instance; your daemon and the registration stay.
|
|
1818
1823
|
#
|
|
1819
1824
|
# Needs the daemon already running (\`norsk-ctl serve\`), \`norsk-ctl\` on PATH
|
|
1820
|
-
# (\`nix develop .#dev\` provides it) and NORSK_LICENSE_FILE
|
|
1825
|
+
# (\`nix develop .#dev\` provides it) and a licence: NORSK_LICENSE_FILE, else
|
|
1826
|
+
# the committed non-production dev licence at licensing/${ctx.name}-dev.json.
|
|
1821
1827
|
#
|
|
1822
1828
|
# Usage (from the repo root):
|
|
1823
1829
|
# bun run iterate # full loop
|
|
@@ -1832,6 +1838,10 @@ repo="$(cd "$here/.." && pwd)"
|
|
|
1832
1838
|
# directly (build-image.sh honours IMAGE_TAG).
|
|
1833
1839
|
export IMAGE_TAG="\${IMAGE_TAG:-${ctx.name}:dev}"
|
|
1834
1840
|
|
|
1841
|
+
if [ -z "\${NORSK_LICENSE_FILE:-}" ] && [ -f "$repo/licensing/${ctx.name}-dev.json" ]; then
|
|
1842
|
+
export NORSK_LICENSE_FILE="$repo/licensing/${ctx.name}-dev.json"
|
|
1843
|
+
fi
|
|
1844
|
+
|
|
1835
1845
|
if [ -n "\${SKIP_BUILD:-}" ]; then
|
|
1836
1846
|
echo "=== build (skipped, SKIP_BUILD set) ==="
|
|
1837
1847
|
else
|
|
@@ -1908,7 +1918,12 @@ export default defineDemo({
|
|
|
1908
1918
|
image: process.env.IMAGE_TAG ?? "${ctx.name}:dev",
|
|
1909
1919
|
template: { name: "default" },
|
|
1910
1920
|
launch: { hardware: "none" },
|
|
1911
|
-
|
|
1921
|
+
// DEMO_SOURCES=none leaves the ingest to feeds someone pushes in by hand
|
|
1922
|
+
// (stream id input), so they can be stopped and started live.
|
|
1923
|
+
sources:
|
|
1924
|
+
process.env.DEMO_SOURCES === "none"
|
|
1925
|
+
? []
|
|
1926
|
+
: [{ name: "input", asset: { preset: "camera1" }, ingest: { param: "INGEST_PORT" }, streamId: "input" }],
|
|
1912
1927
|
ready: [{ http: { studio: "/live/api/components" }, status: 200, timeoutMs: 120_000 }],
|
|
1913
1928
|
open: [
|
|
1914
1929
|
{ name: "Studio", url: { proxy: "/instance/{id}/studio/" } },
|
|
@@ -2029,7 +2044,8 @@ norsk-ctl and the pinned Norsk SDK:
|
|
|
2029
2044
|
Two channels, deliberately:
|
|
2030
2045
|
|
|
2031
2046
|
- **The bundle the image serves.** \`bun run docs:manual\` builds it from
|
|
2032
|
-
\`docs/handover.md\`, \`docs/
|
|
2047
|
+
\`docs/handover.md\`, \`docs/administering.md\`, \`docs/operating.md\` and
|
|
2048
|
+
\`docs/known-limitations.md\`;
|
|
2033
2049
|
the image build runs
|
|
2034
2050
|
it, so every image serves them at /docs at the version that is running
|
|
2035
2051
|
(linked from the product's page in norsk-ctl). \`bun run docs:handover\`
|
|
@@ -2055,6 +2071,7 @@ served at /docs at the version that is running.
|
|
|
2055
2071
|
| Document | Audience | What it is |
|
|
2056
2072
|
| ---------------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
2057
2073
|
| \`docs/handover.md\` | whoever gets this product running | How norsk-ctl arrives, the one command that adds this product, and the bundle route for platform teams |
|
|
2074
|
+
| \`docs/administering.md\` | the server's administrator | What runs on the server and where, how to reach it, update it, back it up and remove it |
|
|
2058
2075
|
| \`docs/operating.md\` | operators | What a running deployment looks like from the operator's chair: the controls, the checks, the signs |
|
|
2059
2076
|
| \`docs/known-limitations.md\` | operators | What the product does not do yet, with the consequence and the workaround |
|
|
2060
2077
|
|
|
@@ -2098,7 +2115,7 @@ the Administrator's hat._
|
|
|
2098
2115
|
| Evaluator | \`/docs/\` | \`/docs/guides/\` | [norsk-ctl's manual](https://ctl.norsk.video/), to run it for real |
|
|
2099
2116
|
| Builder | \`/docs/guides/\` | \`/docs/how-to/\` | \`/docs/reference/\`, for the settings they just used |
|
|
2100
2117
|
| Integrator | \`/docs/reference/\` | \`/docs/concepts/\` | [norsk-ctl's CLI and API reference](https://ctl.norsk.video/) |
|
|
2101
|
-
| Administrator | \`handover.md\` | \`operating.md\`, \`known-limitations.md\` | [norsk-ctl's manual](https://ctl.norsk.video/), for everything about the machine |
|
|
2118
|
+
| Administrator | \`handover.md\` | \`administering.md\`, \`operating.md\`, \`known-limitations.md\` | [norsk-ctl's manual](https://ctl.norsk.video/), for everything about the machine |
|
|
2102
2119
|
|
|
2103
2120
|
Site paths resolve under website/src/content/docs; a bare name resolves under
|
|
2104
2121
|
docs/. Each route is at most five pages and ends in a hand-off, which is the
|
|
@@ -2203,6 +2220,122 @@ and its health check at /healthz are for._
|
|
|
2203
2220
|
`;
|
|
2204
2221
|
}
|
|
2205
2222
|
|
|
2223
|
+
// The server admin's page: the product running under norsk-ctl on the
|
|
2224
|
+
// customer's own machine (gameplay-football247's dev-ops guide, generalised).
|
|
2225
|
+
// norsk-ctl's server install is the same everywhere, so its half is written
|
|
2226
|
+
// out; the product's half carries a marker per section.
|
|
2227
|
+
function administeringMd(ctx: ShapeContext): string {
|
|
2228
|
+
return `# Administering ${ctx.name}
|
|
2229
|
+
|
|
2230
|
+
For whoever looks after the server ${ctx.name} runs on: what is installed
|
|
2231
|
+
where, how to reach it, how to update it, and how to remove it. Getting it
|
|
2232
|
+
running the first time is in handover.md; running the product day to day is in
|
|
2233
|
+
operating.md.
|
|
2234
|
+
|
|
2235
|
+
## What runs on the server
|
|
2236
|
+
|
|
2237
|
+
${ctx.name} runs under **norsk-ctl**, Norsk's service manager.
|
|
2238
|
+
|
|
2239
|
+
| Process / container | What it is |
|
|
2240
|
+
|---|---|
|
|
2241
|
+
| \`norsk-ctl\` (systemd service) | The manager: launches and supervises ${ctx.name}, serves its API |
|
|
2242
|
+
| \`norsk-proxy\`, \`norsk-proxy-oauth2\` | The HTTPS entry point and its login |
|
|
2243
|
+
| \`norsk-product-${ctx.name}\` | The product's control plane |
|
|
2244
|
+
| \`<instance>-<service>-1\` | One per service of a launched instance |
|
|
2245
|
+
|
|
2246
|
+
<!-- ctl-docs-template: fill me -->
|
|
2247
|
+
_Name this product's instance containers and say what each one does (the
|
|
2248
|
+
starter's are Studio, the workflow and its dashboard, and the media engine)._
|
|
2249
|
+
|
|
2250
|
+
## Where things are
|
|
2251
|
+
|
|
2252
|
+
| Path | Contents |
|
|
2253
|
+
|---|---|
|
|
2254
|
+
| \`/etc/norsk-ctl/\` | norsk-ctl's configuration (\`config.yaml\`), licences, TLS certificate |
|
|
2255
|
+
| \`/var/lib/norsk-ctl/\` | norsk-ctl's state: database, product registry, templates, proxy |
|
|
2256
|
+
| \`/var/log/norsk-ctl/\` | norsk-ctl's logs |
|
|
2257
|
+
| \`/opt/norsk-ctl/bin/\` | norsk-ctl binaries, one per version; \`/usr/local/bin/norsk-ctl\` points at the current one |
|
|
2258
|
+
| \`/etc/systemd/system/norsk-ctl.service\` | The service unit |
|
|
2259
|
+
| \`/etc/sysctl.d/90-norsk-tuning.conf\` | Network buffer tuning for media |
|
|
2260
|
+
<!-- path-allow -->
|
|
2261
|
+
|
|
2262
|
+
<!-- ctl-docs-template: fill me -->
|
|
2263
|
+
_Add the instance's working directory (uploaded media, settings) and anything
|
|
2264
|
+
else this product keeps on disk._
|
|
2265
|
+
|
|
2266
|
+
norsk-ctl runs as the user \`norsk\`. Run its CLI as that user, with its
|
|
2267
|
+
configuration:
|
|
2268
|
+
|
|
2269
|
+
\`\`\`sh
|
|
2270
|
+
sudo -u norsk env NORSK_CTL_CONFIG_DIR=/etc/norsk-ctl NORSK_CTL_STATE_DIR=/var/lib/norsk-ctl \\
|
|
2271
|
+
NORSK_CTL_LOG_DIR=/var/log/norsk-ctl norsk-ctl instance list
|
|
2272
|
+
\`\`\`
|
|
2273
|
+
|
|
2274
|
+
## Network
|
|
2275
|
+
|
|
2276
|
+
<!-- ctl-docs-template: fill me -->
|
|
2277
|
+
| Port | Open to | What |
|
|
2278
|
+
|---|---|---|
|
|
2279
|
+
| 22/tcp | administrators | SSH |
|
|
2280
|
+
| _443/tcp_ | _operators_ | _The web page (or loopback only: see below)_ |
|
|
2281
|
+
| _the product's inputs and outputs_ | _the senders and receivers_ | _one row per media port_ |
|
|
2282
|
+
|
|
2283
|
+
## Reaching the web page
|
|
2284
|
+
|
|
2285
|
+
The web page is norsk-ctl's proxy. On a server that must not expose it, bind it
|
|
2286
|
+
to loopback (norsk-ctl's \`bindAddress\` setting) and reach it through an SSH
|
|
2287
|
+
tunnel:
|
|
2288
|
+
|
|
2289
|
+
\`\`\`sh
|
|
2290
|
+
ssh -L 8443:127.0.0.1:443 <you>@<server> # 443: the proxy's port, if unchanged
|
|
2291
|
+
# then browse https://localhost:8443
|
|
2292
|
+
\`\`\`
|
|
2293
|
+
|
|
2294
|
+
A self-signed certificate is accepted once in the browser.
|
|
2295
|
+
|
|
2296
|
+
## Installing and updating
|
|
2297
|
+
|
|
2298
|
+
<!-- ctl-docs-template: fill me -->
|
|
2299
|
+
_The release this product ships and the one command that installs or updates
|
|
2300
|
+
it, with the settings it takes. Without a release kit: norsk-ctl's installer,
|
|
2301
|
+
then \`norsk-ctl product add\` (handover.md); a new image is \`norsk-ctl product
|
|
2302
|
+
reload\`; norsk-ctl itself is \`norsk-ctl upgrade --version <v>\`, as root._
|
|
2303
|
+
|
|
2304
|
+
## Checking it is healthy
|
|
2305
|
+
|
|
2306
|
+
\`\`\`sh
|
|
2307
|
+
systemctl status norsk-ctl # the manager
|
|
2308
|
+
journalctl -u norsk-ctl -f # its log
|
|
2309
|
+
docker ps # every container above, Up
|
|
2310
|
+
\`\`\`
|
|
2311
|
+
|
|
2312
|
+
<!-- ctl-docs-template: fill me -->
|
|
2313
|
+
_What the product's own page shows when it is healthy, and which container's
|
|
2314
|
+
log to read first when it is not._
|
|
2315
|
+
|
|
2316
|
+
## Removing it
|
|
2317
|
+
|
|
2318
|
+
<!-- ctl-docs-template: fill me -->
|
|
2319
|
+
_How to remove the product, and norsk-ctl with it, and what is left behind.
|
|
2320
|
+
Say plainly what is deleted (uploaded media) and how to keep it._
|
|
2321
|
+
|
|
2322
|
+
## Backups
|
|
2323
|
+
|
|
2324
|
+
norsk-ctl's state worth keeping is \`/etc/norsk-ctl\` and \`/var/lib/norsk-ctl\`,
|
|
2325
|
+
plus each instance's working directory.
|
|
2326
|
+
|
|
2327
|
+
<!-- ctl-docs-template: fill me -->
|
|
2328
|
+
_Anything else of this product's that is worth keeping._
|
|
2329
|
+
|
|
2330
|
+
## Licence
|
|
2331
|
+
|
|
2332
|
+
${ctx.name} runs under a Norsk licence that entitles it, staged in
|
|
2333
|
+
\`/etc/norsk-ctl/licenses/\`. The product takes its licence when it is added
|
|
2334
|
+
(\`norsk-ctl product add --license-file\`), so a new licence goes in with the
|
|
2335
|
+
next \`product add\`.
|
|
2336
|
+
`;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2206
2339
|
const KNOWN_LIMITATIONS_MD = `# Known limitations
|
|
2207
2340
|
|
|
2208
2341
|
What this product does not do yet, or does with a caveat an operator must know
|
|
@@ -2283,6 +2416,7 @@ export const turnkey: ShapeModule = {
|
|
|
2283
2416
|
{ path: "docs/README.md", content: docsReadmeMd(ctx) },
|
|
2284
2417
|
{ path: "docs/handover.md", content: handoverMd(ctx) },
|
|
2285
2418
|
{ path: "docs/operating.md", content: operatingMd(ctx) },
|
|
2419
|
+
{ path: "docs/administering.md", content: administeringMd(ctx) },
|
|
2286
2420
|
{ path: "docs/known-limitations.md", content: KNOWN_LIMITATIONS_MD },
|
|
2287
2421
|
{ path: "docs/personas.md", content: personasMd(ctx) },
|
|
2288
2422
|
{ path: ".github/workflows/build-docs.yml", content: ctx.canon.buildDocs },
|