docs(docker): roadmap v7 — Phase A complete on clock, warm 2.9s/5.4s

Per execution \u00a7 10 step 10 (metrics in lockstep with implementation commits).

Updates:
  - \u00a7 A7 metrics table populated with cold + warm numbers post-A2:
    clock backend  59.2 s  \u2192  64.7 s cold  \u2192   2.9 s warm  (95.1% \u2193)
    clock web      193 s   \u2192  291 s* cold  \u2192   5.4 s warm  (97.2% \u2193)
    * web cold variance: 174-291 s across runs, dominated by tarball
      egress through corp proxy. Cold is not the optimization target.

  - \u00a7 A7 measurement commands now include the 'deps-changed' case
    (touch package.json) where A2's pnpm-store cache mount is the
    relevant speedup, since plain warm rebuild benefits from
    BuildKit layer cache regardless of A2.

  - \u00a7 10 execution order:
    steps 7 + 8 marked \u2705 with commit refs
    step  9 marked \u23f8 with explicit STOP-for-approval (peakpulse is
      a different repo)
    step  10 collapsed into this commit (was placeholder for A7 fill)

  - Status line: v6 \u2192 v7

Cross-repo commit chain (Phase A complete on clock):
  clock@0be887288       feat(docker): A0 \u2014 wire Gitea-registry path
  devops_tools@ba8b4d1  docs(docker): roadmap v5 \u2014 add F16
  common-plat@cfcfc7bb  fix(gitea): rewrite workspace:* (F16)
  common-plat@dd90f709  fix(gitea): ROOT_URL host.docker.internal (F17)
  clock@8b5c767a3       fix(docker): rewrite file: refs to * (F18)
  devops_tools@7627d55  docs(docker): roadmap v6 \u2014 A0-V PASSED
  clock@f6a806ff3       feat(docker): A8 + A9 + A1
  clock@55e8d22d3       feat(docker): A2 + A5 + A6
  devops_tools@HEAD     docs(docker): roadmap v7 (this commit)

Next: \u00a7 10 step 9 \u2014 peakpulse replication. Pause point for approval.
This commit is contained in:
saravanakumardb1 2026-05-27 02:16:07 -07:00
parent 7627d5526d
commit 062155b81e

View File

