Reusable smoke workflow: let a caller choose the runner - #161
Merged
Conversation
The reusable workflow hardcoded 'python .github/scripts/run_smoke.py', so the only way to run a different workspace script under the same ceremony was to copy the ceremony -- chain checkout at the matching branch, python setup, install epilogue, cache dirs, profile validation -- into a second workflow. run_smoke.py's own docstring records what that costs: the last duplicated copy of the env resolver drifted until the PR gate could not read the release profile. Three optional inputs, all defaulting to today's behaviour exactly: - runner: workspace-relative script to execute, default .github/scripts/run_smoke.py; - runner-args: extra arguments, word-split; - script-timeout: exported as BUILD_SCRIPT_TIMEOUT only when non-empty, so the default path still leaves it unset and the runner's own default and any profile override apply unchanged. All three reach the run step through env rather than being interpolated into the script body, since a caller supplies them from workflow_dispatch. Prompted by autolens_workspace_test#271, which needs to run a re-timing harness over the SLOW/NEEDS_FIX JAX entries N times under the real caps. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015qk7hoavMnFyPtW4toYn8K
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables autolens_workspace_test#271 (phase 2 of the
jax-compile-stallepic). Ledger:PyAutoMind/draft/bug/ci/jax_vmap_jit_compile_stall.md.Why
smoke-tests.ymlhardcodedpython .github/scripts/run_smoke.py. So the only way to run a different workspace script under the same ceremony — chain checkout at the matching branch, python setup, install epilogue, cache dirs, profile validation — was to copy that ceremony into a second workflow.run_smoke.py's own docstring records what that costs:The same argument applies one level up: one ceremony, so a diagnostic sweep and the PR gate cannot disagree about what environment a script runs in.
What changed
Three optional
workflow_callinputs, all defaulting to today's behaviour exactly:runner.github/scripts/run_smoke.pyrunner-args""script-timeout""BUILD_SCRIPT_TIMEOUT, only when non-emptyEvery existing caller is byte-identical in behaviour: none of them pass these, so
runnerresolves to the same path,runner-argsexpands to nothing, andBUILD_SCRIPT_TIMEOUTstays unset.That last point is deliberate rather than incidental. Setting
BUILD_SCRIPT_TIMEOUTunconditionally would have handedrun_smoke.pyan empty string toint()on every default run, and would also have stated a process-wide cap where today there is none — which risks overriding a profile's per-scriptoverridesvalue thatbuild_util.timeout_foris supposed to resolve. Hence theif [ -n "$SCRIPT_TIMEOUT" ]guard.All three reach the run step through
env:rather than${{ }}interpolation insiderun:. Callers will supply them fromworkflow_dispatch, and splicing dispatch input text straight into a shell body is a script-injection surface.The caller this unblocks
autolens_workspace_test#271 has to establish whether 21 SLOW-marked JAX entries are genuinely slow or are the #245 XLA compile stall mislabelled. A slow script has a tight timing distribution; a stalling one is bimodal. Telling them apart needs the same script run N times under the real cap — which is a different runner, not a different workflow.
The workspace side is a small
retime.ymlwithworkflow_dispatchthatuses:this workflow and passesrunner: .github/scripts/retime.py. Those PRs follow once this merges; they cannot pass arunnerinput that does not exist yet, so this one goes first.Verification
The change is inert on every current caller by construction — the defaults reproduce the previous invocation exactly. YAML parses and the input set is
chain, python-versions, runner, runner-args, script-timeout, slack-channel-id. Real exercise comes from the first workspaceretime.ymldispatch, and from every existing workspace's next smoke run continuing to behave as before.Generated by Claude Code