Skip to content

build: sdr-host Corepack + docs + dockerignore audit (3/3) - #3

Merged
Coriou merged 3 commits into
mainfrom
build/devx-overhaul-pr3
May 16, 2026
Merged

build: sdr-host Corepack + docs + dockerignore audit (3/3)#3
Coriou merged 3 commits into
mainfrom
build/devx-overhaul-pr3

Conversation

@Coriou

@Coriou Coriou commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

Third of three stacked PRs. Stacked on #2 — base is build/devx-overhaul-pr2; cascades to main automatically as #1 and #2 merge.

Polish phase: sdr-host alignment, docs consolidation, and a substantive .dockerignore fix that turned out to be more than the spec anticipated.

  • Phase G (chore(sdr-host): switch pnpm install to Corepack pattern) — single-line edit to packages/sdr-host/Dockerfile: RUN npm install -g pnpm@10RUN corepack enable && corepack prepare pnpm@10.28.0 --activate. Matches the main Dockerfile pattern and pins explicitly to package.json's packageManager field. Verified via docker buildx build -f packages/sdr-host/Dockerfile --target node-build --platform linux/amd64 --load . — Corepack steps succeed, pnpm install --frozen-lockfile resolves 102 packages, all 3 workspace tsc builds pass. Arm64-via-QEMU is arch-agnostic for this pattern; sdr-host's per-host CI / make sdr-host-build exercises full arm64.
  • Phase H (docs: consolidate Docker documentation around compose profiles) — docs/DOCKER-SETUP.md rewritten as the canonical reference: pnpm dev as headline, compose profiles, GHCR cache, demod-test environment, R7 disclosure (first-run SourceConnectionError noise is expected — s6 hard dep removed; SourceManager's exponential backoff is the authoritative source-availability mechanism). docker/README.md deleted (294 lines that duplicated DOCKER-SETUP.md content, mostly stale). CLAUDE.md's "Day-to-day dev (Docker)" section condensed from a 14-line block + code fence to one paragraph that names the new canonical targets.
  • Phase I (chore: audit .dockerignore effectiveness; fix stale doc reference) — substantive .dockerignore fix: top-level globs (dist, tests, .turbo, .pnpm-store, coverage, .tsc-cache) were silently failing to match workspace mirrors (cli/dist, packages/sdr-host/tests, etc.). Added **/... siblings for all of them. Build context size dropped from 1.70 MB / 348 files to 15.56 KB. This was a genuine bug; the spec's prediction that Phase I might be a no-op didn't hold. Also fixed one stale doc reference: docs/DECODER-GUIDE.md:555 make dev-logsmake dev-stack-logs (Phase E renamed the target).

Final-gate Non-negotiables: 13 PASS / 2 DEFERRED

Spec lists 15 (tasks.md lines 199–218). All 13 testable items pass; the 2 deferred match this execution's no-push directive until the PRs landed.

# Spec Result Evidence
1 pnpm dev no Docker PASS Background-launched, app booted in ~16 ms post-restart, zero docker subprocesses
2 warm-cache no-op PASS (amd64) / DEFERRED (multi-arch) Single-arch: 8.965 s → 7.163 s, 124 CACHED stages on 2nd run. Multi-arch needs CI
3 TS edit invalidates only node-build + finals PASS All 12 decoder *-build stages CACHED on touch src/index.ts rebuild
4 one-decoder edit invalidates only that decoder PASS Bumping READSB_REF short-circuits at readsb-build with not our ref (proves cache key isolation)
5 no plain docker build PASS grep -rn '\bdocker build\b' docker/ Makefile compose.yaml | grep -v buildx empty
6 one compose file PASS Only ./compose.yaml at root
7 final-core zero sdrpp residue PASS find /etc/s6-overlay -iname '*sdrpp*' empty, no sdrpp in /usr/local/bin or /usr/bin
8 wavekit-api deps minimal PASS exactly wavekit-init in dependencies.d/
9 final has exactly one sdrpp-server dir PASS one match for find /etc/s6-overlay -name sdrpp-server -type d
10 CI runs both jobs on PR DEFERRED This PR's CI run IS the validation
11 no emoji in newly-introduced output PASS git diff for Makefile/docker/.github shows no emoji added
12 4 deleted compose files gone PASS all 4 listed in git diff --diff-filter=D
13 demod-test Dockerfile + compose gone PASS both listed in git diff --diff-filter=D
14 packages/sdr-host/docker-compose.yml unchanged PASS 0-line diff vs spec-commit baseline
15 sdr-host Corepack PASS grep -c corepack packages/sdr-host/Dockerfile = 1, npm install -g pnpm count = 0

Test plan

Post-merge

  • D.8 (initial GHCR cache seed): happens automatically when this stack merges to main and the CI's main-branch path runs with CACHE_FROM_ONLY=false + push: true + cache-to mode=max for every cache ref.
  • The first CI run on main will take 25–40 min (cold). All subsequent runs (PR or main) will hit the seeded cache and complete in 2–5 min for typical changes.

@Coriou
Coriou changed the base branch from build/devx-overhaul-pr2 to main May 16, 2026 15:42
@Coriou
Coriou force-pushed the build/devx-overhaul-pr3 branch from 10a5396 to 148dc7e Compare May 16, 2026 15:43
Coriou added 3 commits May 16, 2026 17:43
packages/sdr-host/Dockerfile previously installed pnpm via
`npm install -g pnpm@10` which can drift from the main Dockerfile's
pin and from package.json's packageManager field. Switch to the
Corepack pattern (matches main Dockerfile + Req 9.1):

  RUN corepack enable && corepack prepare pnpm@10.28.0 --activate

This pins the pnpm version explicitly to package.json's
packageManager field (pnpm@10.28.0); future bumps go through one
file instead of three.

Build verified via `docker buildx build -f packages/sdr-host/Dockerfile
--target node-build --platform linux/amd64 --load .` -- Corepack
enable + prepare succeed, pnpm install --frozen-lockfile resolves
102 packages, all three workspace packages (@wavekit/shared,
@wavekit/api-types, @wavekit/sdr-host) tsc-build successfully.
Arm64-via-QEMU build was started but killed before completion;
the Corepack pattern is arch-agnostic so amd64 verification is
sufficient.

Phase G of build/devx-overhaul-pr3. Closes G.1-G.2.
Replace docs/DOCKER-SETUP.md's stale references to the four-compose-
files world (docker-compose.dev.yml etc., `make dev-up`, the
.docker-cache local cache directory) with the new canonical
reference: `pnpm dev` as the headline iteration loop, `make dev-stack`
as the compose-driven full-stack fallback, four compose profiles
(dev / prod-single-host / prod-distributed / demod-test), and the
GHCR-backed buildx bake registry cache. Adds the R7 disclosure:
first-run SourceConnectionError lines in `final` mode are expected
(the s6 hard dep on sdrpp-server was removed; SourceManager's
exponential backoff is the authoritative source-availability
mechanism).

docker/README.md was deleted; every line duplicated DOCKER-SETUP.md
content and most references were stale (the four-compose-file tree
diagram, removed Makefile targets like `make docker-dev` and
`make install-buildx`, claims of arm/v7 multi-arch support). The
resulting two-doc-reconciliation problem motivated this phase
(Req 8.2).

CLAUDE.md's "Day-to-day dev (Docker)" section condensed from 14
lines (Makefile-target code block + ports footnote) to one paragraph:
`pnpm dev` for typescript-only iteration; `make dev-stack` for full-
stack integration; pointer to DOCKER-SETUP.md for details (Req 8.3).

Phase H of build/devx-overhaul-pr3. Closes H.1-H.3.
I.1-I.4 verification of .dockerignore against the actual build
context found that the original glob patterns only matched
top-level paths. With a `COPY . .` in the node-build stage, this
meant `.turbo/`, `dist/`, `coverage/`, `.tsc-cache/`, and `tests/`
under each pnpm workspace (cli/, packages/api-types/,
packages/shared/, packages/sdr-host/) silently leaked into the
build context — pollution that defeats Property 3 (a TypeScript
edit invalidates only node-build) by tying the node-build cache
key to whatever stale build output happens to be in workspace
.turbo / dist directories.

Fix: add `**/<path>` mirrors for every recurring build artifact
and cache pattern: `**/dist`, `**/coverage`, `**/.tsc-cache`,
`**/.turbo`, `**/.pnpm-store`, `**/tests`. The non-recursive
forms are kept so the file remains readable as a list of "what
this excludes at the project root."

Effect (measured with a busybox COPY . /context shim):
  before fix: 1.70MB transferred, 348 files, .turbo + dist
              from each workspace leaking
  after fix:  15.56KB transferred, no offending paths

I.4 verification confirmed .dockerignore does NOT exclude
docker/, config/, tsconfig.json, tsconfig.base.json,
pnpm-lock.yaml, pnpm-workspace.yaml, turbo.json, .npmrc,
package.json, or scripts/build-file.mjs — all needed during
the build.

Doc fix: docs/DECODER-GUIDE.md:555 referenced `make dev-logs`
which Phase E deleted. Updated to `make dev-stack-logs` (the
canonical counterpart in the new Makefile inventory).

Phase I of build/devx-overhaul-pr3. Closes I.1-I.4.
@Coriou
Coriou force-pushed the build/devx-overhaul-pr3 branch from 148dc7e to afe01ef Compare May 16, 2026 15:43
@Coriou
Coriou merged commit d03f326 into main May 16, 2026
2 checks passed
@Coriou
Coriou deleted the build/devx-overhaul-pr3 branch May 16, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant