CraftLab-ctl (Control System & Daemon)
CraftLab-ctl is the supervisor control plane for CraftLab. It consists of the craftctld background daemon, the craftctl operator CLI, an atomic update engine, and an embedded web control dashboard.
Architecture Overview
+---------------------------------------------------------------------------------+| CRAFTLAB-CTL |+---------------------------------------------------------------------------------+| || CLI (craftctl) <-----------> REST / Control Socket <-------> Web Panel (:8443)|| | || v || Daemon Supervisor (craftctld) || | || +----------------------------+----------------------------+ || | | | || v v v || [LifecyclePlugin] [CorePlugin] [UpdatePlugin] || * Service supervisor * Health & Doctor * Releases API || * Process monitor * Paths resolution * Wheel cache || * Uvicorn / Vite runners * Config loader * Rollback manager |+---------------------------------------------------------------------------------+Command-Line Interface (craftctl)
The craftctl executable provides administrative access to service operations:
Service Lifecycle
| Command | Description |
|---|---|
craftctl status | Shows current operational status of backend, frontend, and daemon services. |
craftctl start | Boots managed services (backend API and control endpoints). |
craftctl stop | Gracefully shuts down managed platform services. |
craftctl restart | Performs a clean restart of platform services. |
System Diagnostics
craftctl doctorInspects:
- Virtual environment health and Python dependencies.
- Static assets availability (
frontend_dist/index.htmlandctl_web_dist/index.html). - Database connectivity and write permissions.
- Network port availability (
CRAFTLAB_PORT, control panel port8443).
Atomic Update Engine
CraftLab features a zero-downtime, rollback-safe update system orchestrated by UpdatePlugin:
[GitHub Releases: DarkBladeDev/CraftLab] │ (craftctl update check) │ ▼ Download craftlab-v*.tar.gz │ ▼ Create Isolated Release Venv (/releases/vX.Y.Z) Install Wheels from Cache (/cache/wheels) │ ▼ Switch Symlink (/current -> /releases/vX.Y.Z) Restart Managed ServicesUpdate Commands
- Check for available updates:
Ventana de terminal craftctl update check - Prepare release archive (downloads and validates checksums without applying):
Ventana de terminal craftctl update prepare --version 0.3.3 - Apply update (switches active release and restarts services):
Ventana de terminal craftctl update apply --version 0.3.3 - Rollback to previous release (instant restore if an update fails validation):
Ventana de terminal craftctl update rollback
Web Control Dashboard
craftctld serves a web control dashboard on port 8443:
- Real-Time Service Metrics: Monitor CPU, memory usage, and uptime for managed components.
- One-Click Updates: Trigger release inspection, prepare releases, and execute atomic switches with live terminal output.
- Diagnostics Log: View doctor checks and active release manifests.