Skip to content

feat(docker): restore cli_wallet to build and runtime image - #99

Merged
On1x merged 1 commit into
masterfrom
ci/restore-cli-wallet
Apr 28, 2026
Merged

On1x merged 1 commit into
masterfrom
ci/restore-cli-wallet

Conversation

@chiliec

@chiliec chiliec commented Apr 28, 2026 •

Copy link
Copy Markdown
Member

Summary

PR #98 inadvertently dropped cli_wallet from the Docker images. This PR restores it.

What broke in #98

PR #98 replaced make install with cp build/programs/vizd/vizd /usr/local/bin/vizd to skip a hidden recompile of all targets that CMake's install target re-triggers via its implicit dependency on all. That worked — but the previous flow had a useful side-effect: cli_wallet's install rule (programs/cli_wallet/CMakeLists.txt:47) placed it at /usr/local/bin/cli_wallet in the builder, and the multi-stage COPY /usr/local /usr/local shipped it into the runtime image.

Two consequences of removing that flow:

  1. Image content regression. vizblockchain/vizd:latest and :testnet no longer contain /usr/local/bin/cli_wallet. Any docker exec <container> cli_wallet ... workflow operators relied on is broken on latest post-perf(docker): skip make install, copy vizd binary directly #98.
  2. CI coverage gap. The scoped make -j$(nproc) vizd invocation doesn't compile cli_wallet at all, so a compile error inside programs/cli_wallet/ would not fail the Docker build. CI signal on cli_wallet correctness is currently zero.

Fix

Build both targets explicitly and copy both binaries in the final stage:

make -j$(nproc) vizd cli_wallet
...
RUN cp $APPDIR/build/programs/vizd/vizd /usr/local/bin/vizd ;\
    cp $APPDIR/build/programs/cli_wallet/cli_wallet /usr/local/bin/cli_wallet
...
COPY --from=builder /usr/local/bin/vizd       /usr/local/bin/vizd
COPY --from=builder /usr/local/bin/cli_wallet /usr/local/bin/cli_wallet

Applied identically to Dockerfile-production and Dockerfile-testnet. Util programs, tests, and examples remain skipped (they don't ship and aren't operator-facing).

Validation

Check Result
Cold build time 14m18s (vs PR #98 cold 13m14s, +64s for cli_wallet)
Warm rerun time 3m37s
make step on warm rerun 83s (ccache hit — vs 732s cold, ~89% reduction)
Image size 109.14 MB (vs latest 99.59 MB, +9.55 MB compressed)
cli_wallet binary present ✓ /usr/local/bin/cli_wallet confirmed in layer L4
cli_wallet ELF ✓ ELF 64-bit PIE x86-64, BuildID present, 29.18 MB
cli_wallet runtime deps Same set as vizd: libc.so.6, libm.so.6, libgcc_s.so.1, libstdc++.so.6 (all in phusion noble base)

On the warm rerun timing (3m37s vs PR #98's 1m27s)

In PR #98 the rerun fully hit the GHA layer cache for the RUN make step (CACHED). Here, that step re-executed at 83s. The difference comes from BuildKit's content-hash on the build context: the same source produced a slightly different layer key on the rerun, so the layer cache missed and the RUN executed.

That's fine for our purposes — ccache then did the heavy lifting: the from-scratch make would be ~12 minutes, but with ccache hits on every translation unit the compile was reduced to a link pass at 83s. That's the realistic speedup PRs see anyway, since each PR's SHA produces unique layer keys and only ccache (not the layer cache) carries between PRs.

Validation method

Image audit and ELF inspection were done against the registry (Docker Hub manifest API + targeted layer-blob extraction) rather than docker pull/docker run. Same approach as #98's validation.

  • Cold build succeeds
  • Warm build succeeds and re-uses ccache (83s for make step)
  • Both binaries present in final image
  • cli_wallet ELF format and BuildID intact
  • cli_wallet runtime deps satisfied by base image
  • Image size delta matches expected cli_wallet binary footprint

Test plan (post-merge)

  • Pull vizblockchain/vizd:latest, run docker run --rm vizblockchain/vizd:latest cli_wallet --help and confirm wallet starts
  • Pull vizblockchain/vizd:testnet, same check

Related

🤖 Generated with Claude Code

PR #98 stopped shipping cli_wallet by replacing `make install` with a direct
`cp` of the vizd binary. Two side-effects:

1. Image content regression. `vizblockchain/vizd:latest` and `:testnet` no longer
   contained /usr/local/bin/cli_wallet, breaking any `docker exec <container>
   cli_wallet ...` workflow that operators relied on.

2. CI coverage gap. With `make -j$(nproc) vizd` as the only compile invocation,
   syntax errors or compile failures inside programs/cli_wallet/ were silently
   ignored — CI went green even when cli_wallet was broken.

Restore both by building cli_wallet alongside vizd (`make -j$(nproc) vizd
cli_wallet`) and copying the second binary in the final-stage COPY. ccache
keeps the incremental cost low: cli_wallet shares most translation units with
vizd through libraries/wallet, libraries/protocol, and fc.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@On1x
On1x merged commit 301d2df into master Apr 28, 2026
2 checks passed
@chiliec
chiliec deleted the ci/restore-cli-wallet branch August 4, 2026 09:55
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.

2 participants