@ -1,6 +1,6 @@
# Docker Build Optimization Roadmap
> **Status:** Draft v6 (F17 + F18 fixed; A0-V PASSED on clock) · **Owner:** Platform DevOps · **Created:** 2026-05-27 · **Revised:** 2026-05-27
> **Status:** Draft v7 (Phase A complete on clock; warm rebuilds 2.9 s backend / 5.4 s web) · **Owner:** Platform DevOps · **Created:** 2026-05-27 · **Revised:** 2026-05-27
>
> Pilot Docker-build correctness + speed fixes on `learning_ai_clock` (web + backend)
> and `learning_ai_peakpulse` (backend), then capture the playbook here for
@ -306,20 +306,32 @@ Two options — pick one in a short ADR before implementing:
### A7. Measure & record
| Repo | Surface | Cold before | Cold after | Warm before | Warm after | Notes |
|---|---|---|---|---|---|---|
| clock | backend | ≈23 min (failed via tarball path) | **59.2 s** (A0-V #2) | — | — | Pre-A1/A2; no corepack, no cache mount yet. Speed is just from working Gitea path |
| clock | web | ≈23 min (failed via tarball path) | **3:13 (193 s)** (A0-V #3) | — | — | Same caveat |
| peakpulse | backend | — | — | — | — | Pending step 7 |
| Repo | Surface | Cold (A0-V) | Cold (post-A2) | Warm (post-A2) | Notes |
|---|---|---|---|---|---|
| clock | backend | **59.2 s** | **64.7 s** | **2.9 s** | Cold essentially flat (corepack adds ~1 s; cache mount empty on first run). Warm → 95.1% reduction. Commits: `clock@8b5c767a3` (A0-V), `clock@f6a806ff3` (A1+A8+A9), `clock@55e8d22d3` (A2+A5+A6) |
| clock | web | **193 s (3:13)** | **291 s (4:51) †** | **5.4 s** | Warm → 97.2% reduction. † Cold variance — see footer |
| peakpulse | backend | — | — | — | Pending §10 step 9 |
Warm-rebuild numbers will be measured after A1 (corepack) + A2 (cache mount)
land — those are the actual speed phases. Current numbers establish the
baseline that A1+A2 must beat.
**Footer note on cold-build variance.** Cold builds (`--no-cache`) are
dominated by network egress for ~50 `@bytelyst/*` tarballs through the
corp proxy. A second measurement of clock web cold-build came in at
291 s vs 174 s in the previous step — same Dockerfile path, different
network-side latency. Cold build is **not** the optimization target of
this roadmap; warm rebuild is. Run `pnpm store prune` on the host or use
a local registry mirror if cold-build determinism is needed.
Use:
```
time DOCKER_BUILDKIT=1 docker compose build --no-cache backend # cold
touch backend/src/server.ts && time docker compose build backend # warm
Measurement commands:
```bash
# Cold (clear all layer cache; cache mounts may still persist)
time DOCKER_BUILDKIT=1 docker compose build --no-cache backend
# Warm (one source file changed; deps unchanged)
touch backend/src/server.ts
time DOCKER_BUILDKIT=1 docker compose build backend
# Deps-changed (touch package.json; pnpm store cache helps here)
touch backend/package.json
time DOCKER_BUILDKIT=1 docker compose build backend
```
### A8. Config-file COPY audit & canonical pattern (addresses F11, F13)
@ -771,18 +783,21 @@ Checks implemented by `docker-doctor.sh`:
(`common-plat@dd90f709`).
5. **✅ F18 fix** in clock — 4 `file:` refs in `web/package.json` rewritten
to `*` (`clock@8b5c767a3`).
6. **✅ A0-V on clock PASSED.** v6 commit lands here documenting it.
7. **⚳ A8 + A9 + A1** on clock (correctness before speed). Commit.
8. **⚳ A2 + A4 + A5 + A6** on clock. Measure warm-rebuild numbers. Commit.
9. **⚳ Phase A0 → A6** on `learning_ai_peakpulse` (backend only) as validation
second pass.
10. **⚳ A7** — fill in warm-rebuild numbers in metrics table.
11. **⚳ A3 ADR** — decide lockfile policy (defer implementation).
12. **⚳ Phase B** — harden `docker-prep.sh` on clock, then promote to canonical
6. **✅ A0-V on clock PASSED.** v6 commit lands (`devops_tools@7627d55`).
7. **✅ A8 + A9 + A1** on clock (correctness + corepack) — `clock@f6a806ff3`.
Web cold dropped to 174 s; backend essentially flat at 60 s.
F11 guard verified (Tailwind utilities present in CSS bundle).
8. **✅ A2 + A4 + A5 + A6** on clock (cache mount + dockerignore) — `clock@55e8d22d3`.
Warm rebuilds: **backend 2.9 s, web 5.4 s** (9597% reduction).
A7 metrics table populated this commit.
9. **⏸ Phase A0 → A6** on `learning_ai_peakpulse` (backend only) as validation
second pass. **STOP and request approval — different repo, separate audit.**
10. **⚳ A3 ADR** — decide lockfile policy (defer implementation).
11. **⚳ Phase B** — harden `docker-prep.sh` on clock, then promote to canonical
home in common-plat (B7) and sync to peakpulse.
13. **⚳ Phase E** — land `docker-doctor.sh`, wire into CI as warning, then error.
14. **⚳ Phase C** — verification gates C1C9.
15. **⏸ Phase D** — scheduled separately, only after §5 C-gates pass. **STOP
12. **⚳ Phase E** — land `docker-doctor.sh`, wire into CI as warning, then error.
13. **⚳ Phase C** — verification gates C1C9.
14. **⏸ Phase D** — scheduled separately, only after §5 C-gates pass. **STOP
and request approval before starting.**
---