Skip to content

feat(ci,tools): expand nightly examples suite to all 12 example workloads - #906

Closed
janzak-dev wants to merge 1 commit into
feat/nightly-examples-pipeline-basefrom
feat/nightly-examples-suite
Closed

janzak-dev wants to merge 1 commit into
feat/nightly-examples-pipeline-basefrom
feat/nightly-examples-suite

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 (Merged to main ✅)
  • #905 Layer 2: feat(ci,tools): add unified nightly examples e2e pipeline with simple_job baseline
  • #906 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 3 (Complete Multi-Example Suite & Dedicated Verifiers - Apex) within the 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 3 Role: Expands the .github/workflows/nightly-examples-e2e.yml matrix from the simple_job baseline to all 12 example workloads and introduces dedicated verifiers, JobSet topology validation, artifact payload checking, and full hermetic unit test suites.

Summary

Expands the nightly examples E2E validation matrix to cover all 12 example workloads in XMC, adding dedicated CLI verifier binaries and full unit test coverage.

Motivation & Context

  • Comprehensive E2E Coverage: With the pipeline foundation established in Layer 2, this layer plugs in the remaining 11 example workloads (init_container_job, sidecar, multipod_job, per_job_node_selector, pathways_job, chart_artifact_job, managed_xprof_artifact_job, xdash_dashboard, metrics_job, clickhouse_metrics_job, metrics_dashboard_job) into the nightly matrix runner.

Key Changes

  • CI / Workflow (.github/workflows/nightly-examples-e2e.yml):
    • Expands matrix to all 12 example workloads.
  • Validation Engine & Verifier CLIs (tools/nightly_tests/):
    • init_container_job_verify.py: Validates init container setup and execution.
    • sidecar_verify.py: Validates Kubernetes native sidecar services.
    • multipod_job_verify.py: Validates multi-pod multi-role JobSet topology.
    • per_job_node_selector_verify.py: Validates heterogeneous nodeSelector targeting per role.
    • pathways_job_verify.py: Validates Pathways TPU multi-component topologies.
    • chart_artifact_job_verify.py: Validates ChartArtifact provisioning and metric sequences.
    • managed_xprof_artifact_job_verify.py: Validates ManagedXprofArtifact records.
    • xdash_dashboard_verify.py: Validates xDash REST API definitions and chart references.
    • metrics_job_verify.py: Validates autologging for Keras, PyTorch Lightning, and custom metrics.
    • clickhouse_metrics_job_verify.py: Validates ClickHouse metrics ingestion pipeline.
    • metrics_dashboard_job_verify.py: Validates Metrics Dashboard integration.
    • xmc_entities_validator.py: Comprehensive assertions for artifacts, REST dashboards, JobSet topology, and WorkUnit states (all functions <= 25 lines).
  • Build & Tests:
    • BUILD.bazel: Registers all 12 py_binary targets and unit test suites.
    • xmc_entities_validator_test.py: Full test matrix covering all helper functions and edge cases (54 tests).
    • common_test.py: Unit tests for common CLI argument parsing and error handling (13 tests).

Assumptions

None — requirements were fully specified.

Verification & Testing

  • Bazel Unit Tests: bazel test //tools/nightly_tests:all (2/2 test targets passed, 67 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

@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 introduces several new nightly test verification scripts for XMC workloads, updates the Bazel build configuration, adds dashboard endpoint resolution utilities to common.py, and expands unit test coverage. The review feedback highlights critical robustness improvements for the new validation logic, including handling potential null values for dashboard titles to prevent TypeErrors, catching ValueError during JSON decoding to prevent polling loop crashes on non-JSON responses, and ensuring dashboard endpoints are properly resolved before validation in the ClickHouse and metrics dashboard verification scripts.

