Repository navigation
feat(deploy): support external Redis and Valkey installations - #674
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- External Redis/Valkey installer path —
install.shadds a cache prompt, validatesredis:///rediss://input, single-quotes the dotenv value (escaping'so$and quotes in credentials survive), and derives--scale valkey=0from the effective.env. - Upgrade inference —
upgrade.shreadsREDIS_URLfrom.env(blank/''/""→ bundled) and re-applies--scale valkey=0, unsets any shell override so the saved file wins. - Compose dependency relaxation —
required: falseadded to thevalkeyhealthcheck dependency for all three dependents (api,realtime,agent-runner) so scaling valkey to 0 resolves cleanly. - Docs — external Redis setup, reachability, saved-config precedence, and no-data-migration caveat.
- Tests/CI — new stdlib suite exercising the real scripts against real
docker compose config, wired into ascripts-pr-cijob.
I ran the new suite locally against Compose v5.1.3 (no daemon): all 9 tests pass. I also confirmed every service that depends on valkey was patched (no missed dependent), and that single-quoted dotenv values with \' and literal $ round-trip through compose config correctly. Per the Compose spec, required: false only downgrades an absent dependency to a warning, so the bundled default still waits on Valkey health — no regression there.
One non-blocking note, consistent with the existing DATABASE_URL inference: an .env where REDIS_URL points at the bundled valkey (redis://valkey:6379/0) would make upgrade.sh scale Valkey to 0. That is only reachable by hand-editing .env (the installer writes it blank for bundled), so it is not worth a change here — just documenting the behavior.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
pikann
left a comment
There was a problem hiding this comment.
LGTM! Thank you for the contribution! 🚀

Summary
Allow production installs to use an external Redis-compatible server for cache, pub/sub, and event streams without keeping the bundled Valkey container running. This implements the Redis/Valkey slice of #478; external gateway support and the rest of that request remain out of scope.
Refs #478.
Changes
install.shoffers bundled or external Redis/Valkey. A suppliedREDIS_URLselects external by default; external URLs require a non-emptyredis://orrediss://form. Connection strings are not printed by the installer. Single-quoted dotenv serialization preserves literal dollars and quotes in credentials.--scale valkey=0from the saved.env. Empty, quoted-empty, and absent values retain bundled Valkey. Keeping an existing.envrespects that file, and both scripts remove a shell-onlyREDIS_URLinput before invoking Compose so runtime routing agrees with persisted scaling.Validation
master: all three URL fixtures are lost from the generated.env.python3 scripts/tests/test_external_valkey.py: 9 tests passed. Covers bundled defaults; plain/TLS URLs; literal dollar and quote preservation; no-start output; invalid input; retained configuration; repeated upgrades; existing unquoted URLs; and missing/blank/quoted-blank values.install-smokeandupgrade-smokeshell steps locally, including their migration and scaling assertions, with release downloads served from checkout fixtures and container operations stubbed: passed.bash -n, ShellCheck 0.11.0, actionlint 1.7.7 (including ShellCheck), Python Ruff checks/formatting, andgit diff --check: passed.These tests execute the actual installer/upgrader and real Docker Compose v2 configuration parsing, but stub image pulls, container startup, and release downloads. No live Redis service or full container stack was started; runtime connectivity, TLS handshakes, and existing-data migration are not claimed as verified. The frontend/application suites were not rerun for this deployment-only change.
Type of Change
Checklist
AI-assisted implementation; the stated checks were run locally.