Skip to content

operator: deploy consumes values RENDERED from the Deployment record; chart renders the RAM/CPU envelope - #2686

Merged
rbuergi merged 2 commits into
mainfrom
feat/record-driven-values
Aug 29, 2026
Merged

rbuergi merged 2 commits into
mainfrom
feat/record-driven-values

Conversation

@rbuergi

@rbuergi rbuergi commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Increment 1 of node types drive the entire process (core third). Do not merge in isolation — companions: MeshWeaver.Plugins feat/record-driven-values (the model + projection), Systemorph/Memex feat/record-driven-values (records migrated, overlays replaced by rendered output).

What changes

  • hosting-deploy accepts ONLY the record-rendered values file ($HOSTING_VALUES_FILE, materialised by run.sh from HOSTING_VALUES). Refuses a missing file, an empty file, and a file without the HelmValues header — each would fall through to chart defaults (ghcr :latest, in-cluster Postgres) and report success. $VALUES_FILE (the second hand-maintained fleet template) is retired.
  • --config-file retired. It passed flat Key=Value catalog lines to helm as a values file; helm read PluginCatalog:Registries:0:Name=Plugins as a mapping nobody templates, so a Provision would have deployed with no catalog wiring. The catalog now rides in the rendered values in the chart's own shape.
  • --image optional: a pinned record rolls explicitly; otherwise the deploy keeps the running image (the self-updater owns that field); a first install with no pin refuses rather than deploying the chart default — the same rule helm-release.yml applies, now where the deploy happens.
  • Chart: resources.portal was a DEAD KEY. Every overlay and values.aks.yaml declared it, no template read it; the live envelope came from portal-patch.json, which the next helm upgrade silently dropped. Rendered now, only when declared.

Tests

5 new refusal cases in deploy/aks/operator/test/run-tests.sh — 33 passing.

Reproduction gate (run locally through this chart)

instance values manifests
memex 140 leaves EQUAL 15 objects byte-identical
memex-cloud equal except 2 documented 17 objects, only memex-migration-config differs

The documented difference: the OLD memex-cloud overlay's migration section named database memex (the other instance's) while its portal section serves memexcloud. The record has one Database field feeding both.

🤖 Generated with Claude Code

…ORD; the chart renders the RAM/CPU envelope

Increment 1 of 'node types drive the entire process': the hand-maintained per-environment
values file is gone from the deploy path. The Hosting plugin renders the chart's values from
the Hosting/Deployment record (HelmValues) and the job carries them as HOSTING_VALUES; run.sh
materialises them at $HOSTING_VALUES_FILE, and hosting-deploy accepts NOTHING ELSE — it refuses
a missing file, an empty file and a file without the HelmValues header, because any of those
would fall through to chart defaults (ghcr :latest, an in-cluster Postgres this fleet does not
run) and report success. $VALUES_FILE, the second hand-maintained fleet template mounted into
the job, is retired with it.

--config-file is retired too. It passed the flat Key=Value catalog lines to helm AS A VALUES
FILE; helm read a line like PluginCatalog:Registries:0:Name=Plugins as a mapping with a key
nobody templates, so a Provision would have deployed an instance with NO catalog wiring and
left hosting-verify-catalog to find out. The catalog now rides in the rendered values in the
chart's own shape (pluginCatalog.registries/sources/installByDefault).

--image is new and optional: a record that pins a tag rolls to it explicitly; otherwise the
deploy KEEPS the running image (the self-updater owns that field), and a first install with
no pin refuses rather than deploying the chart default — the same rule Memex's
helm-release.yml applies, now where the deploy actually happens.

The chart change is one block: resources.portal was a DEAD KEY — every overlay and
values.aks.yaml declared it, no template read it, and the live envelope came from an
out-of-band kubectl patch the next helm upgrade silently dropped. The standard-rung knob the
maintainer named first ('let the user choose ram / cpu') did nothing until now. Rendered only
when declared.

