docs(platform): document the cache and coordination engine (Redis / Valkey) - #14048
Open
daric93 wants to merge 4 commits into
Open
docs(platform): document the cache and coordination engine (Redis / Valkey)#14048daric93 wants to merge 4 commits into
daric93 wants to merge 4 commits into
Conversation
The self-hosting docs never described the Redis-compatible layer the platform depends on, so two things were invisible to self-hosters: - The backend always connects with a cluster client (`RedisClient = RedisCluster`), so a standalone node cannot work. Nothing said so, and the failure mode is a confusing connection error. - The two distributions already run different engines — the Compose stack ships `redis:7`, the single-container image runs Valkey — which is only discoverable by reading the Compose file and the entrypoint. Adds a "Cache and coordination engine" section to Advanced Setup covering the required topology, how to substitute Valkey into the Compose stack via an override file, what a managed or external deployment must support, and the engine version floor implied by the commands the backend issues. Every load-bearing claim was verified against a running stack rather than read off the source: - The Valkey image ships `redis-server`/`redis-cli` as symlinks, so the Compose command lines and health checks work unaltered. - `user: "999:999"` is required in the override. Valkey's entrypoint only drops privileges when invoked as `valkey-server`, and the Compose command lines call the `redis-server` symlink — without the pin the shards run as root, which stock `redis:7` does not. uid 999 is `redis` in `redis:7` and `valkey` in `valkey/valkey:8.1`, so the numeric form is correct for both. - `REDIS_HOST`/`REDIS_PORT` are hardcoded in `x-backend-env`, so neither shell environment nor `backend/.env` can move them; `REDIS_PASSWORD` is not in that block and so does work from `backend/.env`. - `docker compose up -d db rabbitmq clamav falkordb migrate` starts without pulling in the bundled shards. Also corrects the `make start-core` row in the self-hosting guide: it brings up PostgreSQL, the three-shard cache cluster, RabbitMQ, FalkorDB and ClamAV and runs migrations — not "Supabase, Redis, RabbitMQ".
The section landed with Valkey as a substitution recipe buried behind a docker-compose.override.yml. It is more than that: Valkey is the engine inside the single-container distribution and now selectable in the Compose stack via REDIS_IMAGE, so present it as an alternative readers can pick on operational grounds. - Lead with Redis-as-default / Valkey-as-tested-alternative plus a comparison table of where each engine is used. - Replace the override recipe with the REDIS_IMAGE one-liner, and say which .env file compose actually interpolates from. - Keep the uid 999 privilege-drop caveat as a hint, since it still applies to anyone writing their own override. - Note the earlier-checkout fallback, so the page is usable before REDIS_IMAGE exists. - Generalise the managed-deployment guidance: ElastiCache and Memorystore both offer Redis- and Valkey-flavoured clusters. Depends on the backend change that adds REDIS_IMAGE.
Address review nit: the row was ~2.5x longer than its peers, stretching the rendered column. Drops "just" and "the three-shard" — the shard count is already documented in advanced_setup.md.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The section documented REDIS_IMAGE, a variable that does not exist on dev, which coupled this page to a separate config PR. Describe what works on the current codebase instead: a docker-compose.override.yml setting image and user on the three shards and the init sidecar. Two further claims were dependent on that same unmerged change and are now corrected rather than deferred: - the comparison table credited Valkey with an advisory backend CI leg. Valkey's real coverage today is the single-container image, which platform-single-container-docker.yml builds and smoke-tests on every change under autogpt_platform/. - the uid 999 note said the pin lives in the Compose file. It does not; it is something the reader has to supply in the override, so it is now a warning on the override itself rather than an aside. The uid 999 requirement is the sharp edge here and it fails silently, so it is stated where someone writing the override will hit it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why / What / How
Why. The self-hosting docs never described the Redis-compatible engine the platform depends on for caching, distributed locking, rate limiting, spend counters and the SSE streams that carry agent output to the browser. Two consequences were invisible to self-hosters:
backend/data/redis_client.pysetsRedisClient = RedisClusterunconditionally, so a single standalone node cannot work. Nothing in the docs said so, and the failure mode is an opaque connection error.redis:7; the single-container image runs Valkey. That was only discoverable by readingdocker-compose.platform.ymlandsingle-container/entrypoint.sh.A self-hoster pointing the platform at ElastiCache, Memorystore or any single-node instance currently has to read the client, the Compose file and the entrypoint to discover all of this.
What. Adds a Cache and coordination engine section to Advanced Setup, between Database selection and AutoGPT Agent Server Advanced set up.
How. The section is organised around what a reader actually has to decide: which engine, what topology it must provide, how to select it locally, and what a managed deployment has to support. Everything it describes works on
devas it stands today — no accompanying code change is required.Changes 🏗️
docs/platform/advanced_setup.md— new Cache and coordination engine section covering:docker-compose.override.yml, including the uid 999 requirement belowREDIS_USE_ANNOUNCED_ADDRESS, and which file the backend actually readsREDIS_HOST/REDIS_PORTfromThe page does not claim Valkey is better, and does not assert specific licence terms — both projects' licensing has changed, so it tells readers to check the licence of the tag they pin.
redis:7remains the Compose default and the engine every backend CI leg covers.docs/platform/getting-started.md— themake start-corerow claimed it starts "Postgres, Redis, RabbitMQ". It actually starts PostgreSQL, the three-shard cache cluster, RabbitMQ, FalkorDB and ClamAV, and runs migrations.No code or Compose changes here; this PR is docs only.
The one sharp edge, and why it's a warning block
Switching the shard image alone silently runs the cluster as root. Both images gate their privilege drop on being invoked as their own server binary —
redis-serverfor Redis,valkey-serverfor Valkey — and the Compose command lines callredis-server, which is a symlink under Valkey. Stockredis:7drops to uid 999 by itself, so this only bites after switching engines, and nothing surfaces it. The override snippet therefore carriesuser: "999:999"on all four services, with a warning explaining why. uid 999 isredisinredis:7andvalkeyinvalkey/valkey:8.1and owns the/dataworkdir wherenodes.confis written, so the single numeric value is correct for either engine.Checklist 📋
For code changes:
Docs-only PR — no code, Compose or configuration changes. Every load-bearing claim was still verified against a running stack rather than read off the source.
docker compose up -d redis-0 redis-1 redis-2 redis-initreachescluster_state:okon Valkey,uid=999,nodes.confwritten and correctly owned, seed healthcheckhealthyuser: "999:999"must stay quoted — unquoted it is a YAML 1.1 sexagesimal integer, not the string Compose needsuser:, the shards run as root on Valkey; stockredis:7drops to uid 999 unaided. Verifiedgetent passwd 999→redisinredis:7,valkeyinvalkey/valkey:8.1, and ran both under--user 999:999with the real cluster command lineredis-server/redis-clias symlinks, so the Compose command lines and health checks work unalteredREDIS_HOST/REDIS_PORTmust be changed in thex-backend-envblock — they are hardcoded there, so Compose's shell-environment precedence does not apply. All nine services that read them take them from that block and none sets them separatelyREDIS_PASSWORDdoes work frombackend/.env— it is absent fromx-backend-envand commented out in.env.defaultdocker compose up -d db rabbitmq clamav falkordb migrateavoids the bundled shards — mergeddepends_onfor those five references noredis-*, and none carries aprofiles:keyplatform-single-container-docker.ymlbuilds and smoke-tests the single-container image on every push and PR touchingautogpt_platform/**EXPIRE … NX,LPOP count,GETEXset the version floor; no Redis modules are used — command inventory across the backend, plus a 46-command compatibility run on a Valkey 8.1 three-shard cluster against aredis:7.4.10control showing zero Valkey-only failuresredis_mode→server_modeinINFO server. Nothing in this repo or in redis-py 5.3.1 reads either field{% hint %}/{% endhint %}balanced (3 open, 3 close, valid styles), all three tables well-formed, and the#engine-version-floorcross-reference resolvesgitbookafter docs(platform): sync dev back into GitBook #14019; no new page added, so noSUMMARY.mdchange is neededFor configuration changes:
Not applicable — no configuration changes in this PR.
Related
dev) proposes aREDIS_IMAGEvariable that would reduce the override in Switching the Compose stack to Valkey to a single environment variable, and adds a Valkey leg to backend CI. This PR does not depend on it — it documents the override that works today. If feat(platform): make the cache engine selectable via REDIS_IMAGE, with a Valkey CI leg #14047 lands, that subsection wants a short follow-up to lead with the one-liner, and the CI row in the comparison table can then credit the backend leg too. The two PRs can be reviewed and merged in either order.Base branch
Targets
gitbook, perdocs/content/contribute/index.md("create a pull request targeting thegitbookbranch"). Retargeting todevisn't an option for this diff —docs/platform/differs between the two branches, so the change is written against thegitbooklayout.Follow-up, deliberately out of scope
The same stale
start-coredescription lives in code, inautogpt_platform/Makefile(the header comment and thehelptext). Not touched here because this branch is docs-only and targetsgitbook.