Skip to content

CI: fold the mac API smoke into the UI smoke, drop the subsumed install leg - #7975

Merged
danielhanchen merged 2 commits into
mainfrom
ci/consolidate-macos-smoke-jobs
Aug 6, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
ci/consolidate-macos-smoke-jobs

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Follow-up to #7974. Two more macOS slots, both from duplication rather than coverage.

Concurrent macOS jobs are capped at 5 per account, shared across every macos-* label and across unslothai/unsloth and unslothai/unsloth-zoo. That is the binding CI constraint here; the 60-job total is not close to reached.

Merging api-smoke into ui-smoke

studio-mac-api-smoke and studio-mac-ui-smoke were the same job with different assertions on the end:

  • same model, unsloth/gemma-3-270m-it-GGUF, same UD-Q4_K_XL variant
  • same HF_HOME cache key
  • 6 of 7 identical path filters
  • a byte-identical five-step preamble: checkout, setup-node, setup-python, install.sh --local --no-torch, assert-llama-loads.sh

So any studio/** PR paid two macOS slots and two full installs to test two surfaces of the same server.

The API phase now runs at the end of the UI job on port 18894, chosen so it does not depend on clean shutdown of 18896/18897 (UI phases) or 18895 (permission-browser script). It reuses the install that job already did. Timeout 35 -> 50 to cover the added phase.

Dropping the install-matrix macos-14 leg

That leg was the shared preamble plus an artifact upload. The same install.sh + assert-llama-loads.sh pair already runs on macos-14 in studio-mac-update-smoke, studio-mac-ui-smoke, studio-mac-inference-smoke and clean-machine-install-ci.

I checked this per path rather than by eye: every path that triggers studio-mac-install-matrix also triggers at least one of those on macos-14. The one exception is editing the workflow file itself, which still validates on the four remaining legs.

macos-15, macos-26, macos-15-intel and macos-26-intel stay. They are the only place those OS versions are exercised anywhere in CI, and dropping them would be real coverage loss.

Test plan

  • All workflow files parse as valid YAML
  • Assertion-preservation diff: test-command set extracted from every run: body is identical before and after
  • No duplicate step ids in the merged job (28 steps, all ids unique)
  • All four server ports distinct: 18894 / 18895 / 18896 / 18897
  • Every studio_api_smoke.py invocation and pip install pyjwt preserved
  • macOS job census: 31 -> 29; a studio/** PR now starts 5 macOS jobs instead of 6
  • No test or guard script referenced the deleted workflow; stale comment cross-references updated in studio-windows-api-smoke.yml
  • CI green on this PR

Deliberately not included: merging the three inference-smoke jobs

The plan for this work also called for collapsing studio-mac-inference-smoke.yml 3 jobs into 1. I stopped short, because inspection turned up blockers that were not visible when it was scoped:

  • Duplicate step ids. cache-gguf and download-gguf each appear in both tool-calling and json-images. Duplicate ids in one job are a hard workflow error, so the merge is not the clean splice it looks like.
  • Shared cache directory. Both jobs cache to gguf-cache with different models. Merged, phase 3 could restore phase 2 model bytes. Disambiguating means touching 28 reference sites inside the assertion blocks the plan promised to move verbatim.
  • HF_HOME inheritance. Phases 2 and 3 deliberately have no HF_HOME; merging into phase 1 job env would silently give them one.
  • Serialization. Three ~25 min parallel jobs become one ~75 min sequential job, tripling latency of that check for a saving that is mostly slot-burst rather than throughput.

Worth doing, but as its own PR with staging validation on a real Mac, not folded in here.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab72e1ccb4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# exactly what the Linux row already asserts. macOS concurrency is
# capped at 5 account-wide; do not add it back without a Mac-specific
# assertion to justify it.
os: [ubuntu-latest, windows-latest]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep POSIX installer tests on a macOS runner

The rationale only evaluates test_cross_platform_parity.py, but this matrix also runs three Bash tests for the Mac-supported install.sh/setup.sh whenever runner.os != 'Windows'. Removing this row means those scripts now run only with Ubuntu's GNU userland, so regressions involving macOS's BSD shell utilities can pass CI; a repo-wide workflow search shows these three test scripts are not invoked anywhere else. Retain Mac coverage for these steps or move them into another Mac workflow rather than dropping the entire row.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The three shell steps are real, but they cover Intel XPU logic that no Mac can reach, so the macOS row was not buying Mac coverage for install.sh / setup.sh.

test_install_sh_xpu_flavor_probe.sh exercises _installed_torch_version_for_tag, which is only called from the flavor guard at install.sh:4437. That guard runs only when _expected_torch_flavor_tag is non-empty and not "cpu", and on Darwin get_torch_index_url returns $_base/cpu (install.sh:2902), so the guard body never executes on a Mac. Its own header says so: "--no-torch / CPU-only / macOS: no-op."

test_setup_xpu_fastpath_escape.sh and test_setup_xpu_posix_summary.sh key on a +xpu torch wheel or a .../whl/xpu index pin. setup.sh:1316 states the rule directly: "Linux Intel support is an explicit index pin, not autodetection." There is no +xpu wheel for macOS, so both blocks are inert there.

What a Mac runner would actually have tested is BSD awk/grep and bash 3.2 against install.sh and setup.sh, and that is still covered, by running them for real rather than by extracting a function: studio-mac-update-smoke, studio-mac-ui-smoke, studio-mac-inference-smoke, studio-mac-install-matrix and clean-machine-install-ci all run bash install.sh --local --no-torch on a macos runner (Bash 3.2.57 per the runner image manifest), and studio-mac-update-smoke additionally runs unsloth studio update --local twice, which shells out to bash studio/setup.sh (unsloth_cli/commands/studio.py:2757). A bash-3.2 parse error or a BSD-userland divergence anywhere in either script fails those jobs.

Left the matrix as is and recorded the reasoning next to it in 908e033 so the next reader does not have to re-derive it.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 908e033ff9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ll leg

Two more macOS slots, both from duplication rather than coverage.

studio-mac-api-smoke and studio-mac-ui-smoke were the same job with different
assertions on the end. Same model (unsloth/gemma-3-270m-it-GGUF), same
UD-Q4_K_XL variant, same HF_HOME cache key, 6 of 7 identical path filters, and
a byte-identical five-step preamble: checkout, setup-node, setup-python,
install.sh --local --no-torch, assert-llama-loads.sh. Any studio/** PR paid two
macOS slots and two full installs to test two surfaces of the same server.

The API phase now runs at the end of the UI job on port 18894, after the UI
phases have stopped their servers on 18896/18897 and the permission-browser
script has released 18895. It reuses the install already done by that job
rather than repeating it. Timeout goes 35 -> 50 to cover the added phase.

studio-mac-install-matrix loses its macos-14 leg. That leg was the shared
preamble plus an upload, and the same install.sh + assert-llama-loads.sh pair
already runs on macos-14 in studio-mac-update-smoke, studio-mac-ui-smoke,
studio-mac-inference-smoke and clean-machine-install-ci. Checked per path: every
path that triggers the workflow triggers at least one of those on macos-14, the
sole exception being an edit to the workflow file itself, which still validates
on the four remaining legs. macos-15, macos-26 and both Intel legs stay -- they
are the only place those OS versions are exercised anywhere in CI.

No assertion is lost. The test-command set extracted from every run: body is
identical before and after.

macOS jobs in this repo: 31 -> 29. A studio/** PR now starts 5 macOS jobs
instead of 6.
@danielhanchen
danielhanchen force-pushed the ci/consolidate-macos-smoke-jobs branch from 908e033 to 7ab1f26 Compare August 6, 2026 07:25
@danielhanchen
danielhanchen merged commit 5cb0fc5 into main Aug 6, 2026
13 of 14 checks passed
@danielhanchen
danielhanchen deleted the ci/consolidate-macos-smoke-jobs branch August 6, 2026 07:26
@danielhanchen
danielhanchen restored the ci/consolidate-macos-smoke-jobs branch August 6, 2026 07:27
@danielhanchen
danielhanchen deleted the ci/consolidate-macos-smoke-jobs branch August 6, 2026 07:27
danielhanchen added a commit that referenced this pull request Aug 6, 2026
…down

Third and last macos-14 job that shared the byte-identical install.sh --local
--no-torch plus assert-llama-loads.sh bootstrap. A single studio/** PR was
paying three macOS slots and three full installs to test three surfaces of the
same install, against a pool capped at 5 concurrent jobs account-wide and
shared with unslothai/unsloth-zoo.

The update phase runs LAST, and that ordering is load-bearing rather than
incidental. It ends by running scripts/uninstall.sh and asserting the machine
is clean. That step is the assertion under test, not this job's teardown: it is
step 31 of 32, and the only thing after it is the artifact upload, which reads
logs/ and nothing else. So a broken uninstall.sh fails this job, which is the
point, without corrupting any earlier phase. Nothing that needs Unsloth
installed may ever be appended after it.

Deliberately not using uninstall.sh as a general between-phase cleanup. Using
the code under test to reset state for later tests is circular: a regression in
uninstall.sh would silently poison whatever ran next instead of failing here.
That is also why the phases are ordered rather than reset-and-repeated.

Collisions resolved: the update phase booted on 18891 (distinct) but wrote
logs/studio.log, which the UI phase already owns, so it would have truncated
the UI server log; it now writes logs/studio_update.log. Its four log files are
carried into the existing artifact upload. scripts/uninstall.sh is added to the
paths filter -- it is the one path the update workflow watched that this one
did not already cover.

Verified: one job, 32 steps, no duplicate step ids, exactly one install (was 3
across the three workflows), five distinct ports, four distinct server logs,
uninstall last, and the extracted test-command set across both absorbed
workflows is unchanged at 12 commands with none lost.

macOS jobs: 29 -> 28 on top of #7975; a studio/** PR now starts 4 instead of 6.
danielhanchen added a commit that referenced this pull request Aug 6, 2026
…down (#7980)

* CI: fold the mac update smoke into the same job, running last as teardown

Third and last macos-14 job that shared the byte-identical install.sh --local
--no-torch plus assert-llama-loads.sh bootstrap. A single studio/** PR was
paying three macOS slots and three full installs to test three surfaces of the
same install, against a pool capped at 5 concurrent jobs account-wide and
shared with unslothai/unsloth-zoo.

The update phase runs LAST, and that ordering is load-bearing rather than
incidental. It ends by running scripts/uninstall.sh and asserting the machine
is clean. That step is the assertion under test, not this job's teardown: it is
step 31 of 32, and the only thing after it is the artifact upload, which reads
logs/ and nothing else. So a broken uninstall.sh fails this job, which is the
point, without corrupting any earlier phase. Nothing that needs Unsloth
installed may ever be appended after it.

Deliberately not using uninstall.sh as a general between-phase cleanup. Using
the code under test to reset state for later tests is circular: a regression in
uninstall.sh would silently poison whatever ran next instead of failing here.
That is also why the phases are ordered rather than reset-and-repeated.

Collisions resolved: the update phase booted on 18891 (distinct) but wrote
logs/studio.log, which the UI phase already owns, so it would have truncated
the UI server log; it now writes logs/studio_update.log. Its four log files are
carried into the existing artifact upload. scripts/uninstall.sh is added to the
paths filter -- it is the one path the update workflow watched that this one
did not already cover.

Verified: one job, 32 steps, no duplicate step ids, exactly one install (was 3
across the three workflows), five distinct ports, four distinct server logs,
uninstall last, and the extracted test-command set across both absorbed
workflows is unchanged at 12 commands with none lost.

macOS jobs: 29 -> 28 on top of #7975; a studio/** PR now starts 4 instead of 6.

* CI: gate the folded update phase on the bootstrap, not on the UI phases

A step with no `if:` gets an implicit `success()`, so after the fold a single
flaky Playwright failure above skipped the whole update + uninstall phase. As
its own workflow it ran regardless, and it is the only Mac coverage of
`studio update` and scripts/uninstall.sh, so the fold quietly made that
coverage conditional on the least reliable phase in the job.

`!cancelled()` overrides the implicit success() while the step-outcome checks
still require a working install to test against: the first update needs
install.sh plus assert-llama-loads.sh, the second needs the first, and the
post-update boot needs the second. Uninstall is gated on the install alone
since it is a separate surface, and a broken `studio update` must not hide
whether the machine still comes out clean.

The `${{ }}` wrapper is required rather than stylistic: a bare leading `!` is
a YAML tag indicator and fails to parse. Verified with actionlint, which also
typechecks every steps.<id> reference.

* CI: bound GGUF priming so a stall cannot swallow the update phase

hf-download-with-retry.sh retries forever by design, and its own header says
the enclosing job's timeout-minutes is the only bound. So the hf-xet stall that
script exists to survive does not fail the priming step, it hangs it: the job
burns all 65 minutes and is cancelled, and no `if:` survives a cancellation.
Before the fold that cost the UI phases only, because the update workflow was a
separate job that never primed a GGUF. After it, one Hugging Face stall removes
the only macOS coverage of `studio update` and scripts/uninstall.sh.

Priming now carries timeout-minutes: 25, and the two bootstrap steps carry
`!cancelled()` so they still run when it trips. A step-level timeout is a step
failure rather than a cancellation, which is what makes this work; verified on
a real runner rather than from the docs, which do not spell it out. A probe job
with a 1-minute step timeout on a sleeping step recorded that step
failure/failure, ran every `!cancelled()` and `failure()` step after it, and
skipped both the bare implicit-success() step and the `cancelled()` one.

25 minutes is about 7x the healthy time for a ~200 MB GGUF plus stories260K, so
a merely slow download will not trip it, and the update phase needs no GGUF at
all: assert-llama-loads.sh runs llama-server --version plus a static vtool
minimum-OS check, and the phase itself is update, an /api/health boot, and
uninstall.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ab1f261da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +366 to +367
- name: Install pyjwt for the JWT-expiry forge test
run: pip install 'pyjwt>=2.6'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Run the API phase after UI test failures

Because this first absorbed API step has the default success() condition, a failure in either Playwright flow or the permission-browser step causes this and every subsequent API/auth step to be skipped. The deleted API workflow ran independently, so such a PR previously still produced the API result; now a UI failure can conceal a simultaneous API regression until the UI is fixed and CI is rerun. Gate this phase on the shared installation succeeding rather than on every preceding UI assertion succeeding.

Useful? React with 👍 / 👎.

danielhanchen added a commit that referenced this pull request Aug 6, 2026
* CI: run the three mac inference smokes as phases of one job

The three jobs in this workflow differed only in model, port and test body.
Their checkout, setup-node, setup-python, install.sh --local --no-torch and
assert-llama-loads.sh preamble was byte-identical, so every triggering PR ran
the same install on three macos-14 runners at once. Concurrent macOS jobs are
capped at 5 per account and that pool is shared with unslothai/unsloth-zoo, so
this one workflow took 3 of the 5 slots to derive the same install three times.

They are now three sequential phases sharing a single install. Each phase keeps
its own model cache, port, server log and uploaded artifact, so a failure still
names one phase and the earlier phases' logs survive it.

Collisions the merge had to resolve, none of which were visible from the job
list alone:

  - cache-gguf and download-gguf were defined in both the tool-calling and
    json-images jobs. Duplicate step ids inside one job are a hard error, so
    they are suffixed -tools and -vision.
  - both jobs cached to the same gguf-cache directory with different models.
    Merged, the vision phase could have restored tool-phase bytes. Split into
    gguf-cache-tools and gguf-cache-vision.
  - all three boots wrote logs/studio.log, so merged, each phase would have
    truncated the previous phase's diagnostics. Split per phase.

Phase-specific values are set only through , never at job level.
Whether a later  write beats a job-level env: key of the same name
is not something the Actions docs pin down, and a phase quietly talking to the
previous phase's port is a bad way to discover the answer. Everything inside
${{ }} is a literal for the same reason: a cache key that silently resolved to
the wrong model would still pass, just against the wrong bytes. The literals
resolve to the same strings as before, so existing caches still hit.

Verified: one job, 37 steps, no duplicate ids or artifact names, no dangling
steps.* references, exactly one install, three distinct ports and logs, and the
extracted test-command set is identical to before once the cache-directory
rename is normalised.

macOS jobs in this repo: 29 -> 27 on top of #7975 (31 -> 29 on main alone).

* CI: bump the renamed GGUF cache keys so the merged phases can cache at all

Caught by an A/B on staging CI, not by inspection.

Splitting gguf-cache into gguf-cache-tools and gguf-cache-vision kept the cache
keys byte-identical, which looked safe. It is not. actions/cache identifies an
entry by key AND a version hash derived from the path input, while key
uniqueness is global per ref. So the pre-existing gguf-cache entries still hold
the old keys: a restore into the new directory misses on version, and the
matching save is then refused with "Unable to reserve cache with key ...,
another job may be creating this cache".

The result is not a one-time repopulation. It is permanent: two consecutive
staging runs of the merged workflow both logged "Cache not found for input
keys" and both failed to save, so both re-downloaded the tool model (~890MB)
and the vision model (~2.4GB + 986MB). That is roughly 3.3GB per run, forever,
on a macOS runner from a pool capped at 5 concurrent jobs.

Bumping the key suffixes (tools v1 -> v2, vision v2 -> v3) gives the new paths a
free key so the entries actually populate.

The rule this encodes: changing an actions/cache path requires changing the key
too, even though the key alone looks like it fully identifies the entry.

* CI: keep per-phase timeouts and phase independence in the merged mac smoke job

Merging the three mac inference jobs into one job lost two properties the
separate jobs had.

A step with no explicit `if:` gets an implicit `success()`, and that check is
job-wide, not per-step. So one failed step in phase 1 skipped every remaining
step of phases 2 and 3, and a tool-calling or vision regression went unreported
until phase 1 was fixed and the job re-run. Phases 2 and 3 now run under
`!cancelled() && steps.assert-llama.outcome == 'success'`: a failure inside a
phase no longer skips the phases after it, while a failure in the SHARED
preamble (checkout, install, llama.cpp load check) still skips them, since
assert-llama is itself skipped in that case. The job still ends red, because the
failed step already set the job status.

The three jobs were also capped at 25 / 25 / 30 minutes each; the merged job had
only the aggregate 90. hf-download-with-retry.sh retries forever and names the
enclosing timeout as its bound, so one stalled download could hold a macOS slot
for the full 90 minutes and leave nothing for the phases behind it. Every step
that can block now carries its own timeout-minutes, with 90 kept as the outer
guard.

Also drops the two leftover job divider comments that still announced jobs 2 and
3 in the middle of the step list.

* CI: keep the shared preamble out of phase 1's failure chain

The previous round gated phases 2 and 3 on steps.assert-llama.outcome, so a
failure inside one phase no longer suppresses the others. It left the two shared
preamble steps on the implicit success() check, which reopens the same hole one
level up.

Install Unsloth and Assert llama.cpp both had no if:, so GitHub applied
success(), which is true only when every previous step succeeded. Phase 1's
Prime HF_HOME sits above them and carries a 15-minute timeout, and a step
timeout marks the step failed rather than cancelled. So a stalled or failing
phase-1 model download skips Install, skips Assert, leaves
steps.assert-llama.outcome == 'skipped', and silently takes phases 2 and 3 with
it. Before the consolidation those were independent jobs and still ran.

Install now runs under !cancelled(), and Assert gates on the install step
explicitly instead of on the job-wide implicit check. A phase-1 GGUF problem is
a phase-1 resource problem: the install probe that install.sh itself needs is
fetched live by hf_hub_download when the cache is cold, so the bootstrap can
still succeed and tool-calling and vision still get exercised. A genuinely
broken bootstrap still fails Install, which still skips Assert and correctly
holds both later phases out.

Ordering is unchanged, so no cache key or path moves.

Behaviour, verified against the step table: all green -> phases run; prime-hf
fails or times out -> phases run; checkout, setup-python or install fails ->
phases skipped; assert fails -> phases skipped; run cancelled -> all skipped.

* Bound the phase-1 cache actions in the mac inference smoke job

Phases 2 and 3 got timeout-minutes on their cache restore/save pairs in
the previous follow-up, but phase 1's pair was left unbounded. Before
consolidation that phase was a separate job with its own 25-minute
timeout, so a stalled cache action was bounded by it; after the merge
the only bound is the job's 90 minutes, and a stall there would hold a
macOS slot and starve phases 2 and 3.

15 minutes matches the sibling Prime HF_HOME step and phase 2's pair.
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.

1 participant