Tests: 5 new refusal cases in deploy/aks/operator/test/run-tests.sh, 33 passing. The
reproduction gate (Plugins + Memex companions) renders both live records through this chart:
memex byte-identical to its overlay (15 objects), memex-cloud identical except the
migration ConfigMap, where the OLD overlay named the wrong database.
Copilot AI lite review requested due to automatic review settings August 29, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the AKS hosting operator deploy flow to consume a single Helm values file rendered from the Hosting/Deployment record (materialized by run.sh), and updates the chart to actually render the portal’s CPU/memory envelope from values so resource sizing is no longer an out-of-band patch.

Changes:

  • Add chart templating for .Values.resources.portal to render container resources: when declared.
  • Extend the operator job entrypoint (run.sh) to materialize the record-rendered Helm values file from HOSTING_VALUES into HOSTING_VALUES_FILE.
  • Tighten hosting-deploy guardrails (reject empty/non-rendered values, remove --config-file, validate --image) and add refusal tests.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
deploy/helm/values.yaml Updates operator env documentation to reflect the record-rendered values file path.
deploy/helm/templates/memex-portal/deployment.yaml Renders portal container resources: from values to make sizing declarative.
deploy/aks/operator/test/run-tests.sh Adds refusal coverage for empty/non-rendered values, unsafe --image, and removed --config-file.
deploy/aks/operator/bin/run.sh Materializes base64-encoded record-rendered Helm values into a file for the deploy step.
deploy/aks/operator/bin/hosting-deploy Removes --config-file, validates the rendered values header, and adds image preservation/pinning logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +222 to +225
{{- with ((.Values.resources).portal) }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

689 tests  ±0   497 ✅ ±0   4m 24s ⏱️ -14s
  5 suites ±0   192 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit 2a8c5d6. ± Comparison against base commit 41e91b1.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

913 tests  ±0   913 ✅ ±0   5m 29s ⏱️ ±0s
  6 suites ±0     0 💤 ±0 
  6 files   ±0     0 ❌ ±0 

Results for commit 2a8c5d6. ± Comparison against base commit 41e91b1.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

1 528 tests  ±0   1 528 ✅ ±0   5m 22s ⏱️ -7s
    8 suites ±0       0 💤 ±0 
    8 files   ±0       0 ❌ ±0 

Results for commit 2a8c5d6. ± Comparison against base commit 41e91b1.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

   10 files  ±0     10 suites  ±0   5m 52s ⏱️ +3s
3 452 tests ±0  3 452 ✅ ±0  0 💤 ±0  0 ❌ ±0 
4 086 runs  ±0  4 086 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2a8c5d6. ± Comparison against base commit 41e91b1.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

941 tests  ±0   941 ✅ ±0   5m 2s ⏱️ -13s
  6 suites ±0     0 💤 ±0 
  6 files   ±0     0 ❌ ±0 

Results for commit 2a8c5d6. ± Comparison against base commit 41e91b1.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

788 tests  ±0   784 ✅ ±0   7m 33s ⏱️ ±0s
  6 suites ±0     4 💤 ±0 
  6 files   ±0     0 ❌ ±0 

Results for commit 2a8c5d6. ± Comparison against base commit 41e91b1.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   41 files  ±0     41 suites  ±0   33m 45s ⏱️ -31s
8 311 tests ±0  8 115 ✅ ±0  196 💤 ±0  0 ❌ ±0 
8 945 runs  ±0  8 749 ✅ ±0  196 💤 ±0  0 ❌ ±0 

Results for commit 2a8c5d6. ± Comparison against base commit 41e91b1.

♻️ This comment has been updated with latest results.

@rbuergi
rbuergi merged commit db7201f into main Aug 29, 2026
24 checks passed
@rbuergi
rbuergi deleted the feat/record-driven-values branch September 13, 2026 10:09
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.

2 participants