Expand description
Phase 2 of supa-charge-akeyless-ci: the intercept/resolve/fall-through
wrapper around plain docker build.
Given a Dockerfile path + build context + build-arg map, this crate:
- computes the
sui_spec::dockerfilecontent-addressedDockerfileGraph; - checks every node’s
content_hashagainst asui_cache::storage::StorageBackend(the same traitsui cache serveruns — seecache); - on a full cache hit, materializes the already-built image via
docker pullinstead of rebuilding —WrapperOutcome::CacheHit; - on any miss (partial or full), shells out to a real
docker buildfor the entire Dockerfile — never a partial cache splice, an explicit non-goal per thesupa-charge-akeyless-ciplan — then back-fills the cache with every node’s hash → image reference for next time —WrapperOutcome::CacheMiss; - on a failing
docker build, returnsWrapperOutcome::BuildFailed— never a panic.
I/O is behind two injectable seams: command::CommandRunner (the
docker subprocess) and sui_cache::storage::StorageBackend (the
cache). Both are mocked in this crate’s tests; production wires the
real command::RealCommandRunner and a real backend built via
sui_cache::storage::build_backend.
Re-exports§
pub use command::CommandOutcome;pub use command::CommandRunError;pub use command::CommandRunner;pub use command::DockerBuildInvocation;pub use command::MockCommandRunner;pub use command::RealCommandRunner;pub use cache::MockCacheBackend;pub use daemon_client::DaemonAwareCacheClient;
Modules§
- cache
- The cache seam this crate consumes.
- command
- Typed
docker buildinvocation + the mockable command-runner seam. - daemon_
client - Daemon-aware cache client — Phase 3b of
supa-charge-akeyless-ci.
Structs§
- Filesystem
Dockerfile Environment - A
DockerfileEnvironmentthat reads the Dockerfile straight off disk — the one production side effect this crate performs beyond the command runner and the cache backend. - Node
Cache Status - Per-node cache status in the receipt — one row per
DockerfileGraphnode. - Wrapper
Config - Typed,
serde-deserializable input to a wrapper run — the keyway-shaped “YAML/JSON in” half of the contract. - Wrapper
Receipt - The typed,
serde-serializable “JSON receipt out” half of the keyway contract.
Enums§
- Wrapper
Error - The one thing that can genuinely fail a wrapper run: the
dockersubprocess could not be spawned at all (e.g. the binary is not on PATH). Everything cache-side degrades to a plain real build (D6) and so is not aWrapperError— seerun_wrapper’s fall-through contract. A failingdocker buildis likewise not aWrapperError; it is the typedWrapperOutcome::BuildFailedinside anOkreceipt. Surfaced as a typed error, never a panic. - Wrapper
Outcome - The typed outcome of one wrapper run.
Functions§
- run_
wrapper - Run the wrapper: consult the cache accelerator and either materialize
a full hit or fall through to a real
docker build.