Expand description
Daemon-aware cache client — Phase 3b of supa-charge-akeyless-ci.
DaemonAwareCacheClient implements the same
StorageBackend trait the
plain Phase 2 wrapper already consumes, so wiring it in is a
substitution at construction time, not a change to
crate::run_wrapper or its 8 Phase 2 tests: whoever builds the
Arc<dyn StorageBackend> decides whether that’s a direct remote
backend (today’s default) or this daemon-aware wrapper around one.
Behavior:
get_narinfo/put_narinfofirst try to reach the node-localsui-dockerfile-node-cache-daemonover its Unix domain socket (seesui_dockerfile_node_cache_daemon::default_socket_pathfor the well-known integration-contract path a runner pod must mount the samehostPathvolume at to reach it).- Daemon reachable: routes the request through it. The daemon itself may transparently fall through to the remote tier on a local L0 miss — this client does not duplicate that fetch.
- Daemon unreachable (socket missing, or the connection attempt
fails/times out): falls straight through to the
remotebackend passed at construction, byte-for-byte the same call this client would have made with no daemon awareness at all — the “never require the daemon, always degrade gracefully” contract. put_narinfoalways writes through toremote(so the shared L1/L2 tiers — and every other node’s future local misses — see the new entry), and additionally best-effort informs the daemon (if reachable) so this node’s local L0 is warm without a second round trip on the nextGet. A daemon-Putfailure is logged, never propagated — the remote write already succeeded and is the one that matters for correctness.- Every other
StorageBackendmethod (get_nar/put_nar/delete/list_narinfos) is delegated straight toremoteunchanged — the node cache daemon only speaks the narinfo-shapedGet/Put/Warmprotocol the Dockerfile-graph cache uses.
Structs§
- Daemon
Aware Cache Client - A
StorageBackendthat prefers a node-local daemon and falls through to a direct remote backend when the daemon can’t be reached. See the module docs for the exact per-method contract.
Functions§
- socket_
looks_ present - Probe whether
pathlooks like a live socket file. Used by callers deciding whether to construct aDaemonAwareCacheClientwithSome(path)at all (a pure existence check — the client’s own connect-with-timeout handles the “exists but not accepting” case, so this is a cheap early filter, not the sole gate).