# k7 **Repository Path**: mirrors_spullara/k7 ## Basic Information - **Project Name**: k7 - **Description**: Your own self-hosted infra for lightweight VM sandboxes to safely execute untrusted code. CLI, API, Python SDK. β Star it if you like it! β - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-24 - **Last Updated**: 2025-12-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
KATAKATE
Self-hosted secure VM sandboxes for AI compute at scale
build / run / compose support inside the VM sandbox
- π Multi-node cluster capabilities for distributed workloads
- π Cilium FQDN-based DNS resolution to safely whitelist domains, not just IP blocks
- βοΈ Support other VMM such as Qemu for GPU workloads
π **See [ROADMAP.md](ROADMAP.md) for the complete feature roadmap and project priorities.**
Note: Katakate is currently in beta and under security review. Use with caution for highly sensitive workloads.
# Usage For usage you need: - **Node(s)** that will host the VM sandboxes - **Client** from where to send requests We provide a: - **CLI**: to use on the node(s) directly --> `apt install k7` - **API**: deployed on the (master) node(s) --> `k7 start-api` - **Python SDK**: Python client sync/async talking to API --> `pip install katakate` ## Current requirements ### For the node(s) - Ubuntu (amd64) host. - Hardware virtualization (KVM) available and accessible - Check: `ls /dev/kvm` should exist. - This is typically available on your own Linux machine. - On cloud providers, it varies. - Hetzner (the only one I tested so far) yes for their `Robot` instances only, i.e. "dedicated": robot.hetzner.com. - AWS: only `.metal` EC2 instances. - GCP: virtualization friendly, most instances, with `--enable-nested-virtualization` flag. - Azure: Dv3, Ev3, Dv4, Ev4, Dv5, Ev5. Must be Intel/AMD x86, not ARM. - DigitalOcean: Premium Intel and AMD droplets with nested virtualization enabled. - Others: in general, hardware virtualization is not exposed on cloud VPS, so you'll likely want a dedicated / bare metal. - One raw disk (unformatted, unpartitioned) for the thin-pool that k7 will provision for efficient disk usage of sandboxes. - Use `./utils/wipe-disk.sh /your/disk` to wipe a disk clean before provisioning. DANGER: destructive - it will remove data/partitions/formatting/SWRAID. - Ansible (for installer): ```bash sudo add-apt-repository universe -y sudo apt update sudo apt install -y ansible ``` - Docker and Docker Compose (for the API): ```bash curl -fsSL https://get.docker.com | sh ``` Already tested setups: - Hetzner Robot instance with Ubuntu 24.04, x86_64 arch, booked with 1 extra empty disk `nvme2n1` for the thin-pool provisioning. See the setup guide (PDF): [tutorials/k7_hetzner_node_setup.pdf](tutorials/k7_hetzner_node_setup.pdf). ### For the client Just recent Python. ## Quick Start ### Get your node(s) ready First install `k7` on your Linux server that will host the VMs: ```shell sudo add-apt-repository ppa:katakate.org/k7 sudo apt update sudo apt install k7 ``` Then let `k7` get your node ready with everything: ```console $ k7 install Current task: Reminder about logging out and back in for group changes Installing K7 on 1 host(s)... ββββββββββββββββββββββββββββββββββββββββ 100% 0:01:41 β Installation completed successfully! ``` Optionally pass `-v` for a verbose output. This will install and most importantly connect together the following components: - Kubernetes (K3s prod-ready distribution) - Kata (for container virtualization) - Firecracker (as Virtual Machine Manager) - Jailer (to secure Firecracker VMs further into a chroot) - devmapper snapshotter with thin-pool provisioning of logical volumes for VM efficient disk memory usage Careful design: config updates will not touch your existing Docker or containerd setups. We chose to use K3s' own containerd for minimal disruption. Installation may however overwrite existing installations of K3s, Kata, Firecracker, Jailer. ### CLI Usage You can run workloads directly from the node(s) using the CLI. To create a sandbox, just create a yaml config for it. #### k7.yaml example: ```yaml name: my-sandbox-123 image: alpine:latest namespace: default # Optional: restrict egress egress_whitelist: - "1.1.1.1/32" # Cloudflare DNS - "8.8.8.8/32" # Google DNS # Optional: resource limits limits: cpu: "1" memory: "1Gi" ephemeral-storage: "2Gi" # Optional: run before_script inside the container once at start. Network restrictions apply after the before-script, so you can install packages here, pull git repos, etc before_script: | apk add --no-cache git curl # Optional: load environment variables from a file. These will be available both during the before-script, and in the sandbox env_file: path/to/your/secrets/.env ``` #### Running commands ```bash # Create a sandbox (uses k7.yaml in the current directory by default, but you can also pass: -f myfile.yaml) k7 create # List sandboxes k7 list # Delete a sandbox k7 delete my-sandbox-123 # Delete all sandboxes. You can also pass a namespace k7 delete-all ``` ### API usage If you'd like to manage workloads remotely, just use the API: ```shell # Start API server (containerized and SSL support with Cloudflared) k7 start-api # Generate API key k7 generate-api-key my-key1 ``` Make sure your user is in the `Docker` group to be allowed to start or stop the API. As for generating / listing / revoking keys, you might need `sudo` or `root`. ### Python SDK Usage After your k7 API is up, usage is very simple. Install the Python SDK via: ```shell pip install katakate ``` Or if you want async support: ```shell pip install "katakate[async-sdk]" ``` Then use with: ```python from katakate import Client k7 = Client( endpoint='https://