Skip to content

Engine & CLI: restore missing unpacked layers, fix macOS k8s idle CPU (#989), and add kiri engine (#983) - #996

Merged
libracoder merged 2 commits into
mainfrom
fix/pre-023-engine-k8s-layers
Nov 27, 2026
Merged

libracoder merged 2 commits into
mainfrom
fix/pre-023-engine-k8s-layers

Conversation

@libracoder

Copy link
Copy Markdown
Owner

Summary

  • start-restores-layer (crates/kiri/src/daemon/vmlink.rs, crates/kiri/src/daemon/engine.rs): Evicts stale VmLink::layers entries via forget_layers, re-runs restore_layers, and retries vm.run once when the guest reports layer sha256:… is not unpacked after an unpacked layer directory disappears on disk while the VM stays up.
  • macOS Kubernetes idle CPU (macOS: idle VM burns a full host core while the Kubernetes cluster is running (0.2.2) #989) (crates/kiri/src/daemon/engine.rs, crates/kiri-init/src/linux/hostopts.rs, crates/kiri-init/src/linux/container.rs):
    • Excludes dev.kiri.k8s node containers from mac_bind_sources() and wsl_bind_sources() so kiri-k8s's /Users and /Volumes (and /mnt) hostPath mounts no longer open a 50 ms FSEvents / directory-change watcher across the entire host filesystem.
    • Applies 10 ms timer coalescing (timerslack_ns = 10000000) to kiri-k8s before execve so k3s's dozens of staggered 100 ms watch_progress / kine / cAdvisor tickers coalesce cleanly instead of waking virtual CPUs thousands of times per second.
    • Replaces the 3-second /bin/k3s kubectl get svc -A polling loop in start_k8s_lb with an event-driven kubectl get svc -A --watch-only stream.
  • Engine CLI (Add CLI commands to start, stop and inspect the Kiri engine #983) (crates/kiri/src/engine_cli.rs, crates/kiri/src/main.rs, crates/kiri/src/wsl.rs, crates/kiri-win/src/refuse.rs, crates/kiri-win/src/serve.rs, crates/kiri-win/src/engine.rs):
    • Adds kiri engine start | stop | restart | status [--json] across macOS, Linux, and Windows while preserving kiri start for backwards compatibility.
    • kiri engine status [--json] uses background probes (X-Kiri-Background: 1, and on Windows checks %LOCALAPPDATA%\Kiri\stopped + wsl --list --running --quiet + WaitNamedPipeW without kiri-start) so inspecting engine state never wakes a sleeping VM or boots a stopped WSL distro; exits 0 for running / asleep and 1 for stopped / not_running.
    • Synchronizes kiri-win.exe (window, tray, %LOCALAPPDATA%\Kiri\stopped, and dedicated kiri WSL distro termination) when POST /kiri/stop arrives from the CLI over \\.\pipe\kiri.

Closes #989
Closes #983

@libracoder
libracoder merged commit 31cca96 into main Nov 27, 2026
14 checks passed
@libracoder
libracoder deleted the fix/pre-023-engine-k8s-layers branch November 27, 2026 07:23
libracoder added a commit that referenced this pull request Nov 27, 2026
…#989), and add kiri engine (#983) (#996)

* Start: evict stale VmLink::layers cache and re-send missing unpacked layers

* Engine & CLI: fix macOS k8s idle CPU (#989) and add kiri engine commands (#983)
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.

macOS: idle VM burns a full host core while the Kubernetes cluster is running (0.2.2) Add CLI commands to start, stop and inspect the Kiri engine

1 participant