Skip to content

♻️ Use Valkey instead of Redis - #670

Merged
evaline-ju merged 4 commits into
rossoctl:mainfrom
evaline-ju:valkey
Nov 2, 2026
Merged

evaline-ju merged 4 commits into
rossoctl:mainfrom
evaline-ju:valkey

Conversation

@evaline-ju

@evaline-ju evaline-ju commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Redis is RSALv2/SSPLv1 (not OSI) since 7.4; swap the deploy tree to Valkey, the BSD-3 fork. The valkey image ships redis-server/redis-cli symlinks with the same uid/gid, so commands, probes, and securityContext are unchanged.

Migration

Existing deployments pick up the swap on their next apply; data written by Redis 7.x (or Valkey 8+) stays readable, but PVCs written by Redis 8 (RDB v12) need Valkey 8 or newer. The pin here is 9, so a plain apply is enough.

Checklist

  • Commits are signed off (git commit -s).
  • make lint and the tests for the touched packages pass.
  • Docs: changed behavior, flags or environment variables are reflected in the relevant README or
    docs/ page, with the right maturity label (see docs/CONTRIBUTING-DOCS.md).
  • Docs: make check-links passes if any Markdown changed.
  • A new spec or ADR is registered in docs/specs/README.md or docs/adrs/README.md. - N/A

Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: Evaline Ju <[email protected]>
@evaline-ju evaline-ju added the ready-for-ai-review Request automated AI code review from clawgenti label Oct 30, 2026

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The swap is consistent across VM, Compose, k8s base, and knative. The new k8s digest sha256:bf09d58e…ae0b resolves to the current valkey/valkey:9-alpine multi-arch index on Docker Hub, and k8s-kind-e2e passes with the unchanged uid 999/gid 1000 securityContext.

Non-blocking follow-ups (outside the diff hunks):

  • suggestion: .github/workflows/ci.yml:18: the CI service is still image: redis:7, so the Redis integration tests run against Redis 7 while every deployment runs Valkey 9. Consider valkey/valkey:9.
  • suggestion: deploy/vm/README.md ~L732-746: the dump.rdb warning and the by-hand recovery recipe still say "Redis 7" and use docker.io/redis:7-alpine. They should use docker.io/valkey/valkey:9-alpine to match setup-vm.sh. It's also worth noting that the swap is one-way: once Valkey 9 rewrites the AOF/RDB, rolling back to redis:7-alpine isn't guaranteed to load it.
  • nit: deploy/vm/setup-vm.sh ~L243-245: the comment still says "pins a floating :7-alpine tag".
  • nit: harness/src/leaf-result-store.ts:131: "every deployment pins redis:7" is now stale (GETDEL is still fine on Valkey).

@@ -1300,13 +1300,13 @@ done <<'CASES'
MOCK_REDIS_IMAGE=docker.io/redis:6-alpine|image is 'docker.io/redis:6-alpine'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Add a case for what every existing VM host is actually running, so the real upgrade path is covered:

MOCK_REDIS_IMAGE=docker.io/library/redis:7-alpine|image is 'docker.io/library/redis:7-alpine'

This PR triggers that diff (replace on the same named volume), and the cases here only cover redis:6-alpine.

@evaline-ju
evaline-ju merged commit dd918ac into rossoctl:main Nov 2, 2026
17 checks passed
@evaline-ju
evaline-ju deleted the valkey branch November 2, 2026 16:18

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up at 34c4518: all five items from the 5e3b5db review are addressed. The CI service now runs valkey/valkey:9 (the redis-cli ping health check works through the compat symlink). There is a library/redis:7-alpine upgrade case in setup-vm.test.sh, the VM README recovery recipe uses valkey/valkey:9-alpine and has the one-way note, and the stale :7-alpine and redis:7 comments are fixed. No new issues.

  • nit: packages/control-plane/test/refresh-redis.test.ts:14 and packages/control-plane/test/sandbox-redis.test.ts:8 still say "CI provides a redis:7 service". That service is now valkey/valkey:9.

@evaline-ju evaline-ju linked an issue Nov 2, 2026 that may be closed by this pull request
webchang added a commit to webchang/moca that referenced this pull request Nov 3, 2026
Brings in upstream's 24 commits since the last merge: Valkey 9 in place of Redis (rossoctl#670), exec timing (rossoctl#666), both of
IBM Bob's MCP filenames (rossoctl#676), mocactl --show-tools and workloads
list, and the session turn counter.

