Yeti_Sidecar: Distributed Herd Orchestration
The Instructor's Perspective
“Farming” isn’t just for the forest. In our lab, we farm compute. When one node (Phoenix) gets overwhelmed, we offload the heavy lifting to the “Herd.” The Yeti_Sidecar is our tactical bridge that makes this possible, allowing us to treat a dozen separate machines as one giant, distributed brain.
🎯 Project Goal
To document and standardize the deployment of the Yeti_Sidecar solution, enabling seamless task offloading and parallel processing across the Ollama Herd.
🏗️ Architecture Overview
The system relies on three primary components:
- The Herd: A collection of compute nodes (NUCs, Workstations, LXCs) running Ollama.
- The Sidecar (Port 11435): A FastAPI-based Docker container on each node that provides host-level command execution and file access.
- The Orchestrator (Phoenix): The central node that dispatches jobs using
parallel_ollama.pyor Ansible playbooks.
The PACE Plan for Compute
- Primary (P): Local execution on Phoenix.
- Alternate (A): Offloading to Gemini (RTX 3090 Ti) for high-VRAM tasks.
- Contingency (C): Parallel dispatch to the entire Ollama Herd.
- Emergency (E): Manual task distribution via SSH.
🛠️ Setup & Deployment Tutorial
1. The Sidecar Script (yeti_sidecar.py)
The sidecar is a lightweight Python API that bridges the container gap. Key features:
/execute: Run shell commands on the host./read//write: Access the host filesystem via a/hostmount./proxy: Forward requests to other local services (like Ollama on 11434).
2. Deploying to the Herd
Use the deploy_yeti_sidecar.sh script to push the sidecar to a new node.
# Usage: ./deploy_yeti_sidecar.sh <IP> <USER> <SSH_KEY> <SUDO_PASS>
./deploy_yeti_sidecar.sh 10.0.1.252 netyeti ~/.ssh/id_rsa "my_secret_pass"What the script does:
- Kills any existing
yeti-sidecarcontainer. - SCPs the
yeti_sidecar.pyscript to/tmp/. - Launches a
python:3.11-slimcontainer with:-v /:/host: Maps the host root to the container’s/host.--privileged: Allows necessary system-level interactions.-p 11435:11435: Exposes the Sidecar API.
3. Maintaining the Herd with Ansible
The “Ollama Herd” is managed via Ansible in /Learning/Ansible Automated Lab Manual/inventory/hosts.ini.
Check Herd Status:
ansible-playbook -i Learning/Ansible Automated Lab Manual/inventory/hosts.ini Learning/Ansible Automated Lab Manual/playbook-check-herd.ymlDispatch a Task:
ansible-playbook -i Learning/Ansible Automated Lab Manual/inventory/hosts.ini Learning/Ansible Automated Lab Manual/playbook-dispatch-task.yml -e "target_node=lab1 task_prompt='Audit the logs'"🚀 Farming Jobs in Parallel
For high-volume LLM tasks, use the parallel_ollama.py script. It reads the node list from Network/Services/YetiPack Cluster.md and distributes a JSON list of tasks across all available workers.
Example Workflow:
- Create
tasks.jsonwith a list of prompts. - Run the orchestrator:
python3 parallel_ollama.py tasks.json - Review the consolidated report in
Parallel_Offloading_Reports.md.
🧠 Knowledge Check
- Why do we mount the host root (
/) to/hostin the Sidecar? - How does the
Parallel_Offloading_Reports.mdhelp with “Orchestrator Review”?
Related: Sparse Page, PACE Plan, Ansible Automation