Skip to content

perf(roadmap): intake's embeddings are cached in a password-protected Valkey in the cluster - #2578

Merged
dan-petty merged 3 commits into
mainfrom
perf/1655-intake-embedding-valkey
Oct 29, 2026
Merged

dan-petty merged 3 commits into
mainfrom
perf/1655-intake-embedding-valkey

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Each round of the roadmap Service and each cluster job is a new process, so intake embedded every item of the roadmap again on each run. The embedder already has a Valkey tier, but the devops ConfigMap named no Valkey, so valkey.url fell back to a localhost address that no pod serves.

  • k8s/llm/valkey-devops.yaml adds devops-cli's cache Valkey in namespace llm. It holds the caches that valkey.url feeds in a pod: the embeddings that EmbeddingsEngine writes and the threat-intelligence reads.
    • It requires the password of Secret llm/valkey-devops-auth.
    • It keeps at most 96 MiB of data under a 128Mi limit, writes no RDB or AOF, and evicts the least recently used key at the bound.
    • Its policy valkey-devops-perimeter admits namespace devops on 6379 and monitoring on 9121, with no egress.
  • It does not share the cache Valkey of Open WebUI, which runs with noeviction so that an evicted token revocation never makes a signed-out token valid again.
  • The devops ConfigMap template sets valkey.url to valkey://valkey-devops.llm.svc.cluster.local:6379/0 and holds no password. devops-default-perimeter lets namespace devops reach llm on 6379 beside the gateway's 4000, and llm-default-perimeter leaves the new pods out.
  • The cluster secret table adds llm/valkey-devops-auth and the key DEVOPS_CLI_VALKEY_PASSWORD of devops/devops-cli, the variable of valkey.password. Both take the keyring-only entry valkey_devops_password; the devops key adopts the live value of llm/valkey-devops-auth, and either entry generates 64 hex on a first push.
  • deploy-stack applies the manifest, the Argo CD project ignores Secret valkey-devops-auth as an orphan, and k8s/README.md lists the Valkey, its perimeter, its bound and its two Secret rows.

Closes #1655

Change: openspec/changes/archive/2026-10-29-1655-intake-embedding-valkey/

@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

  • Embedding requests, counted at the HTTP edge (stub_web) in test_a_second_intake_run_over_settled_items_sends_no_embedding_request_with_the_valkey_cache: two plan runs over the same two settled items and one candidate, each with a new EmbeddingsEngine, send [1, 1] /v1/embeddings requests with no Valkey and [1, 0] with one Valkey that the runs share.
  • uv run devops ci fail-to-pass --base origin/main: 8 tests fail on the base (the four new manifest tests, and the pinned policy, perimeter, deploy-stack and exemption tables), and tests/test_k8s_push_secrets.py does not import there. All pass on the branch.
  • Locally: 1,207 tests in tests/test_k8s_*.py, tests/invariants/ and tests/test_roadmap_intake.py pass after the rebase; every static devops ci gate passes; kube-linter lint k8s/llm/valkey-devops.yaml reports no errors.

Pending a person:

  • Push the two Secrets before Argo CD starts the new pod: devops k8s push-secrets --only llm/valkey-devops-auth --only devops/devops-cli.
  • Once the Service runs, check that one intake candidate sends at most one embedding request, and that devops_cli_embedding_cache_lookups_total{tier="valkey",result="hit"} rises.
  • Review the diff in tuicr (tuicr -r origin/main..HEAD).

… Valkey in the cluster

Each round of the roadmap Service and each cluster job is a new process,
so intake embedded every item of the roadmap again on each run: the
devops ConfigMap named no Valkey, and `valkey.url` fell back to a
localhost address that no pod serves.

- `k8s/llm/valkey-devops.yaml`: a new Valkey for devops-cli's caches in
  the cluster (the embeddings and the threat-intelligence reads). It
  requires the password of Secret `llm/valkey-devops-auth`, keeps at
  most 96 MiB under a 128Mi limit, writes no RDB or AOF, and evicts the
  least recently used key at the bound. Its policy admits namespace
  `devops` on 6379 and `monitoring` on 9121, with no egress.
- The shared cache Valkey runs with noeviction for Open WebUI's state,
  so it can't hold a cache that must evict.
- The devops ConfigMap sets `valkey.url` to the new Valkey, and
  `devops-default-perimeter` lets namespace `devops` reach `llm` on
  6379.
- Secret `devops/devops-cli` carries `DEVOPS_CLI_VALKEY_PASSWORD`, the
  variable of `valkey.password`, from the keyring-only entry
  `valkey_devops_password` that `llm/valkey-devops-auth` uses too.
- deploy-stack applies the manifest, the Argo CD project ignores the
  pushed Secret, and `k8s/README.md` describes both.
…reads no password in it, and pin the Secret's source by value
@dan-petty
dan-petty force-pushed the perf/1655-intake-embedding-valkey branch from 9d0617c to 026d233 Compare October 29, 2026 00:59
@dan-petty
dan-petty marked this pull request as ready for review October 29, 2026 01:07
@dan-petty
dan-petty merged commit bfe8a0c into main Oct 29, 2026
17 checks passed
@dan-petty
dan-petty deleted the perf/1655-intake-embedding-valkey branch October 29, 2026 01:16
dan-petty pushed a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.13.0](v0.12.0...v0.13.0)
(2026-10-29)


### Features

* **gh:** devops gh issues close records the close reason and a comment
([#2575](#2575))
([97ed0ea](97ed0ea)),
closes [#1658](#1658)
* **monitoring:** the ai spend dashboard counts gateway traffic from the
gateway's own series, shows failed attempts and names each caller
([#2584](#2584))
([33491ca](33491ca))
* **roadmap:** refine writes each criterion as an OpenSpec requirement
([#2591](#2591))
([d9a869f](d9a869f))
* **sandbox:** sandbox commands take a seccomp profile file
([#2588](#2588))
([46958d4](46958d4))


### Bug Fixes

* **monitoring:** RoadmapServiceGitHubWritesHigh counts a request with
no method label as a write, so it fired on 341 reads
([#2583](#2583))
([6dc3aa7](6dc3aa7)),
closes [#2574](#2574)


### Performance Improvements

* **ci:** the gate writes no coverage XML, and the clean-up keeps the
combined data
([#2582](#2582))
([ae9ebb2](ae9ebb2)),
closes [#1743](#1743)
* **roadmap:** intake's embeddings are cached in a password-protected
Valkey in the cluster
([#2578](#2578))
([bfe8a0c](bfe8a0c))


### Code Refactoring

* **devcontainer:** remove the DEVOPS_CLI_SKIP_TOOL_BOOTSTRAP test
switch from product code
([#2580](#2580))
([7e7272e](7e7272e))
* **lint:** lazy exports import names under TYPE_CHECKING
([#2590](#2590))
([c96dbfe](c96dbfe)),
closes [#2010](#2010)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant