8000 refactor(ci): consolidate demo workload launch and verification into unified nightly workflow by janzak-dev · Pull Request #895 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

refactor(ci): consolidate demo workload launch and verification into unified nightly workflow - #895

Merged
janzak-dev merged 10 commits into
mainfrom
feat/verify-demo-workload-completion
Sep 18, 2026
Merged

janzak-dev merged 10 commits into
mainfrom
feat/verify-demo-workload-completion

Conversation

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

Summary

A standalone "deploy demo job" (trigger-demo-workload.yml) provides limited value on its own and caused duplicated ~75s runner setup overhead before validation could even begin. This change consolidates trigger-demo-workload.yml and nightly-test-suite.yml into a single, unified workflow in .github/workflows/nightly-test-suite.yml.

Executing launch and verification within a single job eliminates redundant runner boot and environment setup time, starts verification <1s after workload launch (enabling active polling across STARTING -> RUNNING -> COMPLETED states), and simplifies variable passing via step outputs (steps.launch-demo-workload.outputs.xid). Additionally, configurable workflow_dispatch inputs with boolean flags (verify_workload, report_failure) defaulting to true give developers full control to optionally skip verification or failure alerts on manual runs.

Motivation & Context

  • Eliminate Runner Overhead: Running separate trigger and verify workflows required spinning up two independent GitHub runners, wasting ~75 seconds on duplicate GCP authentication, Python dependency setup, and artifact staging.
  • Immediate State Polling: Immediate in-job transition from launch to verification allows the validator to catch the full lifecycle of ephemeral demo workloads starting from STARTING state.
  • Streamlined Workflow & Alerting: Removing the redundant standalone trigger workflow consolidates alerting logic (.github/scripts/nightly-failure-alert.js) to track the unified run-and-verify-demo-workload job while retaining backwards compatibility.

Key Changes

Component / File Description of Changes
.github/workflows/nightly-test-suite.yml Consolidated workload launch, verification, and failure alerting into single run-and-verify-demo-workload job. Added verify_workload and report_failure inputs (defaulting to true).
.github/workflows/trigger-demo-workload.yml Removed obsolete standalone workflow.
.github/scripts/nightly-failure-alert.js Updated triggerOutcome and verifyOutcome to inspect the unified job ID run-and-verify-demo-workload with fallback support for legacy workflow step keys.
tools/nightly_tests/demo_workload_verify.py Set wait_for_completion=True in validate_work_units to ensure complete execution verification before exit.
tools/nightly_tests/xmc_entities_validator.py Added intermediate polling status log (Experiment does not yet match the expected state. Sleeping for {poll_interval_sec}s...) during status polling loops.

Assumptions

None — requirements were fully specified.

Verification & Testing

Successful End-to-End Workflow Run

image

Unit Tests & Code Quality

  • Alert Script Unit Tests: node --test .github/scripts/nightly-failure-alert.test.js (27/27 tests passing)
  • Bazel Test Suite: bazel test //tools/nightly_tests:all (all tests passing)
  • Pre-commit Checks: ./.githooks/pre-commit (all linters, buildifier, ruff, addlicense passing cleanly)

TAG=agy
CONV=df3c1c34-924a-42d3-81dc-9755d79b93f5

… script

Update demo_workload_verify.py to verify that all WorkUnits of the demo experiment reach terminal COMPLETED state after execution, and add configurable CLI flags for timeout, queue, work unit count, title pattern, and polling interval. Add comprehensive unit tests in demo_workload_verify_test.py.

TAG=agy
CONV=df3c1c34-924a-42d3-81dc-9755d79b93f5
@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 refactors the nightly demo workload verification script to support command-line flags for configuration (such as timeout, expected work units, and queue) and introduces a comprehensive unit test suite. The code reviewer identified several opportunities to simplify the implementation and tests. Specifically, they pointed out a redundant gRPC round-trip to re-fetch the experiment metadata and a redundant manual check for work unit completion, as the validation helper already guarantees this state. Consequently, they recommended updating the corresponding unit tests to reflect these simplifications and to test realistic failure scenarios, such as timeout exceptions.

Remove tools/nightly_tests/demo_workload_verify_test.py and its Bazel
build target.

TAG=agy
CONV=df3c1c34-924a-42d3-81dc-9755d79b93f5
…ator

TAG=agy
CONV=df3c1c34-924a-42d3-81dc-9755d79b93f5
…unified nightly workflow

TAG=agy
CONV=df3c1c34-924a-42d3-81dc-9755d79b93f5
@janzak-dev janzak-dev changed the title feat(ci): verify demo workload completion in nightly verification script refactor(ci): consolidate demo workload launch and verification into unified nightly workflow Sep 17, 2026
@janzak-dev
janzak-dev requested a review from AntonTyb September 17, 2026 07:28
@janzak-dev
janzak-dev marked this pull request as ready for review September 17, 2026 07:28
@janzak-dev janzak-dev added the priority::2-high top of mind. should not wait. label Sep 17, 2026
@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.

watch out - python print("stuff") is not 100% reliable in containerized workloads.
please consider using print("stuff", flush=True) or logging package

@janzak-dev
Copy link
Copy Markdown
Collaborator Author

watch out - python print("stuff") is not 100% reliable in containerized workloads. please consider using print("stuff", flush=True) or logging package

I've updated all print(...) calls in tools/nightly_tests/simple_job_verify.py (as well as helper routines in common.py and polling logs in xmc_entities_validator.py) to use flush=True so log output streams immediately without buffering delay. I also synced and merged the latest main branch (incorporating the demo_workload_verify -> simple_job_verify refactoring).

@janzak-dev
janzak-dev requested a review from AntonTyb September 17, 2026 11:52
AntonTyb
AntonTyb previously approved these changes Sep 17, 2026
@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.

side question - will nightly pipeline add a tag to repo at start?

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

side question - will nightly pipeline add a tag to repo at start?

No - I haven't considered it yet. We can discuss this.

@janzak-dev
janzak-dev added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 23f7847 Sep 18, 2026
11 checks passed
@janzak-dev
janzak-dev deleted the feat/verify-demo-workload-completion branch September 18, 2026 08:19
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