@norskvideo/ctl-dev-kit 0.2.113 → 0.2.115
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/build/ctl-shell.nix +1 -0
- package/build/flake.sdk-app.nix +1 -0
- package/conventions/build-docs.yml +6 -0
- package/conventions/build-image.yml +21 -0
- package/conventions/checks.sdk-app.yml +16 -0
- package/conventions/checks.yml +16 -0
- package/conventions/integration-testing.md +14 -0
- package/conventions/integration.yml +6 -0
- package/conventions/publish-docs.yml +9 -0
- package/conventions/smoke.yml +6 -0
- package/create-product/create-product.ts +31 -2
- package/create-product/turnkey.ts +3 -2
- package/package.json +5 -5
package/build/ctl-shell.nix
CHANGED
|
@@ -73,6 +73,7 @@ let
|
|
|
73
73
|
pkgs.ffmpeg # integration suites spawn a local ffmpeg (e.g. SRT egress capture)
|
|
74
74
|
pkgs.imagemagick # doc-guide manual assembly shells out to `magick` to embed captures
|
|
75
75
|
pkgs.gh # publish-docs uploads the built manual via `gh release`; runners have no system gh
|
|
76
|
+
pkgs.lsof # ctl-test-harness killProcessOnPort finds a port's listener with it; off PATH it silently kills nothing
|
|
76
77
|
];
|
|
77
78
|
|
|
78
79
|
# The released norsk-ctl daemon, pinned by version + per-platform hash in the
|
package/build/flake.sdk-app.nix
CHANGED
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
# parses @biomejs/biome's JS wrapper that reads BIOME_BINARY
|
|
51
51
|
pkgs.git
|
|
52
52
|
ffmpegFull # integration suites spawn a local ffmpeg (e.g. SRT egress capture)
|
|
53
|
+
pkgs.lsof # ctl-test-harness killProcessOnPort finds a port's listener with it
|
|
53
54
|
] ++ ctlShell.browserInputs;
|
|
54
55
|
shell = ctlShell.shell tools (''
|
|
55
56
|
export NIXPKGS_ALLOW_UNFREE=1
|
|
@@ -63,6 +63,9 @@ jobs:
|
|
|
63
63
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
64
64
|
mkdir -p "$base"
|
|
65
65
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
66
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
67
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
68
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
66
69
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
67
70
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
68
71
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -119,6 +122,9 @@ jobs:
|
|
|
119
122
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
120
123
|
mkdir -p "$base"
|
|
121
124
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
125
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
126
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
127
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
122
128
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
123
129
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
124
130
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -100,6 +100,9 @@ jobs:
|
|
|
100
100
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
101
101
|
mkdir -p "$base"
|
|
102
102
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
103
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
104
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
105
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
103
106
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
104
107
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
105
108
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -199,6 +202,9 @@ jobs:
|
|
|
199
202
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
200
203
|
mkdir -p "$base"
|
|
201
204
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
205
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
206
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
207
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
202
208
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
203
209
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
204
210
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -332,6 +338,9 @@ jobs:
|
|
|
332
338
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
333
339
|
mkdir -p "$base"
|
|
334
340
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
341
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
342
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
343
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
335
344
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
336
345
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
337
346
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -564,6 +573,9 @@ jobs:
|
|
|
564
573
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
565
574
|
mkdir -p "$base"
|
|
566
575
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
576
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
577
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
578
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
567
579
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
568
580
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
569
581
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -774,6 +786,9 @@ jobs:
|
|
|
774
786
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
775
787
|
mkdir -p "$base"
|
|
776
788
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
789
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
790
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
791
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
777
792
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
778
793
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
779
794
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -886,6 +901,9 @@ jobs:
|
|
|
886
901
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
887
902
|
mkdir -p "$base"
|
|
888
903
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
904
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
905
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
906
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
889
907
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
890
908
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
891
909
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -1025,6 +1043,9 @@ jobs:
|
|
|
1025
1043
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
1026
1044
|
mkdir -p "$base"
|
|
1027
1045
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
1046
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
1047
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
1048
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
1028
1049
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
1029
1050
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
1030
1051
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -36,6 +36,9 @@ on:
|
|
|
36
36
|
|
|
37
37
|
permissions:
|
|
38
38
|
contents: read
|
|
39
|
+
# GitHub Packages needs a token even to read norsk's dev packages (the
|
|
40
|
+
# dev SDK lane below).
|
|
41
|
+
packages: read
|
|
39
42
|
|
|
40
43
|
jobs:
|
|
41
44
|
drift:
|
|
@@ -198,6 +201,16 @@ jobs:
|
|
|
198
201
|
with:
|
|
199
202
|
clean: true
|
|
200
203
|
- name: Lint + typecheck + unit tests
|
|
204
|
+
env:
|
|
205
|
+
# The dev SDK lane, for a repo that opts in with .github/ci/sdk-dev.sh
|
|
206
|
+
# (norsk-relay): after the frozen install, the norsk SDKs are
|
|
207
|
+
# reinstalled from norsk's dev packages (every green push to norsk
|
|
208
|
+
# main, on GitHub Packages), so typecheck and unit run against norsk
|
|
209
|
+
# as it is now, not the nightly the tree pins -- a change that needs
|
|
210
|
+
# a norsk change merged this morning is green today. Not for a bot
|
|
211
|
+
# PR: a bump is asking about its pin. The committed pins are untouched.
|
|
212
|
+
SDK_LANE: ${{ (github.event_name == 'pull_request' && (github.head_ref == 'bump/nightly' || startsWith(github.head_ref, 'upgrade-latest/') || startsWith(github.head_ref, 'sync-dev-kit/') || github.head_ref == 'chore/sync-ctl-packages')) && 'pinned' || 'dev' }}
|
|
213
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
201
214
|
run: |
|
|
202
215
|
nix develop .#build --command bash -c '
|
|
203
216
|
set -euo pipefail
|
|
@@ -208,6 +221,9 @@ jobs:
|
|
|
208
221
|
# OLD checker against the new canonical). Cheap when already gone.
|
|
209
222
|
find . -name node_modules -type d -prune -exec rm -rf {} + 2>/dev/null || true
|
|
210
223
|
bun install --frozen-lockfile
|
|
224
|
+
if [ "$SDK_LANE" = dev ] && [ -x .github/ci/sdk-dev.sh ]; then
|
|
225
|
+
bash .github/ci/sdk-dev.sh
|
|
226
|
+
fi
|
|
211
227
|
bun run lint
|
|
212
228
|
bun run typecheck
|
|
213
229
|
# Known-flaky tests (.github/quarantine.json) leave the gating run
|
package/conventions/checks.yml
CHANGED
|
@@ -32,6 +32,9 @@ on:
|
|
|
32
32
|
|
|
33
33
|
permissions:
|
|
34
34
|
contents: read
|
|
35
|
+
# GitHub Packages needs a token even to read norsk's dev packages (the
|
|
36
|
+
# dev SDK lane below).
|
|
37
|
+
packages: read
|
|
35
38
|
|
|
36
39
|
jobs:
|
|
37
40
|
drift:
|
|
@@ -194,6 +197,16 @@ jobs:
|
|
|
194
197
|
with:
|
|
195
198
|
clean: true
|
|
196
199
|
- name: Lint + typecheck + unit tests
|
|
200
|
+
env:
|
|
201
|
+
# The dev SDK lane, for a repo that opts in with .github/ci/sdk-dev.sh
|
|
202
|
+
# (norsk-relay): after the frozen install, the norsk SDKs are
|
|
203
|
+
# reinstalled from norsk's dev packages (every green push to norsk
|
|
204
|
+
# main, on GitHub Packages), so typecheck and unit run against norsk
|
|
205
|
+
# as it is now, not the nightly the tree pins -- a change that needs
|
|
206
|
+
# a norsk change merged this morning is green today. Not for a bot
|
|
207
|
+
# PR: a bump is asking about its pin. The committed pins are untouched.
|
|
208
|
+
SDK_LANE: ${{ (github.event_name == 'pull_request' && (github.head_ref == 'bump/nightly' || startsWith(github.head_ref, 'upgrade-latest/') || startsWith(github.head_ref, 'sync-dev-kit/') || github.head_ref == 'chore/sync-ctl-packages')) && 'pinned' || 'dev' }}
|
|
209
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
197
210
|
run: |
|
|
198
211
|
nix develop .#build --command bash -c '
|
|
199
212
|
set -euo pipefail
|
|
@@ -204,6 +217,9 @@ jobs:
|
|
|
204
217
|
# OLD checker against the new canonical). Cheap when already gone.
|
|
205
218
|
find . -name node_modules -type d -prune -exec rm -rf {} + 2>/dev/null || true
|
|
206
219
|
bun install --frozen-lockfile
|
|
220
|
+
if [ "$SDK_LANE" = dev ] && [ -x .github/ci/sdk-dev.sh ]; then
|
|
221
|
+
bash .github/ci/sdk-dev.sh
|
|
222
|
+
fi
|
|
207
223
|
bun run lint
|
|
208
224
|
bun run typecheck
|
|
209
225
|
# Known-flaky tests (.github/quarantine.json) leave the gating run
|
|
@@ -247,6 +247,20 @@ spawnSync("docker", ["run", "--rm", "--user", "0:0", "-v", `${dirname(storeDir)}
|
|
|
247
247
|
"--entrypoint", "sh", STUDIO_IMAGE, "-c", `rm -rf /base/${basename(storeDir)}`]);
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
+
## Sample media comes from the shared asset cache
|
|
251
|
+
|
|
252
|
+
Source presets' media (`camera1`, `camera2`) is fetched once per cache into
|
|
253
|
+
`${NORSK_ASSET_CACHE:-$HOME/.cache/norsk/assets}/media-examples/data/`, not
|
|
254
|
+
once per store. `startCameraSource` hardlinks a preset's file from there into
|
|
255
|
+
the daemon's store before starting it, so start sources through the harness
|
|
256
|
+
rather than `POST /api/sources` directly. When `NORSK_ASSET_CACHE` is set,
|
|
257
|
+
daemons are also pointed at the cache itself (`NORSK_CTL_SAMPLE_MEDIA_DIR`), so
|
|
258
|
+
it must be a path the host daemon can bind-mount: the convention workflows set
|
|
259
|
+
it to `_norsk-assets` beside `$RUNNER_TEMP`: one cache per runner instance
|
|
260
|
+
(its `_work` dir), kept across runs.
|
|
261
|
+
Leave it unset in a hand-owned workflow on these runners rather than pointing
|
|
262
|
+
it under `$HOME`, which is the runner container's own.
|
|
263
|
+
|
|
250
264
|
## Reaching served media / HLS output
|
|
251
265
|
|
|
252
266
|
Studio reports playback URLs (HLS multivariant, WHIP endpoints) with the host it
|
|
@@ -133,6 +133,9 @@ jobs:
|
|
|
133
133
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
134
134
|
mkdir -p "$base"
|
|
135
135
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
136
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
137
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
138
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
136
139
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
137
140
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
138
141
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -641,6 +644,9 @@ jobs:
|
|
|
641
644
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
642
645
|
mkdir -p "$base"
|
|
643
646
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
647
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
648
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
649
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
644
650
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
645
651
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
646
652
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -78,6 +78,9 @@ jobs:
|
|
|
78
78
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
79
79
|
mkdir -p "$base"
|
|
80
80
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
81
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
82
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
83
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
81
84
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
82
85
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
83
86
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -134,6 +137,9 @@ jobs:
|
|
|
134
137
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
135
138
|
mkdir -p "$base"
|
|
136
139
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
140
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
141
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
142
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
137
143
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
138
144
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
139
145
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -498,6 +504,9 @@ jobs:
|
|
|
498
504
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
499
505
|
mkdir -p "$base"
|
|
500
506
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
507
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
508
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
509
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
501
510
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
502
511
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
503
512
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
package/conventions/smoke.yml
CHANGED
|
@@ -74,6 +74,9 @@ jobs:
|
|
|
74
74
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
75
75
|
mkdir -p "$base"
|
|
76
76
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
77
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
78
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
79
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
77
80
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
78
81
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
79
82
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -431,6 +434,9 @@ jobs:
|
|
|
431
434
|
base="$RUNNER_TEMP/nctt-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT"
|
|
432
435
|
mkdir -p "$base"
|
|
433
436
|
echo "NORSK_CTL_TEST_TMP=$base" >> "$GITHUB_ENV"
|
|
437
|
+
# The shared asset cache (sample media), kept across runs: under the work
|
|
438
|
+
# dir like the base, so the HOST daemon sees the path a daemon bind-mounts.
|
|
439
|
+
echo "NORSK_ASSET_CACHE=${RUNNER_TEMP%/*}/_norsk-assets" >> "$GITHUB_ENV"
|
|
434
440
|
# Yesterday's bases hold dockerd-created root dirs, so a non-root rm
|
|
435
441
|
# EACCESes. They cannot wedge a checkout, but they do fill the disk.
|
|
436
442
|
for old in $(find "$RUNNER_TEMP" -maxdepth 1 -name 'nctt-*' -mtime +0 -printf '%f\n' 2>/dev/null || true); do
|
|
@@ -117,10 +117,37 @@ const devKitPackageJson = JSON.parse(readFileSync(new URL("../package.json", imp
|
|
|
117
117
|
devDependencies?: Record<string, string>;
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
+
// CI's dev-SDK lane (.github/ci/sdk-dev.sh) repoints the client line at norsk's
|
|
121
|
+
// dev packages: the pin becomes an npm alias `npm:@id3as/<name>@<ver>-dev-<sha8>`.
|
|
122
|
+
const DEV_ALIAS = /^npm:@id3as\/([a-z-]+)@(.+)$/;
|
|
123
|
+
|
|
124
|
+
/** The media image built from the same commit as the dev-kit's norsk-sdk pin.
|
|
125
|
+
* A nightly pin names the Docker Hub tag outright. A dev alias has no Docker
|
|
126
|
+
* Hub image; norsk's publish-dev workflow pushes those builds to
|
|
127
|
+
* ghcr.io/id3as/norsk:dev-<sha8>, the sha8 the dev version carries, so a
|
|
128
|
+
* product scaffolded in the dev lane is still one commit through and through
|
|
129
|
+
* (CI run 40706712210, 2026-10-28: the alias pasted into the tag was not a ref). */
|
|
130
|
+
export function mediaImageFor(sdkSpec: string): string {
|
|
131
|
+
const alias = DEV_ALIAS.exec(sdkSpec);
|
|
132
|
+
if (!alias) return `norskvideo/norsk:${sdkSpec}`;
|
|
133
|
+
const sha = /-dev-([0-9a-f]{8})(?:\+|$)/.exec(alias[2])?.[1];
|
|
134
|
+
if (!sha) throw new Error(`dev alias ${sdkSpec} carries no -dev-<sha8>; no media image can be named for it`);
|
|
135
|
+
return `ghcr.io/id3as/norsk:dev-${sha}`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The spec a generated product declares for a client-line package. A version
|
|
139
|
+
* is shared by the whole line; a dev alias names one package, so each gets
|
|
140
|
+
* its own (norsk-api aliased to @id3as/norsk-sdk would install the wrong one). */
|
|
141
|
+
export function clientLineSpec(sdkSpec: string, name: string): string {
|
|
142
|
+
const alias = DEV_ALIAS.exec(sdkSpec);
|
|
143
|
+
return alias ? `npm:@id3as/${name.replace(/^@norskvideo\//, "")}@${alias[2]}` : sdkSpec;
|
|
144
|
+
}
|
|
120
145
|
// Derived, never a second copy of the tag: a hardcoded default silently missed
|
|
121
146
|
// every nightly sdk-bump, which moves the package.json line and nothing else.
|
|
122
147
|
// Media's npm packages and image are built from one commit, so they share a tag.
|
|
123
|
-
const
|
|
148
|
+
const DEFAULT_MEDIA_LIB = devKitPin(devKitPackageJson, "@norskvideo/norsk-sdk");
|
|
149
|
+
const DEFAULT_MEDIA_IMAGE = mediaImageFor(DEFAULT_MEDIA_LIB);
|
|
150
|
+
|
|
124
151
|
// Studio's npm packages and image ship from different commits, so its image tag
|
|
125
152
|
// cannot be derived; it only has to sit on the lib pin's version line.
|
|
126
153
|
const DEFAULT_STUDIO_IMAGE = "norskvideo/norsk-studio:1.30.0-2026-09-24-f57973c6";
|
|
@@ -189,7 +216,9 @@ export function shapeContext(opts: CreateProductOptions): ShapeContext {
|
|
|
189
216
|
mediaImage,
|
|
190
217
|
studioImage,
|
|
191
218
|
studioLib: opts.studioLib ?? (opts.studioImage ? bareTag(studioImage) : DEFAULT_STUDIO_LIB),
|
|
192
|
-
|
|
219
|
+
// An explicit image names the lib's version (one commit); the default
|
|
220
|
+
// lib spec is kept as the dev-kit declares it, alias and all.
|
|
221
|
+
mediaLib: opts.mediaImage ? bareTag(mediaImage) : DEFAULT_MEDIA_LIB,
|
|
193
222
|
},
|
|
194
223
|
canon: loadCanon(),
|
|
195
224
|
features: resolveFeatures(opts),
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { pinnedBunVersion } from "../conventions/check-drift.ts";
|
|
18
18
|
import {
|
|
19
|
+
clientLineSpec,
|
|
19
20
|
type GeneratedFile,
|
|
20
21
|
PRODUCT_ZOD,
|
|
21
22
|
type ShapeContext,
|
|
@@ -402,7 +403,7 @@ function rootPackageJson(ctx: ShapeContext): string {
|
|
|
402
403
|
"shell-quote": "^1.9.0",
|
|
403
404
|
"fast-xml-parser": "^5.10.1",
|
|
404
405
|
"fast-uri": "^3.1.4",
|
|
405
|
-
"@norskvideo/norsk-api": mediaLib,
|
|
406
|
+
"@norskvideo/norsk-api": clientLineSpec(mediaLib, "@norskvideo/norsk-api"),
|
|
406
407
|
"@norskvideo/norsk-sdk": mediaLib,
|
|
407
408
|
"@norskvideo/norsk-studio": studioLib,
|
|
408
409
|
...optionalStudioPins(ctx),
|
|
@@ -1217,7 +1218,7 @@ ${runtimeScreen} proxy: {
|
|
|
1217
1218
|
|
|
1218
1219
|
// docker-compose for the studio + media pair. The reserved \`studio\` +
|
|
1219
1220
|
// \`media\` service names let the runner's override generator target them
|
|
1220
|
-
// (workflow.yml
|
|
1221
|
+
// (workflow.yml copy, license env/file mount, etc).
|
|
1221
1222
|
export function renderCompose(config: ProductConfig): string {
|
|
1222
1223
|
const studioEnv: Record<string, string> = {
|
|
1223
1224
|
// Studio declares this product to the engine at the V2 licence handshake;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norskvideo/ctl-dev-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.115",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@norskvideo/ctl-oas-to-ts": "^0.1.0",
|
|
47
|
-
"@norskvideo/norsk-sdk": "1.3.1-2026-10-
|
|
48
|
-
"@norskvideo/norsk-studio": "1.30.0-2026-10-
|
|
49
|
-
"@norskvideo/norsk-studio-builder": "1.30.0-2026-10-
|
|
50
|
-
"@norskvideo/norsk-studio-built-ins": "1.30.0-2026-10-
|
|
47
|
+
"@norskvideo/norsk-sdk": "1.3.1-2026-10-27-8e095a74",
|
|
48
|
+
"@norskvideo/norsk-studio": "1.30.0-2026-10-26-896721cc",
|
|
49
|
+
"@norskvideo/norsk-studio-builder": "1.30.0-2026-10-26-896721cc",
|
|
50
|
+
"@norskvideo/norsk-studio-built-ins": "1.30.0-2026-10-26-896721cc",
|
|
51
51
|
"@playwright/test": "^1.59.0",
|
|
52
52
|
"@testing-library/jest-dom": "^6.9.1",
|
|
53
53
|
"@testing-library/react": "^16.3.2",
|