@norskvideo/ctl-dev-kit 0.2.17 → 0.2.19
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.
|
@@ -54,6 +54,35 @@ runner, one of these must hold:
|
|
|
54
54
|
A harness reaching a studio port at `${NORSK_TEST_HOST}` while neither holds
|
|
55
55
|
will see every studio gate time out with connection refused.
|
|
56
56
|
|
|
57
|
+
## The host docker daemon is shared between jobs
|
|
58
|
+
|
|
59
|
+
The x64 runners are sibling containers on ONE host docker daemon, so anything
|
|
60
|
+
named globally is shared by every concurrent job, whichever repo it belongs to.
|
|
61
|
+
On 2026-10-02 a reuters tier and a commentary tier each `compose up`ed
|
|
62
|
+
`norsk-proxy` over the other's, and reuters' teardown removed it mid-test.
|
|
63
|
+
|
|
64
|
+
- `startDaemon` (and so every harness built on it) names the daemon's proxy and
|
|
65
|
+
cpu-monitor sidecar after its port (`norsk-proxy-<port>`,
|
|
66
|
+
`norsk-ctl-cpu-monitor-<port>`). Don't override them back to the defaults.
|
|
67
|
+
- An image your suite builds must carry a **per-run tag** (e.g.
|
|
68
|
+
`<repo>:ci-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT`), not `:dev` — a concurrent run
|
|
69
|
+
can replace a fixed tag between your build and your `product add`. `docker rmi`
|
|
70
|
+
it at teardown, or the host fills up.
|
|
71
|
+
- Still box-global and NOT namespaced: `norsk-net`, and a registered image
|
|
72
|
+
product's control plane `norsk-product-<name>` on `127.0.0.1:14321`. Two
|
|
73
|
+
concurrent runs of the SAME product that both `product add --image` will
|
|
74
|
+
collide there.
|
|
75
|
+
|
|
76
|
+
## Reaching an image product's control plane
|
|
77
|
+
|
|
78
|
+
`product add --image` loopback-publishes the control plane
|
|
79
|
+
(`127.0.0.1:<port>:4321`). On a DooD runner that loopback is the HOST's, so a
|
|
80
|
+
test that probes `localhost:<published port>` reaches nothing. With
|
|
81
|
+
`NORSK_TEST_NET=direct`, dial the container's own address
|
|
82
|
+
(`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}'`)
|
|
83
|
+
on 4321 — the same thing the daemon does under
|
|
84
|
+
`NORSK_CTL_PRODUCT_REACH=container-address`.
|
|
85
|
+
|
|
57
86
|
## Host-shared working directory (or studio EACCESes on boot)
|
|
58
87
|
|
|
59
88
|
Studio bind-mounts its instance working directory as `${workdir}:/data` and runs
|
|
@@ -125,10 +154,11 @@ runs. Add `bun run build:image` inside the `nix develop .#build` block (docker i
|
|
|
125
154
|
reachable there); it also builds the dist the dev backend serves `/configure`
|
|
126
155
|
from.
|
|
127
156
|
|
|
128
|
-
## Stale node_modules on
|
|
157
|
+
## Stale node_modules on reused workspaces
|
|
129
158
|
|
|
130
|
-
The
|
|
131
|
-
|
|
159
|
+
The convention workflows now check out `clean: true` with test-temp routed to
|
|
160
|
+
`$RUNNER_TEMP`, but a hand-owned workflow on `clean: false` keeps
|
|
161
|
+
`node_modules` **between runs**, and `bun install --frozen-lockfile`
|
|
132
162
|
does **not** reliably relink a workspace-hoisted package whose version moved. A
|
|
133
163
|
stale `@norskvideo/ctl-test-harness@0.1.2` once survived a bump to `0.1.3`, so a
|
|
134
164
|
newly-added export was `SyntaxError: export 'X' not found` and the suite crashed
|
|
@@ -175,6 +205,12 @@ three optional hooks the workflow calls if they are executable:
|
|
|
175
205
|
| `scripts/integration/prepare.sh` | before `bun run test:integration` | builds the suite needs on disk — a frontend dist the daemon fetches, an image it launches |
|
|
176
206
|
| `scripts/integration/verify.sh` | after the suite | post-suite checks; absent, a repo with `tests/demo.spec.ts` gets `bun run demo -- check` |
|
|
177
207
|
|
|
208
|
+
The hooks run in the **same workflow step** as the suite, so a hook that writes
|
|
209
|
+
to `$GITHUB_ENV` changes nothing the suite sees — GitHub applies that file only
|
|
210
|
+
to later steps. Commentary's enforced-path opt-out was dead for its whole life
|
|
211
|
+
that way. Hand the suite a value by having both sides derive it (a tiny script
|
|
212
|
+
the hook runs and the test imports), not through `$GITHUB_ENV`.
|
|
213
|
+
|
|
178
214
|
`bun run test:integration` is the product's claim of what its tier is, and
|
|
179
215
|
ctl's release gate believes it: a `ctl-candidate` dispatch runs this workflow
|
|
180
216
|
and the reported result decides whether `latest` moves.
|
|
@@ -178,6 +178,39 @@ jobs:
|
|
|
178
178
|
echo "NORSK_RUNNER_OWNS_DOCKER=true" >> "$GITHUB_ENV"
|
|
179
179
|
fi
|
|
180
180
|
|
|
181
|
+
# Integration needs this host's docker to be able to create a network: the
|
|
182
|
+
# harness makes norsk-net and a network per instance. On 2026-10-02
|
|
183
|
+
# ashton-nuc's filter table had lost DOCKER-ISOLATION-STAGE-2, so every
|
|
184
|
+
# create failed with "Chain 'DOCKER-ISOLATION-STAGE-2' does not exist" --
|
|
185
|
+
# and commentary, probe and playout each ran a FULL integration suite on it
|
|
186
|
+
# and reported the result as test failures, 18 and 72 chain errors deep in
|
|
187
|
+
# their logs. The same host took four of that night's norsk image jobs down
|
|
188
|
+
# the same way. Nothing said "this machine's docker is broken".
|
|
189
|
+
#
|
|
190
|
+
# The chain is not readable without root on these runners, so this asserts
|
|
191
|
+
# the capability instead: create a throwaway network, remove it. One step,
|
|
192
|
+
# its own name, so the jobs API attributes the failure to it rather than to
|
|
193
|
+
# whatever composite step happened to be running.
|
|
194
|
+
- name: Check this host's docker can still create a network
|
|
195
|
+
run: |
|
|
196
|
+
set -uo pipefail
|
|
197
|
+
net="preflight-${{ github.run_id }}-${{ github.run_attempt }}-$RANDOM"
|
|
198
|
+
if err=$(docker network create "$net" 2>&1); then
|
|
199
|
+
docker network rm "$net" >/dev/null 2>&1 || true
|
|
200
|
+
echo "docker can create networks on $(hostname) -- ok"
|
|
201
|
+
exit 0
|
|
202
|
+
fi
|
|
203
|
+
echo "::error::docker on this runner cannot create a network, so every container this suite starts would silently not exist -- the tests would fail for a reason that is not theirs. Host: $(hostname). Fix: \`sudo systemctl restart docker\` on that machine (it rebuilds the DOCKER/DOCKER-ISOLATION iptables chains), then re-run."
|
|
204
|
+
echo "$err"
|
|
205
|
+
echo "--- docker0 (a subnet other than 172.17.0.1/16 means it was re-addressed) ---"
|
|
206
|
+
ip -br addr show docker0 2>/dev/null || true
|
|
207
|
+
echo "--- networks and their subnets ---"
|
|
208
|
+
for n in $(docker network ls --format '{{.Name}}' 2>/dev/null); do
|
|
209
|
+
printf '%-28s ' "$n"
|
|
210
|
+
docker network inspect "$n" --format '{{range .IPAM.Config}}{{.Subnet}} {{end}}' 2>/dev/null || echo
|
|
211
|
+
done
|
|
212
|
+
exit 1
|
|
213
|
+
|
|
181
214
|
# `product add --image` publishes the control plane on 127.0.0.1:14321. The
|
|
182
215
|
# daemon means to reap it on shutdown (daemon.ts, model B) but only does so
|
|
183
216
|
# gracefully, and this workflow cancels its own superseded runs -- a killed
|