gr-mcp/docker/entrypoint.sh
Ryan Malloy 2084c41228 runtime: Phase 1 Docker + XML-RPC control
Add RuntimeProvider with 17 MCP tools for controlling running flowgraphs:
- Container lifecycle: launch, list, stop, remove
- Connection: connect by URL or container name
- Variable control: list, get, set via XML-RPC introspection
- Flowgraph execution: start, stop, lock, unlock
- Visual feedback: screenshot capture, container logs

Docker is optional - 10 tools work without it for external flowgraphs.

Includes:
- DockerMiddleware wrapping docker.DockerClient
- XmlRpcMiddleware wrapping xmlrpc.client.ServerProxy
- Dockerfile with Xvfb + ImageMagick + VNC for headless QT
- 29 new unit tests (71 total)
2026-01-27 09:48:44 -07:00

22 lines
499 B
Bash
Executable File

#!/bin/bash
set -e
# Start Xvfb for headless QT rendering
Xvfb :99 -screen 0 1280x720x24 -ac +extension GLX +render -noreset &
XVFB_PID=$!
# Wait for Xvfb to be ready
while ! xdpyinfo -display :99 >/dev/null 2>&1; do
sleep 0.1
done
echo "Xvfb ready on :99"
# Optional VNC server for visual debugging
if [ "${ENABLE_VNC:-0}" = "1" ]; then
x11vnc -display :99 -forever -nopw -shared -rfbport 5900 &
echo "VNC server on :5900"
fi
# Run the flowgraph (passed as CMD arguments)
exec "$@"