Skip to content

ci(deploy): provision local Redis + REDIS_URL in the backend deploy - #158

Merged
DIodide merged 1 commit into
stagingfrom
chore/prod-redis-provisioning
Jul 3, 2026
Merged

ci(deploy): provision local Redis + REDIS_URL in the backend deploy#158
DIodide merged 1 commit into
stagingfrom
chore/prod-redis-provisioning

Conversation

@DIodide

@DIodide DIodide commented Jul 3, 2026

Copy link
Copy Markdown
Owner

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_KEY deploy path).

What

backend-cd.yml now, before restarting the service:

  • ensures a local redis6 is installed + enabled + running on the host (idempotent; AL2023 dnf → AL2 amazon-linux-extrasyum fallback). Best-effort — a Redis hiccup never fails the deploy.
  • sets REDIS_URL in the host-managed .env if 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

No app code changed; YAML + shell validated.

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.
@DIodide
DIodide merged commit 1f56a79 into staging Jul 3, 2026
4 checks passed
@DIodide
DIodide deleted the chore/prod-redis-provisioning branch July 3, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant