Skip to content

perf(box): speed cold docker builds and fix update --check estimates - #260

Open
juul-charles-w wants to merge 3 commits into
lagerdata:mainfrom
juul-charles-w:perf/lager-update-build-improvements
Open

perf(box): speed cold docker builds and fix update --check estimates#260
juul-charles-w wants to merge 3 commits into
lagerdata:mainfrom
juul-charles-w:perf/lager-update-build-improvements

Conversation

@juul-charles-w

Copy link
Copy Markdown
Contributor

Summary

  • Speed cold box image builds: Node from official tarball (with SHASUMS256 verify) instead of apt nodejs npm, pin cryptography==43.0.3 for cp312 wheels, keep flex/bison only in the uldaq layer.
  • Make lager update --check hash the target ref’s Dockerfile/requirements/source tree so forward jumps no longer falsely report ~90s (cached build).
  • BluFi AES: use algorithms.AES (stable across cryptography versions) while keeping main’s CFB decrepit import path; show live Docker build detail on the progress bar.

Test plan

  • pytest test/unit/cli/ cli/tests/ test/unit/blufi/ — pass locally after rebase onto current main
  • Merge-tree vs origin/main clean (rebased again after 3 CI-only main commits)
  • lager update --box <box> --check against a forward jump that changes the Dockerfile → reports fresh build, not cached
  • Cold build on a box (optional): docker builder prune -af then build this Dockerfile; expect Node v20.18.1 and cryptography 43.0.3

Made with Cursor

juul-charles-w and others added 3 commits August 14, 2026 09:13
Replace apt nodejs meta-packages with the official Node binary, bump
cryptography to a cp312 wheel, and hash the target-ref Dockerfile so
forward version jumps no longer report a false ~90s cached estimate.
Also surface live docker-build detail on the progress bar and use
algorithms.AES for BluFi so the crypto bump stays compatible.

Co-authored-by: Cursor <cursoragent@cursor.com>
The at-ref hasher used bash pattern substitution and `printf -v`, both of
which are silently wrong under dash — the digest would never match the
stored working-tree hash on a box whose login shell is /bin/sh, making
every --check report a spurious rebuild.

Rewrite with `git show | sha256sum | sed` and the same `out=$(...)` +
`echo "$out" | sha256sum` composition as the working-tree hasher, so the
two are byte-identical by construction. Add tests that execute both
snippets under `sh` against a fake box layout rather than asserting on
substrings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Main's build-hash now walks ~/box/lager; keep the equivalence tests and
preview assertions aligned so a Dockerfile-only at-ref hasher cannot
regress silently.

Co-authored-by: Cursor <cursoragent@cursor.com>
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