Repository navigation
♻️ Use Valkey instead of Redis - #670
Conversation
Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: Evaline Ju <[email protected]>
Signed-off-by: Evaline Ju <[email protected]>
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
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 stillimage: redis:7, so the Redis integration tests run against Redis 7 while every deployment runs Valkey 9. Considervalkey/valkey:9. - suggestion:
deploy/vm/README.md~L732-746: the dump.rdb warning and the by-hand recovery recipe still say "Redis 7" and usedocker.io/redis:7-alpine. They should usedocker.io/valkey/valkey:9-alpineto matchsetup-vm.sh. It's also worth noting that the swap is one-way: once Valkey 9 rewrites the AOF/RDB, rolling back toredis:7-alpineisn't guaranteed to load it. - nit:
deploy/vm/setup-vm.sh~L243-245: the comment still says "pins a floating:7-alpinetag". - 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' | |||
There was a problem hiding this comment.
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.
Signed-off-by: Evaline Ju <[email protected]>
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
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:14andpackages/control-plane/test/sandbox-redis.test.ts:8still say "CI provides a redis:7 service". That service is nowvalkey/valkey:9.
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]>
…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]>
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]>
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
git commit -s).make lintand the tests for the touched packages pass.docs/page, with the right maturity label (seedocs/CONTRIBUTING-DOCS.md).make check-linkspasses if any Markdown changed.docs/specs/README.mdordocs/adrs/README.md. - N/A