repowiselibracoder/kiri

Architecture of libracoder/kiri

libracoder/kiri is 435 source files holding 9,869 symbols across 9 modules, written mainly in Rust, JavaScript, Shell. The largest module is crates, with 166 files, and 10 files are entry points into the dependency graph.

How kiri fits together

The docker CLI, Compose and buildx send requests through the Docker Engine API to the kiri daemon, whose API handling is in crates/kiri/src/daemon/api.rs. The daemon's core logic sits in crates/kiri/src/daemon/engine.rs, and the daemon owns the VM. It talks to the guest over vsock using the message types defined in crates/kiri-proto/src/lib.rs. Inside the VM, the guest agent that runs as PID 1, built from crates/kiri-init/src/main.rs, starts each container with a single clone3 call into namespaces and a cgroup. The project does not use runc, a shim or dockerd, and xtask builds the macOS app bundle with the guest kernel and disk template inside it.

Largest modules

  • crates: 166 files and 78,100 lines of code
  • tests: 147 files and 12,623 lines of code
  • scripts: 15 files and 1,086 lines of code
  • bench: 6 files and 137 lines of code
  • packaging: 4 files and 368 lines of code
  • xtask: 3 files and 1,056 lines of code
  • contrib: 2 files and 67 lines of code
  • brand: 1 file and 131 lines of code

Languages

By file count: Rust 163 files, JavaScript 127 files, Shell 40 files, Python 13 files, Swift 2 files.

Documentation

Repowise documents kiri in 312 pages generated from the source, 22 of them written explanations of the repository and its modules. Module guides include:

  • brand: Brand Asset Generation
  • scripts/ci: CI Pipeline Scripts

More on kiri: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos