Skip to content

CI: fold the mac update smoke into the same job, running last as teardown - #7980

Merged
danielhanchen merged 3 commits into
mainfrom
ci/fold-mac-update-smoke
Aug 6, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
ci/fold-mac-update-smoke

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Stacks on #7975. Third and last macos-14 job sharing the byte-identical bootstrap:

checkout -> setup-node -> setup-python
  -> install.sh --local --no-torch -> assert-llama-loads.sh

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.

After this: one install, three phases. A studio/** PR starts 4 macOS jobs instead of 6.

On uninstall.sh being the cleanup mechanism

Worth being explicit, because it is the obvious thing to get wrong here: uninstall.sh is not used as this job's teardown.

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 where the bug is.

So the update phase runs last, and that ordering is load-bearing:

  • "Uninstall and verify clean" is step 31 of 32
  • the only step after it is the artifact upload, which reads logs/ and nothing else
  • a broken uninstall.sh therefore fails this job, which is the point, and cannot corrupt an earlier phase

Nothing that needs Unsloth installed may ever be appended after that step; the comment in the workflow says so.

For the same reason the phases are ordered rather than reset-and-repeated. Genuine reset-between-phases would need teardown independent of the code under test, and on macOS runners there is no good primitive for it: bwrap is Linux namespaces and has no macOS equivalent, and APFS snapshot rollback needs root plus a reboot, which is not something a hosted runner can do mid-job.

Collisions resolved

Collision Consequence Fix
update phase wrote logs/studio.log, already owned by the UI phase UI server log truncated before upload writes logs/studio_update.log
its four log files lived in a separate artifact lost on merge carried into the existing upload
scripts/uninstall.sh not in this workflow's paths update phase would not run on the change it exists to catch added

Port 18891 was already distinct, so it is unchanged.

Verification

  • One job, 32 steps, no duplicate step ids
  • Exactly 1 install (was 3 across the three workflows)
  • Five distinct ports (18891/18894/18895/18896/18897), four distinct server logs
  • Uninstall and verify clean is the last step before upload; confirmed nothing after it needs Unsloth installed
  • Assertion-preservation diff across both absorbed workflows: 12 commands before, 12 after, none lost
  • CI green

Note on the base branch

Targets ci/consolidate-macos-smoke-jobs (#7975) rather than main, since it builds on that merge. Retarget to main once #7975 lands.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: 5e88882073

ℹ️ 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".

# ---------------------------------------------------------------
- name: First update should be a no-op (prebuilt already validated)
id: update_first
if: ${{ !cancelled() && steps.install_unsloth.outcome == 'success' && steps.assert_llama.outcome == 'success' }}

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 Decouple the install gate from GGUF priming

When the HF cache misses and the GGUF download fails, or when the cache-save action fails, Install Unsloth is still skipped by its implicit success() because it follows those UI-only steps; its outcome is therefore skipped, so this condition suppresses the entire update/uninstall phase. The deleted update workflow did not prime or save a GGUF before installing, so an unrelated Hugging Face/cache outage now removes the only macOS coverage of studio update and scripts/uninstall.sh. The new explicit phase conditions do not address this earlier dependency; move the shared install ahead of GGUF priming or otherwise allow it to run after those unrelated failures.

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.

Checked both mechanisms against the actual steps, and neither can fire.

  1. "The GGUF download fails." It cannot fail the step. Prime HF_HOME calls .github/scripts/hf-download-with-retry.sh, whose loop has exactly one exit: exit 0 on success. Every other outcome (non-zero rc, a stall past HF_DOWNLOAD_STALL_SECONDS, even hf not being on PATH) increments attempt and continues, and its own header says so: "Retries are unbounded -- the enclosing GitHub Actions job's timeout-minutes is the real bound." So a Hugging Face outage does not produce a failed step, it produces a hang until the job's 65 minutes are up. That is a cancellation, not a failure, so no if: rescues it, and the suggested reorder does not either: install would already have run, but the update phase sits after the hung prime step and the runner is gone before it is reached.

  2. "The cache-save action fails." actions/cache/save reports save problems as warning annotations and does not fail the step; the toolkit swallows the reserve exception rather than propagating it (cache.saveCache should raise an error on reserve failure, but doesn't actions/toolkit#1642, and the familiar "Failed to save: Unable to reserve cache with key ..., another job may be creating this cache" that shows up as a warning). The restore above it is already continue-on-error: true, so a cache miss or a restore error leaves the job status success too.

What is left is python -m pip install --upgrade huggingface_hub in that same step failing, and install.sh does far more pip and network work than one upgrade, so it would not survive a PyPI outage either. Against that, !cancelled() on the install step would spend about ten minutes of a macOS slot (capped at 5 account-wide, shared with unsloth-zoo) on a guaranteed-failing install after a broken checkout or setup-python.

Also worth noting that the update phase does not use the primed cache at all: assert-llama-loads.sh only runs llama-server --version plus a static vtool minimum-OS check, and the phase itself is studio update, an /api/health boot, and uninstall.sh. The GGUF exists for the Playwright chat runs.

The Playwright case in your previous comment was different in kind, and that is why it got a fix: that phase fails for real and often enough that the step carries a three-attempt flake-retry loop.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 172ef2344a

ℹ️ 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".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 6, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 6, 2026
@danielhanchen
danielhanchen force-pushed the ci/consolidate-macos-smoke-jobs branch from 908e033 to 7ab1f26 Compare August 6, 2026 07:25
@danielhanchen
danielhanchen deleted the branch main August 6, 2026 07:26
@danielhanchen danielhanchen reopened this Aug 6, 2026
@danielhanchen
danielhanchen changed the base branch from ci/consolidate-macos-smoke-jobs to main August 6, 2026 07:27
…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.
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.
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.
@danielhanchen
danielhanchen force-pushed the ci/fold-mac-update-smoke branch from 172ef23 to 934d08b Compare August 6, 2026 07:27
@danielhanchen
danielhanchen merged commit edb78c7 into main Aug 6, 2026
6 of 7 checks passed
@danielhanchen
danielhanchen deleted the ci/fold-mac-update-smoke branch August 6, 2026 07:28
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: edb78c79a1

ℹ️ 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".

@danielhanchen

Copy link
Copy Markdown
Member Author

pre-commit.ci run

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