Skip to content

feat(ci,tools): add unified nightly examples e2e pipeline with simple_job baseline - #902

Closed
janzak-dev wants to merge 3 commits into
refactor/rename-demo-workload-verifyfrom
feat/nightly-examples-pipeline-base
Closed

janzak-dev wants to merge 3 commits into
refactor/rename-demo-workload-verifyfrom
feat/nightly-examples-pipeline-base

Conversation

@janzak-dev

@janzak-dev janzak-dev commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

🥞 Stack Navigation

  • #901 Layer 1 (Base): refactor(tools,ci): rename demo_workload_verify to simple_job_verify
  • #902 Layer 2: feat(ci,tools): add unified nightly examples e2e pipeline with simple_job baseline 👈
  • #903 Layer 3 (Apex): 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.

  • Stack Objective: Establish an automated, robust, end-to-end multi-example workload execution and validation framework running against xmc-nightly.
  • Layer 2 Role: Implements .github/workflows/nightly-examples-e2e.yml as 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 the simple_job baseline 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

  • Consolidated CI Runner Efficiency: Adopting the streamlined unified action pattern from PR refactor(ci): consolidate demo workload launch and verification into unified nightly workflow #895 eliminates redundant runner setup and executes workload submission and verification within a single matrix job.
  • Incremental Foundation: Introducing the nightly pipeline with only simple_job keeps the initial PR small (<250 prod lines) and provides a clean, extensible pattern for subsequent example additions.

Key Changes

  • CI / Workflow (.github/workflows/nightly-examples-e2e.yml):
    • Sets up single-action unified matrix job run-and-verify-examples configured for workflow_dispatch and nightly cron schedule.
    • Implements matrix runner with simple_job baseline executing via virtualenv python3 -m <verify_module>.
  • Validation Engine (tools/nightly_tests/):
    • simple_job_verify.py: 100% Protobuf spec assertions for simple_job (verifies Priority HIGH, cpu-queue, worker naming demo-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 Bazel py_binary and py_test targets for simple_job_verify and common dependencies.
    • examples_verify_test.py & common_test.py: Hermetic unit tests verifying CLI arguments and execution flows.
  • Results Aggregation (.github/scripts/aggregate-example-results.js):
    • Enhanced to auto-detect E2E test suite matrix outputs and generate formatted 6-column GitHub Step Summary table.

Assumptions

None — requirements were fully specified.

Verification & Testing

  • Bazel Unit Tests: bazel test //tools/nightly_tests:all (3/3 targets passed, 83 tests passing)
  • Node Unit Tests: node --test .github/scripts/aggregate-example-results.test.js (11/11 tests passing)
  • Pre-commit Checks: ./.githooks/pre-commit check (100% clean)

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339

* 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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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'))) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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'.

Suggested change
if (r && (r.status === 'FAILED' || r.status === 'VERIFY_FAILED' || (r.status !== 'PASSED' && r.status !== 'SKIPPED'))) {
if (r && r.status !== 'PASSED' && r.status !== 'SKIPPED') {

Comment on lines +135 to +143
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with the other flag retrievals on lines 173-175 (which use common.get_flag), use common.get_flag(FLAGS, 'xid') instead of getattr(FLAGS, 'xid', None).

Suggested change
xid = common.parse_xid(getattr(FLAGS, "xid", None))
xid = common.parse_xid(common.get_flag(FLAGS, "xid"))

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, _),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with the other flag retrievals, use common.get_flag(FLAGS, 'endpoint') instead of getattr(FLAGS, 'endpoint', None).

Suggested change
common.ess_channel_context(getattr(FLAGS, "endpoint", None)) as (stub, _),
common.ess_channel_context(common.get_flag(FLAGS, "endpoint")) as (stub, _),

@janzak-dev
janzak-dev added this pull request to stack #904 September 17, 2026 11:07
…_job baseline

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
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