diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea0a6b6..c40f302 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,27 +92,29 @@ jobs: contents: read id-token: write statuses: read - # The broker's exact Redis, 7.0.15 (broker deploy/redis-acl.conf), as on - # co-processor's scratch server. Not a newer 7.x: from 7.2 redis-py's CLIENT - # SETINFO is an ACL denial the broker's grant cannot cover until it upgrades - # (granting it is a required step of that upgrade, per the broker). The - # integration suite runs here in full: db 15, a throwaway ACL user, and briefly - # maxmemory, all of which a service container absorbs. Docker Hub's official - # image via Google's mirror: GitHub's shared runners exhaust Hub's anonymous + # The broker's exact engine, Valkey 7.2.14 (broker#85), as on co-processor's + # scratch server. redis-py sends CLIENT SETINFO on every connect, and 7.2 is + # the first engine that has the command, so the ACL checks it: the broker + # grants it to processor with the engine, and the integration suite's user + # mirrors the grant (tests/test_consumer.py), so a denial here is one the + # broker would log too. A 7.0 rollback reverts this pin and that grant together. + # The integration suite runs here in full: db 15, a throwaway ACL user, and + # briefly maxmemory, all of which a service container absorbs. Valkey's image + # via Google's mirror: GitHub's shared runners exhaust Docker Hub's anonymous # pull limit, and a red main run blocks deploys (#43, tests/test_ci.py). The - # mirror serves only tags it has cached (an old one 404s), and 7.0 is past EOL: - # "manifest unknown" at Initialize containers means 7.0.15 left the cache, not - # a broken commit. The fallback is the runner's apt redis-server: runs-on is - # 24.04 (#81), whose apt redis-server is 7.0.15. Assert the version and wait on - # redis-cli ping (#43). - # broker#85 decides the broker's next Redis; this pin moves with it. + # image is valkey/valkey, the one broker#85 names. The mirror serves only tags + # it has cached: "manifest unknown" at Initialize containers means 7.2.14 left + # the cache, not a broken commit. The fallback is the runner's apt + # valkey-server: runs-on is 24.04 (#81), whose noble-updates carries 7.2.14. + # Assert the version and wait on valkey-cli ping (#43). + # The broker's engine decides this pin; it moves with broker's next one. services: redis: - image: mirror.gcr.io/library/redis:7.0.15 + image: mirror.gcr.io/valkey/valkey:7.2.14 ports: - 6379:6379 options: >- - --health-cmd "redis-cli ping" + --health-cmd "valkey-cli ping" --health-interval 5s --health-timeout 3s --health-retries 10 diff --git a/.skills/patching-hosts b/.skills/patching-hosts index 26ce604..0ccacfc 100644 --- a/.skills/patching-hosts +++ b/.skills/patching-hosts @@ -55,9 +55,10 @@ origin deb.nodesource.com follow origin pkgs.tailscale.com follow hold tailscale tailscale -# The scratch redis-server (localhost:6379, tests and smoke runs only) holds -# nothing to recover, so it gets no datastore line. Its packages stay the -# default `redis` held step: their postinst restarts it. +# The scratch valkey-server (localhost:6379, tests and smoke runs only; Valkey +# 7.2 since #54) holds nothing to recover, so it gets no datastore line. Its +# packages stay the default `redis` held step, which takes valkey-server and +# valkey-tools: their postinst restarts it. # --- owners --------------------------------------------------------------- # The release is an extract with no git origin: its uv.lock is this repo's, diff --git a/.socraticodecontextartifacts.json b/.socraticodecontextartifacts.json index 902c359..a07d6a2 100644 --- a/.socraticodecontextartifacts.json +++ b/.socraticodecontextartifacts.json @@ -63,7 +63,7 @@ { "name": "ci-workflow", "path": "./.github/workflows/ci.yml", - "description": "GitHub Actions: lint, then the full suite against redis 7.0.15 from mirror.gcr.io, with keyless WIF to co-pypi-reader, which mints the co-pypi index token for uv sync." + "description": "GitHub Actions: lint, then the full suite against valkey 7.2.14 from mirror.gcr.io, with keyless WIF to co-pypi-reader, which mints the co-pypi index token for uv sync." }, { "name": "project-config", diff --git a/AGENTS.md b/AGENTS.md index 29a8678..8dd04d6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,11 +34,11 @@ Python 3.12, uv, hatchling src layout, pytest, ruff. |---|---| | VM | exe.dev `co-processor` (8 GB, 2 vCPU), tag `processor` | | Broker | `broker:6379`, by MagicDNS name, never by address. Tailscale runs `--accept-dns=true`, with an OOM drop-in for tailscaled: [docs/NETWORK.md](docs/NETWORK.md#tailscale-dns) | -| Scratch bus | `redis-server` on `localhost:6379` — tests and smoke runs only | +| Scratch bus | `valkey-server` on `localhost:6379` — tests and smoke runs only | | Input | `gs://co-gcs-blobs` (Replicator's raw blobs), read-only | | Output | `gs://co-gcs-processor/blobs/.bin`, write-if-absent, **never deleted** | | Service | systemd unit `processor` ([deploy/processor.service](deploy/processor.service)), as user `processor` (no sudo, not in `docker`, no home), from `/srv/processor/live` → `releases/`, a read-only release `scripts/deploy.sh` builds from a commit on `origin/main` (#2). **Never from a checkout**. [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) | -| CI | [.github/workflows/ci.yml](.github/workflows/ci.yml): lint (ruff, shellcheck), then the full suite (an attested PR: integration only, #147) against `redis:7.0.15`, the broker's, pulled from `mirror.gcr.io`, never anonymously from Docker Hub (#43). Pins, keyless WIF to `co-pypi-reader`, Dependabot (`github-actions` only): [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md#ci-pins-and-dependabot); shell lint: [§ Shell lint](docs/DEPENDENCIES.md#shell-lint) | +| CI | [.github/workflows/ci.yml](.github/workflows/ci.yml): lint (ruff, shellcheck), then the full suite (an attested PR: integration only, #147) against `valkey:7.2.14`, the broker's, pulled from `mirror.gcr.io`, never anonymously from Docker Hub (#43). Pins, keyless WIF to `co-pypi-reader`, Dependabot (`github-actions` only): [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md#ci-pins-and-dependabot); shell lint: [§ Shell lint](docs/DEPENDENCIES.md#shell-lint) | | Lock audit | [.github/workflows/audit.yml](.github/workflows/audit.yml), report-only, outside the deploy gate: [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md#the-lock-audit) | | Status | Check-ins: drift (`processor-drift.timer`, hourly), liveness (`processor run`, 5 min), disk headroom ([deploy/disk-gc/disk-gc.conf](deploy/disk-gc/disk-gc.conf)): [docs/MONITORING.md](docs/MONITORING.md) | | Patching | `automatic` (knob `.skills/patching-hosts`, #113): `-security` daily by unattended-upgrades; the rest in one approved run a week, `Tue 05:00–10:00` UTC. Never a bare `apt-get upgrade`. [docs/PATCHING.md](docs/PATCHING.md#patching) | @@ -77,7 +77,7 @@ Never edit sibling repos (`cannobserv`, `broker`, `watcher`, `replicator`, `arch ```bash bash scripts/co-pypi.sh uv sync # install deps (co-core from the co-pypi index) uv run pytest # tests -uv run pytest -m integration # bus tests against the scratch redis-server +uv run pytest -m integration # bus tests against the scratch valkey-server uv run ruff check . && uv run ruff format --check . bash scripts/shellcheck.sh # our shell scripts, as CI's lint step scripts/deploy.sh [] # ship: CI green, then build a release from origin/main, switch, verify (as exedev) diff --git a/docs/DEPENDENCIES.md b/docs/DEPENDENCIES.md index 6ef03d5..0ad7b77 100644 --- a/docs/DEPENDENCIES.md +++ b/docs/DEPENDENCIES.md @@ -6,7 +6,7 @@ What Processor pins and how each pin moves: the CI workflow's actions and images | Thing | Value | |---|---| -| CI | GitHub Actions [.github/workflows/ci.yml](../.github/workflows/ci.yml) on `ubuntu-24.04`, the node's image: lint (ruff, shellcheck), then the full suite against `redis:7.0.15` (the broker's, not 7.2: CLIENT SETINFO; upstream EOL, the next is broker#85's call), pulled from `mirror.gcr.io`, never anonymously from Docker Hub (#43). An attested PR runs only the integration tier ([§ below](#local-gate-attestation), #147). Keyless WIF to `co-pypi-reader`, whose token only `uv sync` gets (#121), needs the org variable `GCP_WIF_PROVIDER` shared with this repo and a `roles/iam.workloadIdentityUser` binding for `principalSet://…/attribute.repository/CannObserv/processor`. Actions SHA-pinned; Dependabot version updates `github-actions` only, `uv` security updates landed by hand ([§ below](#ci-pins-and-dependabot), #80). Shell lint, with an opt-in pre-commit hook: [§ below](#shell-lint) (#81) | +| CI | GitHub Actions [.github/workflows/ci.yml](../.github/workflows/ci.yml) on `ubuntu-24.04`, the node's image: lint (ruff, shellcheck), then the full suite against `valkey/valkey:7.2.14` (the broker's engine since broker#85, which grants `processor` the CLIENT SETINFO redis-py sends; #54), pulled from `mirror.gcr.io`, never anonymously from Docker Hub (#43). An attested PR runs only the integration tier ([§ below](#local-gate-attestation), #147). Keyless WIF to `co-pypi-reader`, whose token only `uv sync` gets (#121), needs the org variable `GCP_WIF_PROVIDER` shared with this repo and a `roles/iam.workloadIdentityUser` binding for `principalSet://…/attribute.repository/CannObserv/processor`. Actions SHA-pinned; Dependabot version updates `github-actions` only, `uv` security updates landed by hand ([§ below](#ci-pins-and-dependabot), #80). Shell lint, with an opt-in pre-commit hook: [§ below](#shell-lint) (#81) | | Lock audit | [.github/workflows/audit.yml](../.github/workflows/audit.yml): `uv audit --frozen`, report-only, outside the deploy gate (#73). The weekly patch window reads the live lock (#75): [§ below](#the-lock-audit) | ## CI pins and Dependabot @@ -77,7 +77,7 @@ git push origin main # GitHub marks the PR merged - A major passes `tests/test_ci.py`'s floor (`ACTIONS`) as it is. Raising the floor is a PR of its own: never push to Dependabot's branch, since Dependabot stops rebasing a PR someone else has pushed to. - **No deploy:** an action bump touches `.github/` alone, which is outside `RUNTIME_*` ([MONITORING.md § The drift check](MONITORING.md#the-drift-check)). -**The runner image.** Every job in `ci.yml` and `audit.yml` runs on `ubuntu-24.04`, co-processor's image, not `ubuntu-latest`. That is 26.04 now: main's run 41003391205 (2026-10-30) ran on `ubuntu-26.04` (#81, as broker#88). The shell lint and the suite then run on the node's userland, and `test`'s Redis fallback, 24.04's apt `redis-server`, is 7.0.15. `tests/test_ci.py` holds every `runs-on` to one image, and on co-processor holds that image to `/etc/os-release`. So a node upgrade fails the suite there until the pins move with it. +**The runner image.** Every job in `ci.yml` and `audit.yml` runs on `ubuntu-24.04`, co-processor's image, not `ubuntu-latest`. That is 26.04 now: main's run 41003391205 (2026-10-30) ran on `ubuntu-26.04` (#81, as broker#88). The shell lint and the suite then run on the node's userland, and `test`'s bus fallback, 24.04's apt `valkey-server`, is 7.2.14 (`noble-updates`). `tests/test_ci.py` holds every `runs-on` to one image, and on co-processor holds that image to `/etc/os-release`. So a node upgrade fails the suite there until the pins move with it. ## Local-gate attestation diff --git a/docs/PATCHING.md b/docs/PATCHING.md index 117cef5..91733bb 100644 --- a/docs/PATCHING.md +++ b/docs/PATCHING.md @@ -13,7 +13,7 @@ Keeping `co-processor`'s packages current: the posture and its two lanes, the we Posture **`automatic`** since #113 (operator, 2026-11-03; `scheduled` from #77), under gregoryfoster/skills `patching-hosts` ([skills/patching-hosts](../skills/patching-hosts/SKILL.md)), read from the knob [.skills/patching-hosts](../.skills/patching-hosts). Two lanes (the skill's policy.md): -- **Security, daily and unattended.** `apt-daily-upgrade.timer` runs `unattended-upgrade` on `-security` (and the release pocket and ESM security, its stock origins) at **13:00 + up to 60 min UTC**, with needrestart listing restarts and performing none, and `Automatic-Reboot "false"`. Nothing restarts `processor` and nothing reboots: a maintainer script's own restart still happens (the scratch `redis-server`'s). A `-security` libssl or libc leaves the service on the old library until the next deploy, attended run or reboot: the attended run's step 6 picks it up. +- **Security, daily and unattended.** `apt-daily-upgrade.timer` runs `unattended-upgrade` on `-security` (and the release pocket and ESM security, its stock origins) at **13:00 + up to 60 min UTC**, with needrestart listing restarts and performing none, and `Automatic-Reboot "false"`. Nothing restarts `processor` and nothing reboots: a maintainer script's own restart still happens (the scratch `valkey-server`'s). A `-security` libssl or libc leaves the service on the old library until the next deploy, attended run or reboot: the attended run's step 6 picks it up. - **Maintenance, weekly and attended** (`cadence weekly`). The owner approves a run **every week**, in **`Tue 05:00–10:00` UTC**: Monday night Pacific, 21:00–02:00 PST or 22:00–03:00 PDT (operator, 2026-10-26). It takes the security lane's set plus `-updates` plus the followed origins, `--lane maintenance`, and any reboot or restart due. The window opens as the broker's closes (`Mon 23:00–05:00`, CannObserv/broker#67). Both VMs hold the bus link, so the hosts never patch at once and a flap stays attributable to one host. Each run is approved in this repo's session, like the first. **The timers are moved, not only unmasked.** `apply.sh` refuses any step whose span meets `apt-daily-upgrade.timer`'s range, its calendar time plus its random delay, and refuses while either apt service runs. The stock `06:00` + 60 min sits inside the window, so the drop-ins below move it to 13:00, and `apt-daily.timer` (stock: any hour) to 12:00 + 30 min, before it. `tests/test_apt_automatic.py` holds both outside every knob window: a window change that meets them fails CI. **Never a bare `apt-get upgrade`:** it takes every origin. The skill's [run.md](../skills/patching-hosts/references/run.md) is the procedure; this section is what is particular to this host. @@ -27,7 +27,7 @@ Posture **`automatic`** since #113 (operator, 2026-11-03; `scheduled` from #77), | `origin deb.nodesource.com follow` | Node, agent tooling ([§ Patching Node](#patching-node)) | | `origin pkgs.tailscale.com follow`, `hold tailscale tailscale` | Its postinst restarts tailscaled, the only path to the broker, so it is a held step approved on its own | | `owner /srv/processor/live self` | The release has no git origin; its `uv.lock` is this repo's ([§ The lock audit](DEPENDENCIES.md#the-lock-audit)) | -| no `datastore` | The scratch `redis-server` holds test data only. It stays the skill's default `redis` held step, because its postinst restarts it | +| no `datastore` | The scratch `valkey-server` (Valkey 7.2 since #54) holds test data only. It stays the skill's default `redis` held step, which takes `valkey-server` and `valkey-tools`, because its postinst restarts it | | no `quiet` | `processor-drift.timer` ticks drift (`OnUnitActiveSec=1h`), and liveness runs inside the service | **Host files** (compared after each deploy, installed by hand): @@ -63,7 +63,7 @@ The first unattended run reads in `journalctl -u apt-daily-upgrade` and `/var/lo **This host's run** (each sudo step approved in this repo's session; `` = `/var/backups/patching-hosts-`). Run the scripts under `skills/patching-hosts/scripts/` from the deploy checkout's root, pulled: each defaults its knob to `.skills/patching-hosts` at `git rev-parse --show-toplevel`, or else the working directory, and with no knob found it falls back to `automatic`, report-only. 1. `sudo apt-get update`. The maintenance dry run reads the host's lists, which `apt-daily.timer` last refreshed between 12:00 and 12:30 UTC the day before (gregoryfoster/skills#467). -2. `probe.sh --lane maintenance --dry-run-into `, in the background: 0 findings expected, beside a `lists:stale` risk that reads the security archive's own publish date, not when the lists were refreshed (2026-10-26). Read the `redis-server` candidate; it must still be a `7.0.15` build, not Valkey, until #54. +2. `probe.sh --lane maintenance --dry-run-into `, in the background: 0 findings expected, beside a `lists:stale` risk that reads the security archive's own publish date, not when the lists were refreshed (2026-10-26). Read the `valkey-server` candidate; it must be a `7.2` build, the broker's line (#54). Expect the probe to read the scratch server as engine `valkey`, in use, not `dormant` (the skill's `references/datastores.md`; first checked on this host at the 2026-12-01 run). 3. The needrestart proof, as above. 4. `apply.sh --approve --step bulk --lane maintenance --dry-run `, in the background, within 24 h of the dry run. It restarts nothing. With no data store there is no recovery point: `recovery-point.sh` refuses ("nothing to dump"), and the bulk records the before-versions, the rollback path, in the `` it creates and prints. 5. Held steps, each approved, each `apply.sh --approve --step --run `: diff --git a/docs/PROVISIONING.md b/docs/PROVISIONING.md index a6fe9db..4f6646b 100644 --- a/docs/PROVISIONING.md +++ b/docs/PROVISIONING.md @@ -43,7 +43,7 @@ The broker node never holds `processor`'s plaintext; since broker#72 its hourly ```bash REDISCLI_AUTH="$(sed -n 's|^CO_PROCESSOR_BUS_URL=redis://processor:\([^@]*\)@.*|\1|p' /etc/processor/.env)" \ - redis-cli -h broker --user processor PING # PONG + valkey-cli -h broker --user processor PING # PONG ``` 4. Then create the group right away (below). diff --git a/docs/specs/2026-09-29-processor-service-design.md b/docs/specs/2026-09-29-processor-service-design.md index f98776e..0462234 100644 --- a/docs/specs/2026-09-29-processor-service-design.md +++ b/docs/specs/2026-09-29-processor-service-design.md @@ -187,6 +187,15 @@ on `co-processor`. (cannobserv#530, v0.41.0). The outcome record of a stored output logs `output_created` as a log signal only (Section 4). +**Amended 2026-11-27 (the broker's engine is Valkey 7.2.14, processor#54):** +- The broker moved from Redis 7.0.15 to Valkey 7.2.14 (CannObserv/broker#85). + redis-py sends `CLIENT SETINFO` on every connect; 7.2 is the first engine + that has the command, so the ACL checks it, and the broker grants `processor` + `+client|setinfo` with the engine (Section 2's grants). + Processor's code is unchanged. +- The scratch bus on `co-processor` is `valkey-server` 7.2.14, and CI's service + image is `mirror.gcr.io/valkey/valkey:7.2.14` (Section 8). + --- ## Why a new service @@ -282,7 +291,7 @@ processor-version pin on the command; no job API — the bus is the interface. | Principal | Resource | Grant | |---|---|---| -| ACL user `processor` | `content.process` | `+xreadgroup +xack +xautoclaim +xgroup\|create +xlen +xrange +xinfo\|stream +info +ping` | +| ACL user `processor` | `content.process` | `+xreadgroup +xack +xautoclaim +xgroup\|create +xlen +xrange +xinfo\|stream +info +client\|setinfo +ping` | | ACL user `processor` | `content.derived`, `content.process.dlq` | selector `(+xadd ~content.derived ~content.process.dlq)` | | ACL user `processor` | `content.process.dlq` | selector `(+xdel ~content.process.dlq)` | | `co-gcs-processor-writer` | `gs://co-gcs-processor` | `objectCreator` + `objectViewer`; **no delete** — append-only, never deleted | @@ -838,7 +847,7 @@ TDD, red first. (default `exeuntu` image, which ships Claude Code) through exe.dev with `EXE_API_TOKEN`. **Never the `observo-worker` tag**: Observo's rowless-VM orphan sweep reaps by it (`exe.ls(tag=observo-worker)`). -4. First-boot setup: uv + Python 3.12, `redis-server` (scratch bus), the +4. First-boot setup: uv + Python 3.12, `valkey-server` (scratch bus), the Tailscale package, `/etc/processor/` (700). No secrets in the setup script, and no backslashes — `/exec` unescapes them. 5. Join the tailnet with the one-time key, piped over SSH stdin (never argv or diff --git a/pyproject.toml b/pyproject.toml index 2c68deb..2b2e172 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ asyncio_default_fixture_loop_scope = "function" tmp_path_retention_count = 1 tmp_path_retention_policy = "failed" markers = [ - "integration: needs the scratch redis-server on localhost:6379", + "integration: needs the scratch valkey-server on localhost:6379", ] [tool.ruff] diff --git a/scripts/smoke_scratch_bus.py b/scripts/smoke_scratch_bus.py index 79a7454..164424f 100644 --- a/scripts/smoke_scratch_bus.py +++ b/scripts/smoke_scratch_bus.py @@ -8,7 +8,7 @@ What is real, and what is not: -- **Bus:** the scratch ``redis-server`` (``redis://localhost:6379/14``), never the +- **Bus:** the scratch ``valkey-server`` (``redis://localhost:6379/14``), never the broker. ``processor`` must not ``XADD content.process`` there, and a fact for a made-up command would be a fake fact on the real bus. Any other host is refused, and so is a db already holding the streams. The script deletes its streams @@ -72,7 +72,7 @@ async def smoke( ) -> ProcessingCompleteEvent: """Run ``item`` through the consumer on ``redis_url``; return its verified fact.""" if urlparse(redis_url).hostname not in _LOCAL_HOSTS: - raise ValueError(f"not the scratch redis-server: {redis_url!r}") + raise ValueError(f"not the scratch bus: {redis_url!r}") client = redis_client(redis_url, read_block_ms=1000) try: if await client.exists(*_STREAMS): @@ -152,7 +152,7 @@ def main() -> int: """CLI: the production output store, the scratch bus.""" parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) parser.add_argument("--digest", default=DEFAULT_DIGEST, help="a real-corpus input_digest") - parser.add_argument("--bus-url", default=SCRATCH_URL, help="the scratch redis-server") + parser.add_argument("--bus-url", default=SCRATCH_URL, help="the scratch valkey-server") args = parser.parse_args() settings = Settings() output = build_stores(settings).output diff --git a/tests/test_child.py b/tests/test_child.py index a36524f..10c62c1 100644 --- a/tests/test_child.py +++ b/tests/test_child.py @@ -361,7 +361,7 @@ async def test_the_child_cannot_open_a_tcp_connection(tcp_listener: int) -> None @needs_landlock async def test_the_child_cannot_reach_the_scratch_redis_port() -> None: - # The broker's port; the scratch redis-server stands in for it (no control: + # The broker's port; the scratch valkey-server stands in for it (no control: # it may not be running here, and the socket is refused before any connect). result = await _run("try_connect", "AF_INET", ["127.0.0.1", 6379], containment="required") assert result.value == ["denied", errno.EPERM] diff --git a/tests/test_ci.py b/tests/test_ci.py index 7e2f398..a9a6373 100644 --- a/tests/test_ci.py +++ b/tests/test_ci.py @@ -9,12 +9,14 @@ WORKFLOW = Path(__file__).resolve().parent.parent / ".github" / "workflows" / "ci.yml" WIF_SA = "co-pypi-reader@co-gcs.iam.gserviceaccount.com" -# The broker's exact version (broker deploy/redis-acl.conf: "this broker is 7.0.15"). -# Not 7.2: redis-py sends CLIENT SETINFO there, which the broker's ACL cannot grant -# until it upgrades, so a 7.2 container reports denials the broker never sees. -# 7.0 is upstream EOL: broker#85 decides the next version, and this pin moves with it. -# Docker Hub's official image via Google's mirror (#43): see test_image_comes_from_the_mirror. -BROKER_REDIS = "mirror.gcr.io/library/redis:7.0.15" +# The broker's exact engine: Valkey 7.2.14 since broker#85 (processor#54). redis-py +# sends CLIENT SETINFO on every connect, and 7.2 is the first engine that has it, so the +# ACL checks it: the broker grants it with the engine, and the suite's user mirrors that. +# valkey/valkey, the image broker#85 names, via Google's mirror (#43). A 7.0 rollback +# (broker#85) reverts this pin and the grant together: 7.0 refuses +client|setinfo. +BROKER_REDIS = "mirror.gcr.io/valkey/valkey:7.2.14" +# The engine's own client: the image's redis-cli is only a compat symlink. +HEALTH_CMD = '--health-cmd "valkey-cli ping"' MIRROR = "mirror.gcr.io/" AUDIT_WORKFLOW = WORKFLOW.parent / "audit.yml" # co-processor's image: every job runs on it, not ubuntu-latest (#81, as broker#88). @@ -163,8 +165,8 @@ def _runners() -> dict[str, str]: def test_every_job_runs_on_the_nodes_image() -> None: """Not ubuntu-latest, which moved to 26.04 under us (#81, as broker#88): the - shell lint and the suite run on co-processor's userland, and the Redis - fallback above is 24.04's apt redis-server.""" + shell lint and the suite run on co-processor's userland, and the bus's + fallback is 24.04's apt valkey-server, 7.2.14 in noble-updates.""" runners = _runners() assert {"ci.yml:lint", "ci.yml:test", "audit.yml:audit"} <= set(runners) assert set(runners.values()) == {NODE_IMAGE}, runners @@ -220,6 +222,7 @@ def test_the_whole_suite_runs_against_the_brokers_redis(ci: dict) -> None: redis = job["services"]["redis"] assert redis["image"] == BROKER_REDIS assert "6379:6379" in redis["ports"] + assert HEALTH_CMD in redis["options"] runs = [line for line in _runs(job).splitlines() if "pytest" in line] assert runs == [FULL_SUITE, INTEGRATION], "a marker filter would drop the integration tests" diff --git a/tests/test_consumer.py b/tests/test_consumer.py index 6d87d1c..f7e308e 100644 --- a/tests/test_consumer.py +++ b/tests/test_consumer.py @@ -1,11 +1,11 @@ -"""The consumer loop against the scratch redis-server, as broker#75's ACL user (spec §3, §4). +"""The consumer loop against the scratch Valkey, as the broker's ACL user (spec §3, §4). Runs on db 15 (flushed around each test) as a test user holding exactly the grants -broker#75 gives ``processor`` — plus ``+select``, which db-15 isolation needs and the -broker's db-0 user does not. After every test ``ACL LOG`` must hold no denial for -that user: the capture broker#75 asks for, that the consumer issues only granted -commands. Two tests narrow the grant or cap memory on purpose to show ``NOPERM`` and -``OOM`` leave the entry pending rather than dead-lettering it. +the broker gives ``processor`` (broker#75; ``+client|setinfo`` since broker#85) — plus +``+select``, which db-15 isolation needs and the broker's db-0 user does not. After every +test ``ACL LOG`` must hold no denial for that user: the capture broker#75 asks for, that +the consumer issues only granted commands. Two tests narrow the grant or cap memory on +purpose to show ``NOPERM`` and ``OOM`` leave the entry pending rather than dead-lettering it. """ import asyncio @@ -50,10 +50,13 @@ DB = 15 USER, PASSWORD = "processor-test", "scratch-only-not-a-secret" +# Broker deploy/redis-acl.conf's `processor` stanza. +client|setinfo since Valkey 7.2 +# (broker#85, P4): redis-py sends CLIENT SETINFO on every connect, and 7.2 is the first +# engine that has the command, so the ACL checks it (processor#54). GRANTS = [ "~content.process", "~content.process.dlq", "resetchannels", "+xreadgroup", "+xack", "+xautoclaim", "+xgroup|create", "+xlen", "+xrange", - "+xinfo|stream", "+info", "+ping", + "+xinfo|stream", "+info", "+ping", "+client|setinfo", "(+xadd ~content.derived ~content.process.dlq)", "(+xdel ~content.process.dlq)", "+select", # db-15 isolation only; the broker's user lives on db 0 @@ -70,7 +73,7 @@ async def admin(): try: await client.ping() except RedisConnectionError: - pytest.skip("the scratch redis-server is not running on localhost:6379") + pytest.skip("the scratch valkey-server is not running on localhost:6379") await client.flushdb() await client.execute_command("ACL", "LOG", "RESET") yield client diff --git a/tests/test_dlq.py b/tests/test_dlq.py index 406e7ea..2eff81f 100644 --- a/tests/test_dlq.py +++ b/tests/test_dlq.py @@ -19,7 +19,7 @@ async def client(): try: await client.ping() except RedisConnectionError: - pytest.skip("the scratch redis-server is not running on localhost:6379") + pytest.skip("the scratch valkey-server is not running on localhost:6379") await client.flushdb() yield client await client.flushdb() diff --git a/tests/test_main.py b/tests/test_main.py index 23d1557..1ec1cf0 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -51,7 +51,7 @@ async def admin(): try: await client.ping() except RedisConnectionError: - pytest.skip("the scratch redis-server is not running on localhost:6379") + pytest.skip("the scratch valkey-server is not running on localhost:6379") await client.flushdb() yield client await client.flushdb()