Repository navigation
feat(ci,tools): expand nightly examples suite to all 12 example workloads - #906
janzak-dev wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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", "") |
There was a problem hiding this comment.
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.
| 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", ""), |
There was a problem hiding this comment.
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.
| "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: |
There was a problem hiding this comment.
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.
| except (urllib.error.HTTPError, urllib.error.URLError, OSError) as e: | |
| except (urllib.error.HTTPError, urllib.error.URLError, OSError, ValueError) as e: |
| 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, |
There was a problem hiding this comment.
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,| 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, |
There was a problem hiding this comment.
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,28d50fe to
60068e1
Compare
…oads TAG=agy CONV=ecefc9c1-e07a-45e0-b05c-4a732c9545fe
60068e1 to
cdc662e
Compare
|
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). |
🥞 Stack Navigation
refactor(tools,ci): rename demo_workload_verify to simple_job_verify(Merged tomain✅)feat(ci,tools): add unified nightly examples e2e pipeline with simple_job baselinefeat(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.
xmc-nightly..github/workflows/nightly-examples-e2e.ymlmatrix from thesimple_jobbaseline 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
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
.github/workflows/nightly-examples-e2e.yml):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.bazel: Registers all 12py_binarytargets 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 test //tools/nightly_tests:all(2/2 test targets passed, 67 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