fix(channels): reply via reply_target and improve local Docker cache reuse

This commit is contained in:
Will Sarg 2026-02-17 09:22:01 -05:00
parent 9e0958dee5
commit b8bef379e2
4 changed files with 41 additions and 16 deletions

View file

@ -163,5 +163,7 @@ Note: local `deny` focuses on license/source policy; advisory scanning is handle
### Build cache notes
- Both `Dockerfile` and `dev/ci/Dockerfile` use BuildKit cache mounts for Cargo registry/git data.
- The root `Dockerfile` also caches Rust `target/` (`id=zeroclaw-target`) to speed repeat local image builds.
- Local CI reuses named Docker volumes for Cargo registry/git and target outputs.
- `./dev/ci.sh docker-smoke` and `./dev/ci.sh all` now use `docker buildx` local cache at `.cache/buildx-smoke` when available.
- The CI image keeps Rust toolchain defaults from `rust:1.92-slim` and installs pinned toolchain `1.92.0` (no custom `CARGO_HOME`/`RUSTUP_HOME` overrides), preventing repeated toolchain bootstrapping on each run.

View file

@ -11,12 +11,32 @@ else
fi
compose_cmd=(docker compose -f "$COMPOSE_FILE")
SMOKE_CACHE_DIR="${SMOKE_CACHE_DIR:-.cache/buildx-smoke}"
run_in_ci() {
local cmd="$1"
"${compose_cmd[@]}" run --rm local-ci bash -c "$cmd"
}
build_smoke_image() {
if docker buildx version >/dev/null 2>&1; then
mkdir -p "$SMOKE_CACHE_DIR"
local build_args=(
--load
--target dev
--cache-to "type=local,dest=$SMOKE_CACHE_DIR,mode=max"
-t zeroclaw-local-smoke:latest
.
)
if [ -f "$SMOKE_CACHE_DIR/index.json" ]; then
build_args=(--cache-from "type=local,src=$SMOKE_CACHE_DIR" "${build_args[@]}")
fi
docker buildx build "${build_args[@]}"
else
DOCKER_BUILDKIT=1 docker build --target dev -t zeroclaw-local-smoke:latest .
fi
}
print_help() {
cat <<'EOF'
ZeroClaw Local CI in Docker
@ -88,7 +108,7 @@ case "$1" in
;;
docker-smoke)
docker build --target dev -t zeroclaw-local-smoke:latest .
build_smoke_image
docker run --rm zeroclaw-local-smoke:latest --version
;;
@ -98,7 +118,7 @@ case "$1" in
run_in_ci "cargo build --release --locked --verbose"
run_in_ci "cargo deny check licenses sources"
run_in_ci "cargo audit"
docker build --target dev -t zeroclaw-local-smoke:latest .
build_smoke_image
docker run --rm zeroclaw-local-smoke:latest --version
;;