@norskvideo/ctl-dev-kit 0.2.146 → 0.2.147

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.
@@ -188,15 +188,23 @@ jobs:
188
188
 
189
189
  build:
190
190
  needs: label
191
+ # The arm64 leg runs on the shared arm pool (label `arm`: jankings
192
+ # arm-runner-1..4 and arm-runner-quadra, docker-outside-of-docker on
193
+ # arm.norsk). A build runs no containers and binds no ports, so the pool's
194
+ # shared daemon and Docker 25 are fine for it. It used to wait for the single
195
+ # ar-arm-vm runner behind every other arm64 job (id3as/norsk-cloud#111).
196
+ # CTL_ARM64_RUNNER (an Actions variable, repo or org level, one runner
197
+ # label) sends it elsewhere without a commit -- e.g. `ar-arm-vm` if the
198
+ # pool is down; unset means `arm`.
191
199
  strategy:
192
200
  fail-fast: false
193
201
  matrix:
194
202
  include:
195
203
  - runner: x64
196
204
  arch: amd64
197
- - runner: ar-arm-vm
205
+ - runner: arm
198
206
  arch: arm64
199
- runs-on: ${{ matrix.runner }}
207
+ runs-on: ${{ matrix.arch == 'arm64' && vars.CTL_ARM64_RUNNER || matrix.runner }}
200
208
  steps:
201
209
  - name: Job-local docker config
202
210
  # Before anything touches docker (see the header): this job's own login
@@ -88,8 +88,8 @@ export function carriesIntegrationMarker(text: string): boolean {
88
88
  }
89
89
 
90
90
  // smoke.yml carries a second per-repo line: the matrix `runner:` label array
91
- // the journey runs on ('["x64"]' for the pool, '["ARM64","nvidia"]' for the GPU
92
- // box). Masked like product:; any filled value is valid, so no sentinel check.
91
+ // the journey runs on ('["arm"]' for the shared arm pool, '["ARM64","nvidia"]'
92
+ // for a GPU product). Masked like product:; any filled value is valid, so no sentinel check.
93
93
  export const RUNNER_LINE = /^(\s*-?\s*runner:\s*).*$/gm;
94
94
 
