Weavers
Weavers are ephemeral, container-based execution environments that run Loom CLI sessions in isolated Kubernetes pods. They enable:- Remote Development: Code from anywhere without local setup
- Clean Environments: Fresh container per session with custom images
- Resource Isolation: CPU/memory limits per weaver
- Automatic Cleanup: TTL-based lifecycle management
- Git Integration: Clone repositories on creation
Architecture
loom-cli: User-facing commands (new,attach,ps,delete)loom-server-weaver: Provisioning logic and cleanuploom-server-k8s: Kubernetes client wrapper- Kubernetes: Pod orchestration and lifecycle
Quick Start
Create a weaver
- Creates a Kubernetes pod
- Waits for pod to be ready
- Attaches to the weaver terminal
CLI Commands
Create Weaver
Container image to useDefault:
ghcr.io/ghuntley/loom/weaver:latestOrganization ID for the weaverDefaults to your personal organization if not specified.
Git repository to clone (public HTTPS URL)Example:
https://github.com/user/projectBranch to checkout after cloningDefault: Repository default branch
Environment variable for the containerCan be specified multiple times:
Lifetime in hours (max: 48)Default: 4 hoursWeaver is automatically deleted when TTL expires.
List Weavers
Attach to Weaver
Ctrl+D or exit to detach.
Attaching does NOT create a new session. Multiple users can attach to the same weaver simultaneously.
Delete Weaver
Server API
Create Weaver
List Weavers
Get Weaver Status
Attach Terminal (WebSocket)
- Client sends stdin as text frames
- Server sends stdout/stderr as text frames
- Resize events as JSON:
{"type": "resize", "rows": 24, "cols": 80}
Delete Weaver
Lifecycle Management
Status States
Automatic Cleanup
TheWeaverCleanupJob runs every 60 seconds to:
- Query all weavers from database
- Check if
created_at + lifetime_hours > now - Delete expired weavers via Kubernetes API
- Remove database records
Kubernetes Integration
Pod Specification
Weavers are created as Kubernetes Pods with:Resource Limits
Default limits (configurable per deployment):Namespace Setup
Server validates the namespace on startup:Weaver Images
A weaver image must:- Include
loombinary in$PATH - Run a persistent process (e.g.,
loomREPL) - Accept terminal connections
Official Image
Custom Images
You can use any image that:- Runs a shell or REPL
- Has development tools installed
- Optionally pre-installs dependencies
Git Repository Cloning
When--repo is specified:
- Weaver starts in empty workspace
- Loom automatically runs:
git clone {repo} - If
--branchprovided:git checkout {branch} - Workspace root set to cloned directory
Security Considerations
Isolation
- Each weaver runs in a separate pod
- Network policies can restrict pod-to-pod communication
- No persistent volumes by default
Image Trust
Always use trusted images:Secrets Management
- Use
loom-weaver-secretscrate for secure secret injection - Avoid passing secrets via
--env(visible in pod spec) - Use Kubernetes Secrets for sensitive data
Troubleshooting
Weaver stuck in Pending
Weaver stuck in Pending
Check pod status:Common causes:
- Image pull failure (check
events) - Insufficient cluster resources
- Invalid image name
Weaver immediately shows Succeeded
Weaver immediately shows Succeeded
The container exited because it has no long-running process.Fix:
- Ensure image has
ENTRYPOINTorCMDthat blocks - Use
loomREPL as the main process
Cannot attach to weaver
Cannot attach to weaver
Check if pod is running:View logs:
Weaver deleted before TTL expired
Weaver deleted before TTL expired
Check server logs:Possible causes:
- Manual deletion
- Server restart with TTL recalculation
- Database inconsistency
Advanced Usage
SSH Access
- WireGuard tunnel configured (
loom tunnel up) - SSH server running in weaver image
WireGuard Tunnel
Webhook Notifications
Configure webhooks for weaver lifecycle events:Performance Tuning
Pod Startup Time
Reduce cold start latency:- Use smaller base images (Alpine, distroless)
- Pre-pull images on cluster nodes
- Increase pod resource requests