{{ message }}
Stop five Windows jobs rebuilding the same frontend on every commit - #9387
Merged
Conversation
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.

The Linux dist cache from #9375 is proven on main:
Cache hit for: fe-dist-Linux-<hash>,frontend up to date, zerobuilding frontendlines, and the install step 71.5s -> 34.6s. Windows pays the same cost and never had the cache.Measured on current main,
Windows Unsloth API CI:[72s] building frontend...->[168s] frontend built= 96s of a ~257s install (37%).Scope: 5 job definitions / 7 job runs, ~625s per commit
Two candidates were excluded on evidence, not judgement:
applocker-denied-launcherrunsinstall.ps1 --no-torchwithout--local, soinstall.ps1:5978setsSTUDIO_LOCAL_INSTALL=0,setup.ps1:3523takes the$IsPipInstallbranch, and run 32363473232 logsfrontend bundled (pip install). It never builds a frontend, so a cache there saves 0s and only spends budget. Pinned so nobody completes the set later.startup-profile-ci.ymlhaspull_request+workflow_dispatchand nopush, so it is a pure consumer. It restores on all three OSes but does not save. Its frontend build is 167s on Windows and 38s on macOS.Two blockers this had to clear
1. An empty dist is worse than no dist, and this repo already shipped that bug. Four workflow files carry a warning citing run
25546676715: pre-creating an emptystudio/frontend/disttripssetup.ps1's mtime check into "up to date", and Studio then 500s onGET /withFileNotFoundError: dist\\index.html. The Linux[ ! -d dist ]guard passes an empty directory. Windows has less backstop:update-idempotencyonly requests/api/health, neverGET /. So a hit is not trusted oncache-hit == 'true'alone.2. Re-dating goes through pwsh, not
touch.setup.ps1:3527reads(Get-Item $DistDir).LastWriteTime; the step assigns that exact property through that exact cmdlet. Git Bash'stouchon an NTFS directory reaches the same field through MSYS2'sutimensatand backup-semantics handle, which probably works -- and "probably" is the wrong standard when the failure is a reported hit with a rebuild behind it.Composite pair, not inline
Both approaches were built. The inline version (5 workflows, 422 lines of YAML, the key at six sites) was rejected by the agent that built it: the hazard motivating inline --
uses: ./...resolving fromGITHUB_WORKSPACE-- is absent here (no adopting job checks out withpath:) and is already guarded repo-wide. Against that, six copies of a key means drift is caught rather than prevented, and "safe because a test catches it" is strictly weaker than one definition. This repo already uses the same split forpip-cache-restore/pip-cache-save, for the identical reason: the save must come after a step the caller owns.Verified
test_frontend_dist_cache,test_uv_cache_discipline,test_cache_budget_discipline.lint_workflow_triggers.pyOK across 41 files.exit 1s).!studio/frontend/tests/**and!studio/frontend/scripts/**, and the guard that keeps those negations in place was carried across the merge and re-mutation-tested.Not yet run on a Windows runner. The pwsh argument writes the same .NET property
setup.ps1reads and the setter semantics were proven locally, but the evidence you would want --Cache hit for: fe-dist-Windows-<hash>followed byfrontend up to dateand zerobuilding frontendlines -- needs a push to main to populate the first entry.