Skip to content

feat(config): add shared config blocks and load_config - #697

Open
atnair-amd wants to merge 3 commits into
mainfrom
atnair/config-blocks
Open

atnair-amd wants to merge 3 commits into
mainfrom
atnair/config-blocks

Conversation

@atnair-amd

@atnair-amd atnair-amd commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Jira: AIMVT-574

A suite can pass its config file and cluster file to load_config and get back a validated config, the resolved cluster, and the merged container. The shared blocks live in config_blocks.py. Other suites keep their own loaders.

  • ConfigStr rejects <changeme> and <changeme-...> only when load_config validates. A model validated with no context still accepts a template.
  • The container merge is dicts by key, lists and scalars replaced, config wins. The result is a copy, so editing it does not change the cluster dict.
  • A key starting with _ is dropped at that model's own level. A key inside env is kept.

Testing: test_config_loader (50 tests) and ruff on the follow-up commit.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

1 medium, low, or unrated finding(s) are not listed; the scan run has them.

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

@atnair-amd
atnair-amd added this pull request to stack #699 October 30, 2026 21:24
@atnair-amd atnair-amd self-assigned this Oct 30, 2026
Move Paths, ModelSpec, RuntimeSpec and ContainerSpec into config_blocks.py
and add ConfigStr, RuntimeArgs and the threshold spec models, so suite
schemas compose one set of blocks. config_loader re-exports the moved names.

load_config loads a config against its cluster in one call: it resolves the
cluster, substitutes the config, attaches thresholds, rejects leftover
<changeme> placeholders, reports every problem without echoing input
values, and merges the config's container block onto the cluster's.

Keys starting with _ are now dropped at every model level, so a nested
_comment that used to fail validation is ignored.
A nested cluster-only value in the merge was the same object as on the
cluster dict. The merged container is now a copy, so editing it does not
change the cluster.

The loader tests no longer cover that merge. The placeholder test names
the three ConfigStr fields it checks.
substitute_config, BaseVariantConfig and the block re-exports stay in cvs/lib/utils/config_loader.py, so other suites' imports do not change.
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.

1 participant