runqy Worker¶
The runqy worker (runqy-worker) is a Go binary that processes tasks from Redis and supervises Python processes.
Prerequisites¶
The worker requires a Python runtime to execute task code:
| Requirement | Description |
|---|---|
| Python 3.8+ | With the venv module installed |
| Git | For cloning task code repositories |
Python venv module¶
The worker creates virtual environments for task isolation. On some Linux distributions, the venv module is a separate package:
Alternative: Use uv (recommended)¶
uv is a fast Python package installer that can also create virtual environments. If installed, the worker will automatically use it instead of python -m venv:
# Install uv (cross-platform)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or with pip
pip install uv
Benefits of uv:
- Much faster venv creation
- Doesn't require the
venvmodule - Faster dependency installation when used with
requirements.txt
Overview¶
The worker:
- Bootstraps by registering with the server and deploying task code
- Supervises a Python process for task execution
- Processes tasks from Redis queues
- Reports health status via heartbeat
Installation¶
Binary Download¶
Download pre-built binaries from the GitHub releases page.
Docker¶
Docker images are available at ghcr.io/publikey/runqy-worker.
Lightweight Alpine-based image. You install your own runtime (Python, Node, etc.).
- Image:
ghcr.io/publikey/runqy-worker:latestor:minimal - Base: Alpine 3.19 with git, curl, ca-certificates
- Platforms: linux/amd64, linux/arm64
Pre-configured for ML workloads with PyTorch and CUDA.
- Image:
ghcr.io/publikey/runqy-worker:inference - Base: PyTorch 2.1.0 + CUDA 11.8
- Platform: linux/amd64 only
- Includes: Python 3, pip, PyTorch, CUDA runtime
Available Tags¶
| Tag | Description |
|---|---|
latest, minimal |
Minimal Alpine image (multi-arch) |
inference |
PyTorch + CUDA image (amd64 only) |
<version> |
Specific version, minimal base |
<version>-minimal |
Specific version, minimal base |
<version>-inference |
Specific version, inference base |
From Source¶
git clone https://github.com/Publikey/runqy-worker.git
cd runqy-worker
go build -o runqy-worker ./cmd/worker
Running¶
Lifecycle¶
- Register: Worker calls
POST /worker/registeron the server - Deploy: Clone git repository and set up Python environment
- Start: Spawn Python process using
startup_cmd - Wait: Wait for
{"status": "ready"}from Python - Process: Dequeue tasks, send to Python, write results to Redis
- Heartbeat: Periodically update worker status in Redis
Source Code¶
The worker is implemented in Go (~2500 lines of code):
runqy-worker/
├── cmd/worker/ # Binary entry point
├── internal/
│ ├── bootstrap/ # server_client, code_deploy, process_supervisor
│ ├── handler/ # stdio_handler, oneshot_handler
│ └── redis/ # Redis operations
├── worker.go # Main Worker struct
├── processor.go # Task dequeue loop
└── *.go # handler, task, heartbeat, retry, config