Skip to content

fix(examples): stop launchers when gateway readiness fails - #625

Open
Bluu (Bluuok) wants to merge 2 commits into
microsoft:mainfrom
Bluuok:fix/example-server-readiness
Open

Bluu (Bluuok) wants to merge 2 commits into
microsoft:mainfrom
Bluuok:fix/example-server-readiness

Conversation

@Bluuok

@Bluuok Bluu (Bluuok) commented Oct 3, 2026 •

Copy link
Copy Markdown

Seven example launchers continue to start controllers/trainers after all 60 gateway health probes fail, and each curl request can wait indefinitely. This hides the startup failure and can launch training against an unavailable gateway.

Give each probe a one-second timeout, track readiness explicitly, and exit with a diagnostic before launching the controller/trainer when the retry loop is exhausted. Cover Calc-X local/Minikube, GSM8K, multimodal QA, ScienceWorld, Search-R1 and LLM-in-Sandbox in one focused change.

Validation in the frozen Linux CPU environment:

python -m pytest tests/examples/test_launcher_readiness.py -q -p no:cacheprovider
python -m ruff check tests/examples/test_launcher_readiness.py
python -m ruff format --check tests/examples/test_launcher_readiness.py
python -m pre_commit run --files examples/calc_x/run_local.sh examples/calc_x/run_minikube.sh examples/gsm8k/run_local.sh examples/multimodal_qa/run_local.sh examples/science_world/run_local.sh examples/search_r1/run.sh examples/llm-in-sandbox/run.sh tests/examples/test_launcher_readiness.py
git diff --check

All 15 readiness tests passed: seven failure paths, seven delayed-success paths with intact arguments containing spaces, and one first-attempt success. The original six failure regressions failed on unchanged main; both added multimodal cases exposed missing gating/timeout in the previous branch version. Scoped Pyright and Bash syntax checks on repository-LF content passed. Earlier complete example-directory coverage passed 45 CPU tests before the multimodal addition; final combined verification is tracked separately.

The tests isolate all service, Ray, Minikube, cleanup, HTTP and training commands through a fake PATH. No real services, process termination, cluster, network or GPU training was exercised. Fork CI awaits maintainer approval. AI assistance was used; all seven launcher changes and regression coverage were reviewed.

@Bluuok
Bluu (Bluuok) marked this pull request as ready for review October 3, 2026 14:32
Copilot AI balanced review requested due to automatic review settings October 3, 2026 14:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The multimodal QA launcher retains the same readiness bug and is omitted from regression coverage.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds bounded gateway readiness checks so example launchers fail before starting controllers or trainers.

Changes:

  • Adds one-second curl timeouts and explicit readiness gates.
  • Adds parameterized regression tests for six launchers.
  • Leaves the equivalent multimodal QA launcher unchanged.
File Description
examples/​calc_x/​run_local.sh Gates local startup on gateway readiness.
examples/​calc_x/​run_minikube.sh Gates Minikube startup on gateway readiness.
examples/​gsm8k/​run_local.sh Adds bounded readiness failure handling.
examples/​science_world/​run_local.sh Prevents startup after failed probes.
examples/​search_r1/​run.sh Prevents startup after failed probes.
examples/​llm-in-sandbox/​run.sh Adds bounded readiness failure handling.
tests/​examples/​test_launcher_readiness.py Tests failure, delayed success, and argument forwarding.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +26 to +33
LAUNCHERS = [
Launcher("examples/calc_x/run_local.sh", "examples/calc_x"),
Launcher("examples/calc_x/run_minikube.sh", "examples/calc_x"),
Launcher("examples/gsm8k/run_local.sh", "examples/gsm8k"),
Launcher("examples/science_world/run_local.sh", "."),
Launcher("examples/search_r1/run.sh", "."),
Launcher("examples/llm-in-sandbox/run.sh", "."),
]

This branch has not been deployed

No deployments
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.

2 participants