95
95
  function workflowProblem(
@@ -12,13 +12,14 @@
12
12
  # customer would run it.
13
13
  #
14
14
  # Runner selection is a one-entry matrix carrying a JSON label array, because a
15
- # string like '[ARM64, nvidia]' in runs-on is ONE label, not two. The runner
16
- # MUST run Docker natively: `product add --image` publishes the control plane on
17
- # a host port and the daemon polls 127.0.0.1:<port> for readiness, so on a
18
- # docker-outside-of-docker pool (the x64 runners are containers) that loopback
19
- # is the docker host's, never the runner's, and registration times out. Default
20
- # '["ar-arm-vm"]' (native Docker, arm64 — the image is built for it here); the
21
- # GPU box is '["ARM64","nvidia"]'.
15
+ # string like '[ARM64, nvidia]' in runs-on is ONE label, not two. Default
16
+ # '["arm"]': the shared arm pool (jankings arm-runner-1..4 and -quadra,
17
+ # containers on one docker daemon); a GPU product asks for '["ARM64","nvidia"]',
18
+ # labels the same pool's runners carry.
19
+ # Either kind of runner works: the topology probe below detects a
20
+ # docker-outside-of-docker runner and reaches the product another way, and
21
+ # on a shared daemon the journey step takes a per-product host lock and the
22
+ # harness bands its ports per runner, so runs on sibling runners never meet.
22
23
  name: smoke
23
24
 
24
25
  on:
@@ -54,7 +55,7 @@ jobs:
54
55
  strategy:
55
56
  matrix:
56
57
  include:
57
- - runner: '["ar-arm-vm"]'
58
+ - runner: '["arm"]'
58
59
  runs-on: ${{ fromJSON(matrix.runner) }}
59
60
  steps:
60
61
  # Runs BEFORE checkout, and does two things: points the harness's temp base
@@ -165,7 +166,7 @@ jobs:
165
166
  # Hence: kill by PORT rather than by name, prune the endpoints a removal
166
167
  # can strand, and then PROVE the port binds instead of assuming it. This
167
168
  # branch only runs where the docker daemon is this runner's own and jobs
168
- # are serial, so there is nothing else here to protect. The GPU box runs
169
+ # are serial, so there is nothing else here to protect. The arm pool runs
169
170
  # several runners as sibling CONTAINERS against one host daemon and is
170
171
  # excluded -- there, a blanket reap would kill a concurrent job.
171
172
  - name: Reap a stranded product control plane
@@ -404,22 +405,49 @@ jobs:
404
405
  # Outer pipefail so the step reports the journey's exit, not tee's --
405
406
  # otherwise a failed smoke run over the `| tee` below scores green.
406
407
  set -euo pipefail
407
- nix develop .#build --command bash -c '
408
- set -euo pipefail
409
- # A frozen install does not reliably relink a hoisted package whose
410
- # version moved: a stale test-harness once survived a bump and a new
411
- # export was "not found" at import. Drop the harness copy so the
412
- # pinned version runs. Belt and braces now the checkout is clean.
413
- rm -rf node_modules/@norskvideo/ctl-test-harness
414
- bun install --frozen-lockfile
415
- pub="$(sed -nE "s/^[[:space:]]*PUBLISH_IMAGE:[[:space:]]*\"?([^\" ]*)\"?[[:space:]]*$/\\1/p" .github/workflows/build-image.yml | head -1)"
416
- def="$(sed -nE "s/.*IMAGE_TAG:-([^}]+)\\}.*/\\1/p" deployment/build-image.sh | head -1)"
417
- export IMAGE_TAG="${pub:+$pub:smoke}"
418
- export IMAGE_TAG="${IMAGE_TAG:-$def}"
419
- echo "smoke image: $IMAGE_TAG"
420
- bun run build:image
421
- SMOKE_IMAGE_TAG="$IMAGE_TAG" bun run test:smoke
422
- ' 2>&1 | tee "$RUNNER_TEMP/smoke.log"
408
+ journey() {
409
+ nix develop .#build --command bash -c '
410
+ set -euo pipefail
411
+ # A frozen install does not reliably relink a hoisted package whose
412
+ # version moved: a stale test-harness once survived a bump and a new
413
+ # export was "not found" at import. Drop the harness copy so the
414
+ # pinned version runs. Belt and braces now the checkout is clean.
415
+ rm -rf node_modules/@norskvideo/ctl-test-harness
416
+ bun install --frozen-lockfile
417
+ pub="$(sed -nE "s/^[[:space:]]*PUBLISH_IMAGE:[[:space:]]*\"?([^\" ]*)\"?[[:space:]]*$/\\1/p" .github/workflows/build-image.yml | head -1)"
418
+ def="$(sed -nE "s/.*IMAGE_TAG:-([^}]+)\\}.*/\\1/p" deployment/build-image.sh | head -1)"
419
+ export IMAGE_TAG="${pub:+$pub:smoke}"
420
+ export IMAGE_TAG="${IMAGE_TAG:-$def}"
421
+ echo "smoke image: $IMAGE_TAG"
422
+ bun run build:image
423
+ SMOKE_IMAGE_TAG="$IMAGE_TAG" bun run test:smoke
424
+ '
425
+ }
426
+ # One run of THIS product per docker host at a time. On a shared
427
+ # daemon (the arm pool's runners are sibling containers) two runs of
428
+ # one product collide on names only it uses: the registered image's
429
+ # control plane norsk-product-<name>, the instance smoke-<slug> and
430
+ # the <repo>:smoke tag the journey builds. A per-repo concurrency
431
+ # group cannot stop that without dropping a queued ctl-candidate
432
+ # run. /srv/ci-scratch is bind-mounted at that path into every runner
433
+ # on a jankings host, so an flock there is the host's mutex; the
434
+ # kernel drops it when this shell exits. Children close fd 9. After
435
+ # an hour the journey runs anyway, warned. smoke-host-lock.test.ts.
436
+ if [ -d /srv/ci-scratch ] && [ -w /srv/ci-scratch ]; then
437
+ lock="/srv/ci-scratch/locks/norsk-ctl-smoke-${GITHUB_REPOSITORY//\//_}.lock"
438
+ mkdir -p "${lock%/*}"
439
+ exec 9>>"$lock"
440
+ echo "waiting for this host's smoke lock for this product ($lock)"
441
+ waited=$SECONDS
442
+ if flock -w 3600 9; then
443
+ echo "holding this host's smoke lock after $((SECONDS - waited))s"
444
+ else
445
+ echo "::warning title=smoke ran unserialised::waited an hour for $lock on $(hostname); a concurrent run of this product on this host may collide with it"
446
+ fi
447
+ else
448
+ echo "no writable /srv/ci-scratch on this runner: smoke runs without the host lock"
449
+ fi
450
+ journey 9>&- 2>&1 | tee "$RUNNER_TEMP/smoke.log"
423
451
 
424
452
  # We pretty much always want the Norsk logs from a smoke run: the journey
425
453
  # runs the RELEASED media + studio images, and the harness dumps each
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.146",
3
+ "version": "0.2.147",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",