Start OpenClaw node host on ClawdBox boot

This commit is contained in:
Clawdbot
2026-06-07 14:30:07 +10:00
parent 18f559c4e6
commit 48e30b9d0e
8 changed files with 244 additions and 15 deletions

View File

@@ -11,13 +11,14 @@ This container provides a stable, tool-rich environment for the AI agent to:
## Tools Included
- **Core:** curl, wget, git, jq, yq, unzip, tar, vim/nano, tree, less
- **Dev:** python3 (pip/venv), build-essential, nodejs (v20), npm
- **Dev:** python3 (pip/venv), build-essential, nodejs (v22), npm
- **Python Libraries:** httpie, pyyaml, requests, black, ipython
- **Network:** ping, dnsutils, net-tools, openssh-server/client, sshpass
- **Media:** ffmpeg
- **Monitoring:** htop, tmux, ncdu, strace
- **Kubernetes:** OpenShift CLI (oc)
- **Search:** ripgrep (fast grep alternative)
- **Agent node:** self-starting OpenClaw node host helper for `ClawdBox-CLI`
## Prerequisites
@@ -76,6 +77,14 @@ The `/data` volume preserves data across container restarts:
```
/data/
├── ssh/ # SSH host keys (auto-generated on first run)
├── agents/
│ └── clawd/ # Durable OpenClaw agent workspace and node host
│ ├── bin/ # start/status/stop helpers and openclaw symlink
│ ├── logs/ # node-host logs and pid file
│ ├── notes/ # operator notes
│ ├── src/ # source checkouts and experiments
│ ├── tmp/ # scratch files
│ └── tools/ # persistent tool installs
├── scripts/ # Helper scripts (from ConfigMap, read-only)
│ ├── disk-usage.sh
│ ├── health-check.sh
@@ -92,6 +101,38 @@ The `/data` volume preserves data across container restarts:
**Storage:** 10Gi PersistentVolumeClaim (ReadWriteOnce)
## OpenClaw Node Host
On container startup, ClawdBox keeps SSH as the foreground service and
opportunistically starts an OpenClaw node host named `ClawdBox-CLI` in the
background.
The helper scripts are copied into `/data/agents/clawd/bin/` on each startup:
```bash
start-clawdbox-node
status-clawdbox-node
stop-clawdbox-node
```
The node host installs `openclaw@2026.6.1` under
`/data/agents/clawd/tools/openclaw-node` if it is missing or stale. It gets the
Gateway token from `OPENCLAW_GATEWAY_TOKEN` when set, otherwise from the live
`openclaw` deployment via the mounted kubeconfig.
Useful overrides:
```bash
OPENCLAW_VERSION=2026.6.1
OPENCLAW_GATEWAY_HOST=openclaw.apps.lab.apilab.us
OPENCLAW_GATEWAY_PORT=443
OPENCLAW_GATEWAY_TLS=true
CLAWDBOX_NODE_DISPLAY_NAME=ClawdBox-CLI
```
If node startup fails, the pod still starts and SSH remains available. Check
`/data/agents/clawd/logs/node-host.log` for details.
## Common Tasks
### Quick Operations (Using Makefile)