dash_id: str, dash_data: dict[str, Any], exp_dash: dict[str, Any]
) -> list[str]:
"""Asserts title pattern and expected chart IDs for fetched dashboard data."""
dash_title = dash_data.get("title", "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

If the JSON response contains "title": null, dash_data.get("title", "") will return None instead of "". This will cause a TypeError when checking exp_dash["expected_title"] not in dash_title. Using dash_data.get("title") or "" ensures a string is always returned.

Suggested change
dash_title = dash_data.get("title", "")
dash_title = dash_data.get("title") or ""

return {
"id": dash_id,
"dashboard_id": dash_id,
"title": dash_data.get("title", ""),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Similar to the title check in metadata validation, if the JSON response contains "title": null, dash_data.get("title", "") will return None. Using dash_data.get("title") or "" ensures a string is always returned in the validated dashboard dictionary.

Suggested change
"title": dash_data.get("title", ""),
"title": dash_data.get("title") or "",

return [_validate_single_dashboard(base_endpoint, d) for d in norm_dashboards]
except AssertionError:
raise
except (urllib.error.HTTPError, urllib.error.URLError, OSError) as e:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

If the dashboard endpoint returns a non-JSON response (e.g., an empty response or an HTML error page from a gateway/proxy), json.loads will raise a json.JSONDecodeError (which inherits from ValueError). Since this exception is not caught, the polling loop will crash immediately instead of waiting/retrying. Catching ValueError handles this gracefully as a transient error.

Suggested change
except (urllib.error.HTTPError, urllib.error.URLError, OSError) as e:
except (urllib.error.HTTPError, urllib.error.URLError, OSError, ValueError) as e:

Comment on lines +97 to +107
dash_endpoint = (
common.get_flag(FLAGS, "dashboard_endpoint", None)
or os.environ.get("XMC_DASHBOARD_ENDPOINT")
or os.environ.get("DASHBOARD_ENDPOINT")
)
dashboard_id = f"exp_{xid}_training_overview"
if dash_endpoint:
print(f"\n[Bonus] Verifying Dashboard '{dashboard_id}' via {dash_endpoint}...")
try:
dash_results = xmc_entities_validator.validate_dashboard(
endpoint=dash_endpoint,

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 optional dashboard check passes dash_endpoint directly to validate_dashboard without resolving it first. If dash_endpoint is configured as a gRPC endpoint or contains prefixes like dns:///, it will not be properly formatted for HTTP REST requests. Resolving it via common.resolve_dashboard_endpoint ensures consistency and correctness.

    raw_endpoint = (
        common.get_flag(FLAGS, "dashboard_endpoint", None)
        or os.environ.get("XMC_DASHBOARD_ENDPOINT")
        or os.environ.get("DASHBOARD_ENDPOINT")
    )
    dashboard_id = f"exp_{xid}_training_overview"
    if raw_endpoint:
        dash_endpoint = common.resolve_dashboard_endpoint(raw_endpoint)
        print(f"\n[Bonus] Verifying Dashboard '{dashboard_id}' via {dash_endpoint}...")
        try:
            dash_results = xmc_entities_validator.validate_dashboard(
                endpoint=dash_endpoint,

Comment on lines +97 to +107
dash_endpoint = (
common.get_flag(FLAGS, "dashboard_endpoint", None)
or os.environ.get("XMC_DASHBOARD_ENDPOINT")
or os.environ.get("DASHBOARD_ENDPOINT")
)
dashboard_id = f"exp_{xid}_overview"
if dash_endpoint:
print(f"\n[Bonus] Verifying Dashboard '{dashboard_id}' via {dash_endpoint}...")
try:
dash_results = xmc_entities_validator.validate_dashboard(
endpoint=dash_endpoint,

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 optional dashboard check passes dash_endpoint directly to validate_dashboard without resolving it first. If dash_endpoint is configured as a gRPC endpoint or contains prefixes like dns:///, it will not be properly formatted for HTTP REST requests. Resolving it via common.resolve_dashboard_endpoint ensures consistency and correctness.

    raw_endpoint = (
        common.get_flag(FLAGS, "dashboard_endpoint", None)
        or os.environ.get("XMC_DASHBOARD_ENDPOINT")
        or os.environ.get("DASHBOARD_ENDPOINT")
    )
    dashboard_id = f"exp_{xid}_overview"
    if raw_endpoint:
        dash_endpoint = common.resolve_dashboard_endpoint(raw_endpoint)
        print(f"\n[Bonus] Verifying Dashboard '{dashboard_id}' via {dash_endpoint}...")
        try:
            dash_results = xmc_entities_validator.validate_dashboard(
                endpoint=dash_endpoint,

@janzak-dev
janzak-dev force-pushed the feat/nightly-examples-suite branch from 28d50fe to 60068e1 Compare September 17, 2026 11:17
…oads

TAG=agy
CONV=ecefc9c1-e07a-45e0-b05c-4a732c9545fe
@janzak-dev
janzak-dev force-pushed the feat/nightly-examples-suite branch from 60068e1 to cdc662e Compare September 17, 2026 11:29
@janzak-dev

Copy link
Copy Markdown
Collaborator Author

Closing in favor of restructured 3-PR stack: Layer 1 (Exhaustive simple_job verification), Layer 2 (Nightly pipeline base), and Layer 3 (All 12 workloads suite).

@janzak-dev janzak-dev closed this Sep 17, 2026
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