Skip to content

feat(ci,tools): add verifiers and matrix entries for 7 unblocked nightly examples - #1057

Merged
janzak-dev merged 10 commits into
mainfrom
feat/nightly-unblocked-examples-suite
Oct 6, 2026
Merged

janzak-dev merged 10 commits into
mainfrom
feat/nightly-unblocked-examples-suite

Conversation

@janzak-dev

@janzak-dev janzak-dev commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds nightly E2E verifiers (tools/nightly_tests/*_verify.py), container image build steps, and workflow matrix entries (.github/workflows/nightly-examples-e2e.yml) for the 6 newly unblocked example workloads (init_container_job, sidecar, multipod_job, metrics_job, chart_artifact_job, metrics_dashboard_job), bringing the active nightly E2E suite to 8 workloads (17 files changed, 1,051 insertions(+), 36 deletions(-)).

Note on PR Diff Size (+1,051 / -36 lines): After extracting the shared verification helpers into Layer 1 (#1064) and deferring the blocked/specialized examples to Layer 3 (#934), this PR intentionally keeps all 6 unblocked example verifiers together slightly above the standard 1,000-line guideline:

  1. Negligible Production Code Touch (4 lines): Only 4 lines touch SDK/example Python code (examples/metrics_dashboard_job/launch.py and sdks/python/xdash/client.py); the remaining ~1,000 lines consist of unit tests (+286 lines), 6 uniform declarative ~60-line E2E verifier scripts (+404 lines) that all call common.verify_standard_workload, BUILD.bazel targets (+66 lines), and CI matrix entries.
  2. Cohesive E2E Matrix Enablement: Grouping the 6 unblocked workloads into one layer avoids artificial micro-PR fragmentation of identical boilerplate verifiers and allows the entire unblocked suite to be verified in a single end-to-end CI run (#37284832086).

Stack Context (GitHub Stack #1065)

  • Layer 1 of 3 (#1064): Extracts shared workload verification helpers (verify_standard_workload, assert_experiment, assert_work_units, assert_work_unit_jobsets, assert_clickhouse_metrics, assert_dashboard_chart_data) and refactors simple_job_verify.py and clickhouse_metrics_job_verify.py.
  • Layer 2 of 3 (This PR — feat(ci,tools): add verifiers and matrix entries for 7 unblocked nightly examples #1057): Adds artifact validation (validate_artifacts / assert_work_unit_artifacts), adds the 6 new unblocked example verifiers and CI matrix entries, deduplicates cluster port-forwards into a single Start Service Port-Forwards step, and fixes metrics_dashboard_job and xdash auth forwarding.
  • Layer 3 of 3 (#934): Expands the nightly examples E2E suite to the remaining 4 specialized workloads (managed_xprof_artifact_job, per_job_node_selector, pathways_job, xdash_dashboard).

Motivation & Context

Previously, only 2 examples (simple_job and clickhouse_metrics_job) ran in the nightly E2E pipeline. Expanding the nightly matrix to the 6 additional CPU/ClickHouse-ready examples exposed four real issues in the examples and SDK:

  1. examples/metrics_dashboard_job/launch.py wid Type Bug: Line 258 parsed wid = str(...) instead of int(...), causing ChartBuilder.for_experiment(xid=xid, wid=wid) (sdks/python/xdash/builders.py:230) to fail with TypeError: '<=' not supported between instances of 'str' and 'int'.
  2. sdks/python/xdash/client.py Missing OIDC Bearer Metadata: DashboardClient did not attach XMC_AUTH_TOKEN to outgoing gRPC calls, causing the Dashboard Service OIDC interceptor (cmd/dashboard_service/main.go) to reject requests with UNAUTHENTICATED: missing metadata in context.
  3. examples/metrics_job/Dockerfile & examples/metrics_dashboard_job/Dockerfile Missing Proto Package in Wheel: sdks/python/xmc/metrics/_writer.py imports from api.protos.metrics import metrics_pb2, which lives at the repo root (api/protos/metrics/), outside sdks/python/xmc/. Without symlinking /build/api into /build/sdks/python/api prior to pip install, setuptools.find_packages() omitted api.protos.metrics from the built wheel, causing workers to crash at startup with ModuleNotFoundError: No module named 'api' (unlike examples/clickhouse_metrics_job/Dockerfile and examples/chart_artifact_job/Dockerfile, which already had this symlink).
  4. Asynchronous ChartArtifact Provisioning: ESS creates ChartArtifact records with status = PROVISIONING (1) before the background observer creates the backing chart and transitions status to SUCCESS (2).

Key Changes

  • Artifact Validation (tools/nightly_tests/xmc_entities_validator.py, tools/nightly_tests/common.py):
    • Added validate_artifacts (and common.assert_work_unit_artifacts, plus expected_artifact_types/expected_metric_names on common.verify_standard_workload) to poll ESS ListArtifacts until ChartArtifact asynchronous provisioning transitions from PROVISIONING (status=1) to SUCCESS (status=2), and verifies non-empty UrlArtifact.url.
  • 6 New Nightly Example Verifiers (tools/nightly_tests/*_verify.py, tools/nightly_tests/BUILD.bazel):
    • init_container_job_verify.py: Verifies JobSet init container (setup-workspace) and primary container (main-worker).
    • sidecar_verify.py: Verifies init container (init-setup), sidecar (sidecar-service), and primary container (primary-worker).
    • multipod_job_verify.py: Verifies multi-job JobSet topology (counter-workers with 4 replicas and secondary-counter with 1 replica).
    • metrics_job_verify.py: Verifies 4-job JobSet topology and ClickHouse ingestion of all 4 autologged/manual metric series (manual/loss, loss, keras_cb/loss, pl/loss_epoch, $\ge 25$ rows).
    • chart_artifact_job_verify.py: Verifies ChartArtifact & UrlArtifact, $\ge 60$ ClickHouse metric rows, and hydrated dashboard chart points (chart_artifact_x{xid}_w1).
    • metrics_dashboard_job_verify.py: Verifies $\ge 50$ ClickHouse metric rows across 5 metrics and multi-chart hydration across both charts (Training Progress and Throughput) on exp_{xid}_overview.
  • Fixes for metrics_dashboard_job & xdash gRPC Auth:
    • examples/metrics_dashboard_job/launch.py: Fixed 1-line wid = int(...) bug on line 258.
    • sdks/python/xdash/client.py & sdks/python/xdash/client_test.py: Forward XMC_AUTH_TOKEN as a Bearer token in gRPC metadata when set in the environment.
  • Deduplicated Cluster Port-Forwards & Matrix Wiring (.github/workflows/nightly-examples-e2e.yml):
    • Consolidated the Dashboard Service gRPC (localhost:50051) and ClickHouse HTTP (localhost:8123) port-forward blocks into a single Start Service Port-Forwards step (start_port_forward()) that runs once before both Launch Example Workload and Run Workload Verification Assertions, with automatic cleanup (pkill -f "kubectl port-forward") in Publish Step Summary & Save Result.
    • Added image build steps and matrix entries for all 6 newly unblocked examples with expected_queue: "${{ inputs.queue_name || 'cpu-queue' }}" and requires_clickhouse: true for all metrics workloads.
  • Dockerfile Packaging Fixes (examples/metrics_job/Dockerfile, examples/metrics_dashboard_job/Dockerfile):
    • Added ln -sf /build/api /build/sdks/python/api before pip install so api.protos.metrics.metrics_pb2 is bundled into the wheel, verified by a documented build-time smoke test (RUN python3 -c "import xmc; from api.protos.metrics import metrics_pb2; metrics_pb2.Metric()").

Assumptions

  • The nightly GKE cluster runs ClickHouse (xmc-metrics) and Dashboard Service (xmc), which are reached from the ARC runner via kubectl port-forward in Start Service Port-Forwards.

Verification & Testing

  • Live Nightly Examples E2E Run: All 8 matrix workloads passed 100% green in GitHub Actions Run #37284832086.
  • Unit tests: bazel test //tools/nightly_tests/... //sdks/python/xdash/... (all test targets pass).
  • Pre-commit hooks: ./.githooks/pre-commit passed cleanly.

Related Issues / Bugs

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 introduces several new nightly test verification scripts for XMC workloads (including chart artifacts, init containers, metrics dashboards, metrics autologging, multi-pod, and sidecars), registers them in the Bazel build file, and implements artifact validation logic in xmc_entities_validator.py with accompanying unit tests. The review feedback highlights a critical issue in metrics_dashboard_job_verify.py where a non-existent function validate_dashboard is called and silently caught, as well as potential false positives in init_container_job_verify.py and sidecar_verify.py where empty work unit lists would silently bypass topology assertions instead of raising an error.

Comment thread tools/nightly_tests/sidecar_verify.py Resolved
@janzak-dev
janzak-dev added this pull request to stack #1058 October 2, 2026 10:15
Base automatically changed from feat/nightly-ci-build-example-images to main October 2, 2026 10:43
@janzak-dev
janzak-dev force-pushed the feat/nightly-unblocked-examples-suite branch from 122ff52 to cf2b6aa Compare October 2, 2026 10:43
@janzak-dev
janzak-dev removed this pull request from stack #1058 October 5, 2026 09:15
@janzak-dev
janzak-dev changed the base branch from main to refactor/nightly-common-verifier-extraction October 5, 2026 09:15
@janzak-dev
janzak-dev added this pull request to stack #1065 October 5, 2026 09:15
@janzak-dev
janzak-dev marked this pull request as ready for review October 5, 2026 10:48
@janzak-dev janzak-dev added the priority::2-high top of mind. should not wait. label Oct 5, 2026
- Add public validate_work_unit_jobsets in xmc_entities_validator and
  delegate common.assert_work_unit_jobsets to it.
- Pin WorkUnit count in verify_standard_workload to len(workers) so
  NUM_WORK_UNITS in the environment does not inflate single-unit checks.
- Drop unused strict_required parameter and XMANAGER_UI_URL strictness
  inference from assert_dashboard_chart_data.
- Unpack tuple-packed assignments, restore timeout duration in dashboard
  hydration error message, and restore WorkUnits/Workers/Timeout/Title
  fields in banner and summary output.
- Document follow-up responsibility split TODO in common.py docstring and
  expand stub-boundary and strictness unit tests.
…nightly-unblocked-examples-suite

# Conflicts:
#	tools/nightly_tests/common.py
#	tools/nightly_tests/common_test.py
#	tools/nightly_tests/xmc_entities_validator_test.py
andrzejfudro
andrzejfudro previously approved these changes Oct 5, 2026
andrzejfudro
andrzejfudro previously approved these changes Oct 6, 2026
Base automatically changed from refactor/nightly-common-verifier-extraction to main October 6, 2026 09:30
@janzak-dev
janzak-dev added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 76f598d Oct 6, 2026
11 checks passed
@janzak-dev
janzak-dev deleted the feat/nightly-unblocked-examples-suite branch October 6, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority::2-high top of mind. should not wait.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants