Layer 1: scenarios-as-modules (Cl2Benchmark archetype + Kata demo + cycle gate)#1230
Draft
Bickor wants to merge 3 commits into
Draft
Layer 1: scenarios-as-modules (Cl2Benchmark archetype + Kata demo + cycle gate)#1230Bickor wants to merge 3 commits into
Bickor wants to merge 3 commits into
Conversation
Introduce lib/scenario/cl2_benchmark.k: a Cl2Benchmark schema plus build lambda that composes existing step modules into a full ap.Pipeline from a compact, author-facing config. Re-express example_pipeline via the archetype (167 -> 76 lines) with byte-identical generated YAML (verified against a regenerated golden oracle, 10413 bytes).
Demonstrates whole-test modularization: enabling Kata containers requires only two touch-points on top of the shared scenario spine. - NodePool.runtime adds --workload-runtime KataMshvAccVmIsolation flag - lib/scenario/cl2_manifest.k builds the CL2 driver manifest from KCL, emitting CL2_RUNTIME_CLASS_NAME so measured pods get runtimeClassName - kata_benchmark scenario reuses Cl2Benchmark, differing only in Kata fields (nested-virt SKU + runtime class) Verified: example_pipeline regen stays byte-identical to golden; kata pipeline diff is Kata-only.
Add a thin /generate_yaml gate that catches path-string cross-scenario reference cycles (cl2Manifest / kwokNodeManifest pointing into another scenario's directory) - the blind spot KCL's own import-cycle check cannot see. KCL natively rejects circular imports (E1001 RecursiveLoad), so this gate does not re-check those; format_kcl_cycle_error() instead reframes that diagnostic in scenario terms. - scripts/validate_scenarios.py: pure detection fns + main() (argparse, --kcl-root) + format_kcl_cycle_error() - scripts/test_validate_scenarios.py: 21 unittest cases (GREEN) - generate-yaml skill: document the validation gate step
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Draft for review. Introduces Layer 1 of the modularization effort: authoring a whole Telescope test (a scenario) as a reusable KCL module, so scenario owners can stand up or tweak a benchmark with a couple of changes instead of hand-writing the full pipeline.
Three self-contained commits:
Cl2Benchmarkscenario archetype (2100b44)kcl/lib/scenario/cl2_benchmark.k: a schema + builder that captures the shared CL2 pipeline spine (resource group → cluster → node pool → CreateKwokNodes → RunClusterLoader2 → collect/upload → cleanup).kcl/example_pipeline/pipeline.krebuilt on the archetype regenerates byte-identicalpipeline.yamlvs. the prior hand-written output.Kata benchmark scenario (
cc9b50a)nodePool.runtime = "kata"→--workload-runtime KataMshvAccVmIsolation+ nested-virt SKU, andCL2_RUNTIME_CLASS_NAMEin the cl2-override ConfigMap → measured pods getruntimeClassName.kcl/lib/scenario/cl2_manifest.k(typedCl2Override/Cl2Manifest+buildCl2Manifest) so a scenario can generate its owncl2.yamlfrom KCL (kcl run -S manifests).RunClusterLoader2is unchanged;cl2Manifeststays a path.Cross-scenario reference cycle validation gate (
0ab8c87)scripts/validate_scenarios.py: a thin/generate_yamlgate catching path-string cross-scenario reference cycles (one scenario'scl2Manifest/kwokNodeManifestpointing into another scenario's directory) — the one blind spot KCL's compiler cannot see.E1001 RecursiveLoad); this gate deliberately does not re-check those.format_kcl_cycle_error()just reframes that native diagnostic in scenario terms.scripts/test_validate_scenarios.py: 21 unittest cases (GREEN); documented in thegenerate-yamlskill.What to review
Cl2Benchmark's field set the right seam, and is the path-stringcl2Manifestcontract acceptable vs. inlining?Not in this PR (deliberately deferred)
CollectClusterLoader2Resultstep).emitnaming alignment.Validation