Files
Skald-Circle/run-docker.sh
dguiducciandClaude Opus 5 8bcf09a67e
Nightly Build / build (push) Successful in 7m13s
chore: delete scripts/ and cut requirements.txt down to its real consumers
scripts/ held the pre-marketplace MCP servers (gmail, gcal, gmaps, ssh, weather,
google_trends, whatsapp, serpapi_flights). Nothing referenced them any more:
connectors are admin-curated and installed into connectors/ from the
marketplace, and ci/package.sh never shipped scripts/ in the first place — so on
every installed box requirements.txt was pulling google-auth, googlemaps,
paramiko, trendspyg and friends for files that did not exist there.

requirements.txt now states what it is actually for: the two TTS plugins, which
spawn a bare `python3` on an embedded server script and so have no dependency
reconciler of their own. A connector's deps stay with the connector —
`ensure_installed` puts them in .pydeps/node_modules inside the user's
container, `ensure_installed_host` beside the files for a global one.

The venv itself stays load-bearing for those two plugins and for the host pip
that installs a global connector's deps, so the run/install/update scripts keep
creating it — but their "Python MCP servers will be unavailable" warning was
naming the one thing that no longer depends on it, and now says what really
breaks.

CONNECTOR_MANIFEST_GUIDE.md moves to the repo root: it was the one thing in
scripts/ still referenced (CLAUDE.md), and being under a gitignored directory it
had never been committed at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 22:19:01 +01:00

56 lines
2.2 KiB
Bash

#!/usr/bin/env sh
# Docker supervisor loop.
# Runs the pre-built binary directly. On exit -1 (self-rewrite request),
# rebuilds with cargo and restarts. On clean exit (0), stops.
set -u
cd "$(dirname "$0")"
# ── Python venv setup (optional) ─────────────────────────────────────────────
VENV_DIR=".venv"
REQUIREMENTS="requirements.txt"
# A venv is usable only if python3 AND pip both work. Ubuntu's `python3 -m venv`
# without the python3-venv package leaves a venv with python3 but no pip — detect
# that and recreate, so a broken venv never survives a restart.
if [ -f "$REQUIREMENTS" ] && { [ ! -f "$VENV_DIR/bin/python3" ] || ! "$VENV_DIR/bin/python3" -m pip --version >/dev/null 2>&1; }; then
rm -rf "$VENV_DIR"
if command -v uv >/dev/null 2>&1; then
echo "[run-docker.sh] Setting up Python venv with uv …"
uv venv --seed "$VENV_DIR" && uv pip install -r "$REQUIREMENTS" \
&& echo "[run-docker.sh] Python venv ready." \
|| echo "[run-docker.sh] Warning: Python venv setup failed — the TTS plugins and host-run connectors will be unavailable."
elif command -v python3 >/dev/null 2>&1; then
echo "[run-docker.sh] Setting up Python venv …"
python3 -m venv "$VENV_DIR" && "$VENV_DIR/bin/pip" install -r "$REQUIREMENTS" \
&& echo "[run-docker.sh] Python venv ready." \
|| echo "[run-docker.sh] Warning: Python venv setup failed — the TTS plugins and host-run connectors will be unavailable."
fi
fi
if [ -f "$VENV_DIR/bin/python3" ]; then
export PATH="$(pwd)/$VENV_DIR/bin:$PATH"
fi
export TS_RS_EXPERIMENT=this_is_unstable_software
BINARY="./skald"
while true; do
"$BINARY"
code=$?
if [ "$code" -eq 0 ]; then
echo "[run-docker.sh] App exited cleanly. Stopping."
exit 0
elif [ "$code" -eq 255 ]; then
echo "[run-docker.sh] App requested restart (exit -1). Rebuilding…"
RUSTFLAGS="-A warnings" cargo build --release --no-default-features \
&& cp target/release/skald "$BINARY"
else
echo "[run-docker.sh] App exited with code $code. Stopping."
exit "$code"
fi
done