8000 feat(ci): add parallel trigger-all-examples runner and fix launch scripts by janzak-dev · Pull Request #881 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

feat(ci): add parallel trigger-all-examples runner and fix launch scripts - #881

Merged
janzak-dev merged 6 commits into
mainfrom
feat/trigger-all-examples
Sep 15, 2026
Merged

janzak-dev merged 6 commits into
mainfrom
feat/trigger-all-examples

Conversation

@janzak-dev
@janzak-dev janzak-dev commented Sep 15, 2026 •
Copy link
Copy Markdown
Collaborator

🥞 Stack Navigation


🏛️ Role in PR Stack Architecture

This PR serves as Layer 2 (Parallel Multi-Workload CI Execution) within the 4-part multi-example execution and validation stack.

  • Stack Objective: Establish an automated, robust, end-to-end multi-example workload execution and validation framework running against xmc-nightly.
  • Layer 2 Role: Introduces .github/workflows/trigger-all-examples.yml to launch all 12 examples concurrently against xmc-nightly on GKE, and applies critical compatibility fixes to launcher scripts (managed_xprof_artifact_job, metrics_dashboard_job, xdash_dashboard) so all workloads execute successfully.

Summary

Introduces the parallel trigger-all-examples GitHub Actions workflow runner (.github/workflows/trigger-all-examples.yml), matrix results aggregation script (.github/scripts/aggregate-example-results.js), unit tests, and launch script compatibility fixes across example workloads.

🔗 Verified Workflow Run: Trigger All Example Workloads — Run #34948317955

Screenshot of the created experiments
image

Motivation & Context

Previously, PR #847 (and integrated into CI in PR #852) introduced .github/workflows/trigger-demo-workload.yml to trigger and launch a single demonstration workload (examples/simple_job).

This PR replicates and generalizes that architecture for all 12 example workloads in parallel via GitHub Actions matrix execution:

  • Replicates the Workload Identity Federation (WIF) authentication and virtual environment provisioning pattern established in .github/workflows/trigger-demo-workload.yml.
  • Scales execution across all 12 example suites concurrently (fail-fast: false), capturing individual experiment XIDs and generating aggregated summary dashboards via a dedicated Node.js script (.github/scripts/aggregate-example-results.js).
  • Applies necessary resilience and identifier parsing fixes to individual example launch scripts so all 12 workloads run seamlessly in CI against xmc-nightly.

Key Changes

  • Parallel Runner Workflow (.github/workflows/trigger-all-examples.yml):
    • Matrix strategy running all 12 example workloads in parallel (fail-fast: false).
    • Supports workflow_dispatch (with examples_filter, queue_name, timeout_minutes) and workflow_call.
    • Captures and outputs aggregated JSON map of launched experiment XIDs and formatted summary tables in $GITHUB_STEP_SUMMARY.
  • Dedicated Aggregation Script & Unit Tests:
    • Added .github/scripts/aggregate-example-results.js to parse artifact JSONs, assemble Markdown summary tables, and format outputs.
    • Added comprehensive test suite in .github/scripts/aggregate-example-results.test.js (6 unit tests).
  • Launch Script Fixes & Resilience:
    • examples/metrics_dashboard_job/launch.py: Robust WorkUnit ID extraction from operation path / resource names.
    • examples/managed_xprof_artifact_job/launch.py: WorkUnit ID extraction from operation path and non-empty display_name defaults for artifact registration.
    • examples/xdash_dashboard/create_dashboard.py: XMC_DASHBOARD_ENDPOINT environment variable resolution, protocol prefix stripping, and graceful fallback when standalone dashboard gRPC service is not exposed in CI.

🛠️ Detailed Rationale for Launch Script Modifications

