Repository navigation
feat(ci,tools): add unified nightly examples e2e pipeline with simple_job baseline - #902
janzak-dev wants to merge 3 commits into
Conversation
* docs(deploy): document CTK v2 feature switches in README Document `dashboard_service_deployment_enabled` and `rod_deployment_enabled` feature switch flags in Cluster Toolkit v2 README, and clarify microservices provisioned under `enable_metrics`. TAG=agy CONV=acf882de-1561-404c-ba2e-ae0940451165 * docs(deploy): clarify enable_metrics provisions ingestion gateway in CTK v2 README Update `enable_metrics` description in deploy/ctk_v2/README.md to refer specifically to the Ingestion Gateway microservice per review feedback. TAG=agy CONV=acf882de-1561-404c-ba2e-ae0940451165 * docs(deploy): emphasize dual-flag requirement for metrics dashboards in CTK v2 README Clarify that full metrics dashboard and chart visualization functionality requires both `enable_metrics` (for metrics ingestion) and `dashboard_service_deployment_enabled` (for dashboard backend & UI) to be enabled. TAG=agy CONV=acf882de-1561-404c-ba2e-ae0940451165
There was a problem hiding this comment.
Code Review
This pull request enhances the nightly example results aggregation and verification scripts. Key changes include adding support for E2E suite results (6-column tables) in the GitHub step summary, refactoring the workload verification scripts to assert detailed JobSet specifications, resource requests, priority, and metadata, and introducing comprehensive unit tests. Feedback on these changes highlights opportunities to simplify redundant status checks in the aggregation script, prevent potential AttributeError exceptions when retrieving cached work unit executions, ensure backward compatibility by removing redundant strict arguments in zip, and maintain consistency by using common.get_flag for flag retrieval.
| xidMap[r.id] = r.xid; | ||
| } | ||
| if (r && r.status === 'FAILED') { | ||
| if (r && (r.status === 'FAILED' || r.status === 'VERIFY_FAILED' || (r.status !== 'PASSED' && r.status !== 'SKIPPED'))) { |
There was a problem hiding this comment.
The condition (r.status === 'FAILED' || r.status === 'VERIFY_FAILED' || (r.status !== 'PASSED' && r.status !== 'SKIPPED')) contains redundant checks. If r.status is not 'PASSED' and not 'SKIPPED', it already covers 'FAILED' and 'VERIFY_FAILED'. The entire expression can be simplified to just r.status !== 'PASSED' && r.status !== 'SKIPPED'.
| if (r && (r.status === 'FAILED' || r.status === 'VERIFY_FAILED' || (r.status !== 'PASSED' && r.status !== 'SKIPPED'))) { | |
| if (r && r.status !== 'PASSED' && r.status !== 'SKIPPED') { |
| def _get_cached_wu_state(work_unit: Any) -> tuple[int, bool]: | ||
| """Extracts WorkUnitState from current execution status if present.""" | ||
| if ( | ||
| hasattr(work_unit, "current_work_unit_execution") | ||
| and work_unit.current_work_unit_execution.HasField("status") | ||
| and getattr(work_unit.current_work_unit_execution.status, "state", None) is not None | ||
| ): | ||
| return int(work_unit.current_work_unit_execution.status.state) | ||
| return int(work_unit.current_work_unit_execution.status.state), True | ||
| return STATE_UNSPECIFIED, False |
There was a problem hiding this comment.
If work_unit.current_work_unit_execution is explicitly set to None, hasattr(work_unit, 'current_work_unit_execution') will return True, but attempting to call .HasField('status') on it will raise an AttributeError. It is safer and more idiomatic to retrieve the attribute using getattr and check if it is not None before accessing its fields.
| def _get_cached_wu_state(work_unit: Any) -> tuple[int, bool]: | |
| """Extracts WorkUnitState from current execution status if present.""" | |
| if ( | |
| hasattr(work_unit, "current_work_unit_execution") | |
| and work_unit.current_work_unit_execution.HasField("status") | |
| and getattr(work_unit.current_work_unit_execution.status, "state", None) is not None | |
| ): | |
| return int(work_unit.current_work_unit_execution.status.state) | |
| return int(work_unit.current_work_unit_execution.status.state), True | |
| return STATE_UNSPECIFIED, False | |
| def _get_cached_wu_state(work_unit: Any) -> tuple[int, bool]: | |
| """Extracts WorkUnitState from current execution status if present.""" | |
| cur_exec = getattr(work_unit, "current_work_unit_execution", None) | |
| if ( | |
| cur_exec is not None | |
| and cur_exec.HasField("status") | |
| and getattr(cur_exec.status, "state", None) is not None | |
| ): | |
| return int(cur_exec.status.state), True | |
| return STATE_UNSPECIFIED, False |
| f"Job '{job_name}' {item_type} container count mismatch: " | ||
| f"expected {len(expected_items)}, found {len(actual_items)}." | ||
| ) | ||
| for exp_c, act_c in zip(expected_items, actual_items, strict=False): |
There was a problem hiding this comment.
Since the lengths of actual_items and expected_items are already verified to be equal on line 353, specifying strict=False in zip is redundant. Furthermore, the strict keyword argument for zip was introduced in Python 3.10, so omitting it ensures compatibility with Python 3.9 and earlier versions.
| for exp_c, act_c in zip(expected_items, actual_items, strict=False): | |
| for exp_c, act_c in zip(expected_items, actual_items): |
| def main(argv: Sequence[str]) -> None: | ||
| """Main verification routine for simple_job workload.""" | ||
| common.validate_argv(argv) | ||
| xid = common.parse_xid(getattr(FLAGS, "xid", None)) |
There was a problem hiding this comment.
| with ( | ||
| common.handle_verification_errors(), | ||
| common.ess_channel_context(common.get_flag(FLAGS, "endpoint")) as (stub, _), | ||
| common.ess_channel_context(getattr(FLAGS, "endpoint", None)) as (stub, _), |
There was a problem hiding this comment.
For consistency with the other flag retrievals, use common.get_flag(FLAGS, 'endpoint') instead of getattr(FLAGS, 'endpoint', None).
| common.ess_channel_context(getattr(FLAGS, "endpoint", None)) as (stub, _), | |
| common.ess_channel_context(common.get_flag(FLAGS, "endpoint")) as (stub, _), |
…901) TAG=agy CONV=606f1e41-6785-4137-b85b-cd0f56237339
…_job baseline TAG=agy CONV=606f1e41-6785-4137-b85b-cd0f56237339
854b0dc to
4894489
Compare
🥞 Stack Navigation
refactor(tools,ci): rename demo_workload_verify to simple_job_verifyfeat(ci,tools): add unified nightly examples e2e pipeline with simple_job baseline👈feat(ci,tools): expand nightly examples suite to all 12 example workloads🏛️ Role in PR Stack Architecture
This PR serves as Layer 2 (Unified Pipeline Foundation & Baseline Workload) within the 3-part nightly examples testing stack.
xmc-nightly..github/workflows/nightly-examples-e2e.ymlas a single, unified matrix workflow (following PR refactor(ci): consolidate demo workload launch and verification into unified nightly workflow #895's streamlined model) and configures thesimple_jobbaseline test case with 100% full Protobuf spec assertions. This allows Layer 3 to focus solely on expanding the matrix to the remaining 11 workloads.Summary
Adds the unified nightly examples E2E validation pipeline foundation (
.github/workflows/nightly-examples-e2e.yml) and baseline multi-unit job validator (tools/nightly_tests/simple_job_verify.py).Motivation & Context
simple_jobkeeps the initial PR small (<250 prod lines) and provides a clean, extensible pattern for subsequent example additions.Key Changes
.github/workflows/nightly-examples-e2e.yml):run-and-verify-examplesconfigured forworkflow_dispatchand nightly cron schedule.simple_jobbaseline executing via virtualenvpython3 -m <verify_module>.tools/nightly_tests/):simple_job_verify.py: 100% Protobuf spec assertions forsimple_job(verifies PriorityHIGH,cpu-queue, worker namingdemo-worker-1..3, replicas 1, CPU 500m, memory 512 MiB, tags, notes, completed status).xmc_entities_validator.py: Decomposed foundational gRPC validator utilities (all functions <= 25 lines).BUILD.bazel: Adds Bazelpy_binaryandpy_testtargets forsimple_job_verifyand common dependencies.examples_verify_test.py&common_test.py: Hermetic unit tests verifying CLI arguments and execution flows..github/scripts/aggregate-example-results.js):Assumptions
None — requirements were fully specified.
Verification & Testing
bazel test //tools/nightly_tests:all(3/3 targets passed, 83 tests passing)node --test .github/scripts/aggregate-example-results.test.js(11/11 tests passing)./.githooks/pre-commit check(100% clean)TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339