ci(deploy): provision local Redis + REDIS_URL in the backend deploy - #158
Merged
Conversation
Completes the v1.0 "Redis Streams prod setup" as idempotent infrastructure-as- code, so live-following fan-out works on prod/staging without a one-off manual step (and survives host replacement). Matches the documented design: a LOCAL Redis on the EC2 host, never exposed (not ElastiCache). The deploy now, before restarting the service: - ensures redis6 is installed + enabled + running (idempotent; AL2023 dnf → AL2 amazon-linux-extras → yum fallback). Best-effort: a Redis hiccup never fails the deploy (the stream bus is fail-soft). - sets REDIS_URL in the host-managed .env if absent — prod on DB 0, staging on DB 1 (same host's local Redis, logically isolated; keys are per-conversation so cross-env collision is impossible anyway). Runs via the existing SSH deploy path (secrets.EC2_SSH_KEY) — no operator AWS session needed. On merge to staging this configures the staging host; the v1.0 merge to main configures prod. Fail-soft end to end: absent/unreachable Redis just disables fan-out, single-instance streaming is unaffected.
4 tasks
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.
Completes the v1.0 "Redis Streams prod setup" blocker as idempotent infrastructure-as-code — no operator AWS session needed (runs via the existing
EC2_SSH_KEYdeploy path).What
backend-cd.ymlnow, before restarting the service:redis6is installed + enabled + running on the host (idempotent; AL2023dnf→ AL2amazon-linux-extras→yumfallback). Best-effort — a Redis hiccup never fails the deploy.REDIS_URLin the host-managed.envif absent: prod DB 0, staging DB 1 (same host's local Redis, logically isolated).Matches the documented design (infra README: "systemd, local Redis" — not ElastiCache). Fail-soft end to end: absent/unreachable Redis just disables live-following fan-out; single-instance streaming is unaffected — so this is safe.
Rollout
/api/chat/followafter).No app code changed; YAML + shell validated.