Conflicts, both in docs on what `sbx up` writes: the SBX0 spec and
the sbx user guide. Resolved by keeping upstream's `.bob/mcp.json`
and `.bob/settings.json` and this branch's OpenCode `skill` deny
(98cc955). The merged code already does both.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
webchang added a commit to webchang/moca that referenced this pull request Nov 4, 2026
…dis 7.4 wrote

Valkey 9 (the base since rossoctl#670) cannot read RDB format 12, which Redis 7.4
writes: on ykt3 (2026-11-04) its AOF load aborted ('Can't handle RDB
format version 12') and redis-0 crash-looped. SBX_REDIS_IMAGE, pinned by
digest, renames the base's valkey image in the generated overlay, so a
namespace with Redis 7.4 data keeps running Redis 7 until a real
migration moves it.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
pdettori pushed a commit that referenced this pull request Nov 13, 2026
Seven faults in deploy/sbx, found operating SBX0 namespaces and their
KVM hosts.

setup.sh:

- Redis had no maxmemory, so one that outgrew its 256 MiB container
  was OOM-killed with every session and sandbox record. redis.conf now
  sets `maxmemory 200mb` and `maxmemory-policy noeviction`: a full Redis
  refuses writes (503 redis_unavailable) and evicts nothing. The Secret
  does not restart redis-0; the RUNBOOK gives the CONFIG SET for a
  running namespace.
- SBX_REDIS_IMAGE (pinned by digest, refused otherwise) renames the
  base's Valkey image in the generated overlay. Valkey 9 (#670) cannot
  read RDB format 12, which Redis 7.4 writes, so a namespace with such
  data crash-loops redis-0 after an upgrade; this keeps it on Redis 7
  until it is migrated.
- One settings hash, over every setting, was stamped on both the
  control plane and the relay, so a template, subject or quota change
  rolled the relay and ended every running Exec. The relay now gets its
  own hash, over only what it reads at boot (the token issuer, the
  in-flight cap, the public keyset, the attach and exec certificates);
  the control plane's is unchanged. Worker tokens need no roll (the
  relay reads them at each attach). The first run after this change
  rolls the relay once.

install-host.sh and [email protected]:

- The last worker's uninstall removed sbx.slice's file without stopping
  it, so systemd kept it loaded until a reboot. It is stopped first.
- The shared unit had Wants=/After=moca-egress.service, so a
  --no-egress worker started whatever egress proxy the host had. The
  dependency is now a per-worker drop-in
  (sbx-worker@<id>.service.d/egress.conf), written only with egress and
  removed by a --no-egress reinstall and by --uninstall; --egress no
  longer warns about CA trust for --no-egress workers.
- The unit ran /usr/local/bin/microvm-worker, the path deploy/microvm's
  P4 worker runs from, so on a host with both one build replaced the
  other. SBX_WORKER_BIN (absolute; default
  /usr/local/libexec/sbx/microvm-worker) is written into ExecStart, and
  a missing binary is refused before systemd is touched.
- The unit fixed SH_GUEST_RAM_MB=256, so a worker on a 4096 MiB
  snapshot was admitted and cgroup-sized for 256 MiB guests. The
  worker's env file now carries the snapshot manifest's guest_ram_mb; a
  snapshot without it is refused, and so is a --budget-mb that cannot
  hold one session ((guest RAM + 32) x 3 + the 1024 MiB reserve).

Tests: setup.test.sh (the rendered redis.conf, the image rename and its
refusal, which pod each change rolls) and install-host.test.sh (the
slice stop, the drop-in, the warning, SBX_WORKER_BIN, the guest RAM and
budget checks). README and RUNBOOK document SBX_REDIS_IMAGE,
SBX_WORKER_BIN, the Redis limit, which change rolls which pod, and a
worker's minimum budget.

SBX_WORKER_BIN must be an absolute path of plain characters (letters, digits, . _ - /), since
ExecStart is rewritten with sed; a test pins the budget check's standby depth and reserve to the
unit's values so they cannot drift.

Refs #734

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy: use Valkey instead of Redis

2 participants