The following script updates were required to ensure seamless execution when triggered autonomously in CI against xmc-nightly:

  1. examples/metrics_dashboard_job/launch.py:

    • WorkUnit ID Parsing from LRO: The Experiment Storage Service (ESS) create_work_unit API returns a Long-Running Operation (experiments/<xid>/workUnits/<wid>/operations/<op_id>). Previously, the script extracted the ID using created_wu.name.split('/')[-1], which inadvertently grabbed the trailing Operation ID instead of the WorkUnit ID. The logic was refactored to parse parts[3] (the segment immediately following workUnits), ensuring the accurate WorkUnit ID is forwarded to downstream xDash dashboard builders.
  2. examples/managed_xprof_artifact_job/launch.py:

    • Robust WorkUnit ID Parsing: Applied the same fix as above to properly resolve parts[3] as the WorkUnit ID from the ESS Operation resource path.
    • Artifact Registration Schema Compliance: ESS CreateArtifact enforces non-empty display_name validation. A default fallback (display_name = "Managed XProf Profile") was added so artifact creation succeeds reliably during automated runs without requiring explicit CLI parameter overrides.
  3. examples/xdash_dashboard/create_dashboard.py:

    • gRPC Endpoint Normalization: Added resolution for $XMC_DASHBOARD_ENDPOINT / $DASHBOARD_ENDPOINT with automatic stripping of URI schemes (http://, https://) and path suffixes to construct well-formed host:port gRPC targets.
    • Resilience for Optional Services: In environments where ClickHouse/xDash is optional or not externally exposed (such as xmc-nightly deployed with enable_metrics: false), catching XDashError with a clear warning notice while still emitting the dashboard identifier prevents optional backend unavailability from failing the entire CI matrix job.

Verification & Testing

  • Pre-commit Hooks: ./.githooks/pre-commit check (100% clean across Buildifier, gofmt, addlicense, ruff, determinism).
  • JavaScript Unit Tests: node --test .github/scripts/aggregate-example-results.test.js (6/6 tests passing).
  • Workflow Execution: Run #34948317955.

Related Workflows & PRs

  • .github/workflows/trigger-demo-workload.yml (Single workload launcher introduced in PR #847 / PR #852)

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 improves endpoint parsing, environment variable fallback configuration, and work unit ID extraction across several example scripts. Feedback on these changes highlights two main issues: first, the work unit ID parsing in metrics_dashboard_job/launch.py incorrectly extracts the operation ID instead of the work unit ID, and should adopt the robust parsing logic used elsewhere; second, returning a success exit code of 0 when catching an XDashError in create_dashboard.py masks failures and should be reverted to a non-zero exit code to prevent issues in automated pipelines.

@janzak-dev
janzak-dev added this pull request to stack #883 September 15, 2026 07:55
@janzak-dev
janzak-dev force-pushed the feat/trigger-all-examples branch 2 times, most recently from bf49503 to 1a0285c Compare September 15, 2026 08:06
10000
@AntonTyb AntonTyb left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

in the screenshot you're showing the example "ClickHouse Metrics Ingestion Experiment" as successfully done. but the Performance Dashboards are not enabled (not visible on tabs list on the left).

How did it work/run exactly? was the dashboard service deployed? if so - why the "performance dashboard" tab is not shown in UI?

@janzak-dev
janzak-dev commented Sep 15, 2026 •
Copy link
Copy Markdown
Collaborator Author

in the screenshot you're showing the example "ClickHouse Metrics Ingestion Experiment" as successfully done. but the Performance Dashboards are not enabled (not visible on tabs list on the left).

How did it work/run exactly? was the dashboard service deployed? if so - why the "performance dashboard" tab is not shown in UI?

@AntonTyb This is the first action that runs the launch scripts and for now does a naive check of whether the corresponding experiment/workunit was created successfully (has a RUNNING/PENDING/OK etc. state).

More specific validation of whether all necessary resources have been created properly would be done later #878

@janzak-dev
janzak-dev requested a review from AntonTyb September 15, 2026 11:51
Base automatically changed from feat/examples-requirements to main September 15, 2026 12:59
…ipts

Introduce parallel multi-example workload runner workflow alongside
launch script fixes for workunit ID parsing, display name defaults,
and dashboard endpoint resolution.

TAG=agy
CONV=2889d5f4-f25d-4694-93f6-70447e012e6b
- Robustly parse work unit ID from Operation name in metrics_dashboard_job
- Return non-zero exit code on XDashError in create_dashboard

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…achable in create_dashboard

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…ults.js with unit tests

- Move inline python aggregation logic into dedicated Node.js script .github/scripts/aggregate-example-results.js.
- Add comprehensive unit test suite in .github/scripts/aggregate-example-results.test.js.
- Update trigger-all-examples.yml to checkout repo and execute node .github/scripts/aggregate-example-results.js.

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…_dashboard.py

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
…ow and remove env lookup in create_dashboard.py

TAG=agy
CONV=606f1e41-6785-4137-b85b-cd0f56237339
@janzak-dev
janzak-dev force-pushed the feat/trigger-all-examples branch from 781b3a4 to 70a5e8d Compare September 15, 2026 12:59
@AntonTyb
AntonTyb commented Sep 15, 2026 •
Copy link
Copy Markdown
Collaborator

in the screenshot you're showing the example "ClickHouse Metrics Ingestion Experiment" as successfully done. but the Performance Dashboards are not enabled (not visible on tabs list on the left).
How did it work/run exactly? was the dashboard service deployed? if so - why the "performance dashboard" tab is not shown in UI?

@AntonTyb This is the first action that runs the launch scripts and for now does a naive check of whether the corresponding experiment/workunit was created successfully (has a RUNNING/PENDING/OK etc. state).

More specific validation of whether all necessary resources have been created properly would be done later #878

this would mean that a partial fail of launch.py could still look as successful test run. can you:

  1. capture exit status of launch.py's and fail the pipeline on ANY failure (fail-fast: true)
    OR
  2. open a ticket to implement (1) - P1 at least...

@janzak-dev
janzak-dev added this pull request to the merge queue Sep 15, 2026
@janzak-dev
Copy link
Copy Markdown
Collaborator Author

Discussed offline.

Merged via the queue into main with commit abb9952 Sep 15, 2026
11 checks passed
@janzak-dev
janzak-dev deleted the feat/trigger-all-examples branch September 15, 2026 15:51
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

0