frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: K7d – Fork live Kubernetes clusters in <1s –> GRPO-train AI on infra

https://github.com/katakate/k7d
2•gbxk•2h ago
Hey HN, Gary here.

Today I want to present k7d which is an Apache 2.0, tight Rust VMM + shim enabling something not possible before: fast forking of live running virtualized multi-node k8s clusters with surviving of in-flight connections.

A 3-VM nodes K8s cluster gets forked in 105ms, and a 50x fork of a 3-VM cluster in 4.1s on a 64GB RAM box.

I have two goals here:

1) enable large scale GRPO/RL training of AI on Kubernetes infra, which IMO is a great playground for reasoning training, besides training a capability that's actually useful. And this requires not only fast episode reset (as you need tens of thousand of multi-turn runs during RL post-training) but also greatly benefits from fast forking so you can do parallel branch exploration, rollback, pruning during RL training. Faithful forks also give you byte-identical starts for the G of GRPO, which gives variance reduction across the group.

2) enable <3s VM snapshot pause/resume/fork of sandboxes with Docker-in-VM, for my other project K7 which provides self-hosted infra for VM sandboxes at scale, with a user-friendly CLI / API / Python SDK, and Kubernetes native.

Besides that, k7d is equipped with:

- A Tree-shaped API for resource management: as you can guess when you fork, even with optimized CoW-page-sharing, you want to properly manage your resources (memory + disk) and hence you need to know how to evict while things run. So I have tree-shaped logic to keep track of how children share pages with parents, and let your AI agent protect a promising tree branch, evict an unpromising one, or let LRU-ish logic auto-evict when resources get tight. This tree-based logic applies both to single VM sandboxes, and to multi-VM clusters on their own Linux bridge.

- Formal verification: of course not all of it, but selected critical subparts of k7d are formally verified: I use Kani for memory arithmetics in the unsafe paths, and Aeneas (with Lean backend) to formally prove the tree-based logic explained above so that eviction never frees a page referenced by a live descendent.

- Latencies as CI: I rigorously keep track of latency for most important operations which remain checked/enforced via a suite of integration tests.

I really tried hard not building my own VMM and first ended up building another backend for K7 than my initial "kfd" (Kata + Firecracker + Devmapper-snapshotter over LVM thin-pool), which I called "kql" for Kata + Qemu + Longhorn. If you know this stack you'll guess it right away: Longhorn is great for cross-node replication so I used it to have my snapshots replicated across nodes, so "snapshot resume" always works / HA. Qemu here is because Longhorn's block storage requirements was incompatible with Firecracker who wants Devmapper-snapshotter, a backend for which I would not want to build myself the cross-node replication logic.

But this "kql" backend yielded forks in 45s due to how Longhorn is built, which was too slow for the users who asked me to enable fast forking for K7.

So this is what pushed me towards k7d, named as "k7's daemon", its own native VMM and shim, replacing both Firecracker/Qemu and Kata at once.

This yields VM sandboxes in K7 which you can fork in under 2-3s, and most of this latency is kubelet overhead, as at the VMM level the warm-fork is actually 5ms.

One security trade-off: the daemon has to be shared across branches of a same tree: that's by design. So you lose Firecracker's Jailer per VM. But I could re-build a similar Jailer per tree, which would be sufficient when a tree isn't shared across tenants, such as when you use branching for RL training. That's just optimizing for something different than what Firecracker does.

The codebase is intentionally tight enough to be audited (<30k LOC for VMM + shim) and I linked a deep-dive blogpost series at the top of the README.

I hope you guys will enjoy it and I'd love contributors and critics.

Thx!

Comments

gbxk•1h ago
And here is the deep-dive blogpost series: https://beci.me/blog

Show HN: Shoehorn – Quantize any model down to run on your machine

https://notactuallytreyanastasio.github.io/shoehorn/
19•rhgraysonii•2h ago•2 comments

Show HN: Openleetcode – local LeetCode runner where tests live in the repo

https://github.com/therepanic/openleetcode
5•therepanic•1h ago•1 comments

Show HN: Saggar, a Mac terminal that keeps sessions and your attention organized

https://saggar.marginalutility.dev/
43•mcclowes•1d ago•48 comments

Show HN: Go CLI for website health checks, zero dependencies

https://github.com/atillalab/site-health
3•mehmetkose•2h ago•0 comments

Show HN: Singular – local orchestration for autonomous coding agents

https://github.com/alex-reysa/singular-lite
7•alexreysa•1h ago•2 comments

Show HN: Agent-codemode – scripts your agent writes can call your MCP servers

https://github.com/janwilmake/agent-codemode
3•janwilmake•1h ago•0 comments

Show HN: Imgoci – format for publishing OS images to an OCI registry

https://github.com/imgoci/spec
2•aliasxneo•1h ago•0 comments

Show HN: Phone-harness – let your agent control your phone

https://github.com/ShawnPana/phone-harness
2•shawnpana•2h ago•0 comments

Show HN: TurnKeeper – Fair, explainable team rotations for Slack (no AI)

https://getturnkeeper.com/
2•adriankurz•2h ago•0 comments

Show HN: Termaxa – my agent gate passed its security rig, failed a two-user test

https://github.com/termaxa/termaxa
2•devdoc83•2h ago•1 comments

Show HN: Tracelint – a linter for AI agent traces, no LLM judge

https://github.com/AshwinUgale/tracelint
3•Ashwin1121•2h ago•0 comments

Show HN: I benchmarked LLMs on predicting knife steel properties

https://github.com/Steel-predictor-project/steel-llm-eval
2•p-s-v•2h ago•0 comments

Show HN: A local MitM proxy to control TLS fingerprints

https://github.com/ytkoka/impersonate-proxy
18•ytkoka•4h ago•4 comments

Show HN: K7d – Fork live Kubernetes clusters in <1s –> GRPO-train AI on infra

https://github.com/katakate/k7d
2•gbxk•2h ago•1 comments

Show HN: Robot or Meatbag?

https://meatbag.atomic14.com/
3•iamflimflam1•3h ago•0 comments

Show HN: I wrapped iOS 27's on-device AI into an offline live captioning app

https://testflight.apple.com/join/pQKnQgZZ
5•markmatsushima•3h ago•1 comments

Show HN: Desktopcolors.com – A museum for solid background colors of classic OS

https://desktopcolors.com
157•vlowrian•1d ago•70 comments

Show HN: Figranium – Dockerized, API-first, block-based browser automation

https://github.com/figranium/figranium
3•asernasr•3h ago•2 comments

Show HN: Stunt – a stunt double for the APIs you integrate (95 adapters)

https://github.com/stuntapi/stunt
2•polymatto•3h ago•0 comments

Show HN: Rataflow – React Flow, but for the Terminal (Rust/Ratatui)

https://github.com/furkankly/rataflow
3•furkankly•3h ago•0 comments

Show HN: Leviath – Structured context regions for LLM agents, in one Rust binary

https://leviath.dev
3•gemisis•3h ago•0 comments

Show HN: NinethirtyAI – A US equity research and analysis platform

https://ninethirty.ai/drmarket/
4•askyashu•4h ago•0 comments

Show HN: LumoTray for Mac

https://lumotray.com/mac/
3•lgl•4h ago•0 comments

Show HN: Glade API – Amazon data for every build

https://gladeapi.com
3•qwikhost•4h ago•0 comments

Show HN: Europe Robotics Map – An open source map of robotics companies

https://europeroboticsmap.com/
2•ahmed_sulajman•4h ago•0 comments

Show HN: PhysiClaw – an AI agent that physically operates an iPhone

https://github.com/physiclaw/PhysiClaw
2•qiaoqian•4h ago•1 comments

Show HN: A searchable index of GitHub's lists that shows what's dead

https://awesome.donld.me/
2•donald_sh•4h ago•0 comments

Show HN: Engrava – a local graph memory database for AI agents (SQLite, MIT)

https://github.com/sovantica/engrava
4•przemarzec•4h ago•0 comments

Show HN: Dreadsweeper – Minesweeper Raycasted

https://dreadsweeper.franzai.com/
4•franze•5h ago•1 comments

Show HN: AirStats – Mac menu bar system monitor, 0.046% CPU idle, MIT

https://github.com/byrencheema/airstats
3•byrencodes•6h ago•0 comments