glaeda-cmux-runner-hook: take-root --switch and take-gui for cmux's E2E build - #1260
Merged
Merged
Conversation
teamleaderleo
force-pushed
the
hook-take-gui
branch
from
September 25, 2026 19:30
6babbbf to
39fe176
Compare
Two step-time helpers for cmux's E2E build, behind the existing glaeda-canonical-root shim: - take ROOT --switch: lets go of the roots the job holds, then waits for ROOT, so a build that finds a product to reuse at another canonical root can move there without ever holding two roots. Only roots with a holder of their own can be let go: those from an earlier take, and the admission root of a ROOT_SWITCHERS class (compile-gui), which admission now hands to a separate holder (<holder>-root-k.pid) instead of the main one. - take-gui [--wait S]: holds the gui token from that step to the end of the job (a <holder>-gui.pid holder, released by job-completed). A no-op when admission already gave the job gui. A job in take-gui holds a root while a gui job waiting in take-root holds gui, the opposite order, so take-root waiters leave capacity/root-k.want-<pid> markers and take-gui exits 3 (gave way) at once when a gui holder waits for one of its roots. compile-gui still takes gui at admission; dropping it waits for cmux's build to call take-gui before its tests. The shim needs a fleet re-apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e is held Review follow-ups for take-root --switch and take-gui: - --switch waits for the new root while still holding the old one and lets go only once the new one is held, then writes the new CMUX_CI_CANONICAL_ROOT to $GITHUB_ENV. A timeout used to leave the job holding no root while its environment still named the old one. - A switch needs a live holder for every held root, not just its pid file: a SIGKILLed holder's leftover file no longer lets a job hold two roots. - Waiters rewrite their want marker every poll and take-gui ignores and sweeps markers older than 10 s, so a killed waiter whose pid is recycled (or belongs to another user) cannot make take-gui give way. - take-gui releases the token and exits 1 when it cannot record holding it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s go Re-review follow-up: the record no longer names a released root if the hook dies mid-switch, and the ROOT_SWITCHERS comment matches the new order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo
force-pushed
the
hook-take-gui
branch
from
September 25, 2026 19:47
39fe176 to
1967826
Compare
teamleaderleo
added a commit
to manaflow-ai/cmux
that referenced
this pull request
Sep 25, 2026
The build job's tests share an owned Mac's one console session, so glaeda gives the job its gui token, today from job start, which keeps every other GUI job off that Mac through the whole compile. The step that decides whether the build tests now takes the token itself with glaeda's take-gui, so glaeda can stop handing it out at job start (teamleaderleo/glaeda#1260): - exit 0 (held, or already held from job start) or 2 (a hook without take-gui, which gave the token at job start): test here as before. - exit 3 (a GUI job holding the token waits for this job's canonical root, so waiting would deadlock) or 1 (still taken after 300 s): leave the tests to the test job, which the late upload already feeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo
added a commit
to manaflow-ai/cmux
that referenced
this pull request
Sep 25, 2026
…ild (#14705) The build job's tests share an owned Mac's one console session, so glaeda gives the job its gui token, today from job start, which keeps every other GUI job off that Mac through the whole compile. The step that decides whether the build tests now takes the token itself with glaeda's take-gui, so glaeda can stop handing it out at job start (teamleaderleo/glaeda#1260): - exit 0 (held, or already held from job start) or 2 (a hook without take-gui, which gave the token at job start): test here as before. - exit 3 (a GUI job holding the token waits for this job's canonical root, so waiting would deadlock) or 1 (still taken after 300 s): leave the tests to the test job, which the late upload already feeds. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
rajinsyed
pushed a commit
to rajinsyed/supermux
that referenced
this pull request
Oct 3, 2026
…ild (#14705) The build job's tests share an owned Mac's one console session, so glaeda gives the job its gui token, today from job start, which keeps every other GUI job off that Mac through the whole compile. The step that decides whether the build tests now takes the token itself with glaeda's take-gui, so glaeda can stop handing it out at job start (teamleaderleo/glaeda#1260): - exit 0 (held, or already held from job start) or 2 (a hook without take-gui, which gave the token at job start): test here as before. - exit 3 (a GUI job holding the token waits for this job's canonical root, so waiting would deadlock) or 1 (still taken after 300 s): leave the tests to the test job, which the late upload already feeds. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #1259 (which gives test-e2e's
buildthe compile-gui class).Why
On an owned mini, test-e2e's
buildholds the gui token for its whole job, about 15 min, but uses the console session only for its tests, about 1 min. It also can't adopt a product compiled at another canonical root. The job holds one root from admission, andtake-rootrefuses a second, different root. In the E2E reuse misses I checked, one product compiled at/private/tmp/cmux-ci-2was never adopted by a build holding/private/tmp/cmux-ci. This adds the two step-time helpers the cmux side needs. Nothing changes for any job until cmux calls them.What
Both go through the existing
glaeda-canonical-rootshim.take ROOT --switch.CMUX_CI_CANONICAL_ROOTto$GITHUB_ENV.take, or the admission root of aROOT_SWITCHERSclass. compile-gui is the only such class, and admission now hands its root to a separate<holder>-root-k.pidholder instead of the main one, which the main holder doesn't inherit. A root held by the main holder can't be let go (exit 2).take-gui [--wait S].<holder>-gui.pidholder that job-completed releases. It does nothing when admission already gave the job gui.capacity/root-k.want-<pid>, which saysguiwhen their job holds gui and is rewritten every second. take-gui exits 3 at once when a gui holder is waiting for a root this job holds. The caller then hands its tests to another job. Markers older than 10 s, or with a dead pid, are ignored and removed.take-gui. It is regenerated on fleet re-apply, while the hook file runs fresh for every job.Unchanged: compile-gui still takes gui at admission. Dropping that is a follow-up once cmux's build calls take-gui before its tests; otherwise a build would test without the token.
Compatibility
take-guiwith a usage error, exit 2. An old hook rejects--switchandtake-guithrough argparse, also exit 2. cmux has to treat 2 as "unsupported, fall back".Review
An independent read-only review of 87f5561 found nothing blocking. It checked the fd inheritance across the two forks, the error paths, and the deadlock argument: every wait is bounded,
--switchnever holds two roots, and the gui-for-root two-party cycle is broken by the marker and exit 3. It found four smaller issues, all fixed in 19c3012:The fixes are being re-reviewed on 19c3012.
Tests
test_switch_swaps_a_producers_root_without_holding_two: timeout keeps the old root, env export, dead holder, admission-held roottest_take_gui_holds_the_token_for_the_rest_of_the_jobtest_take_gui_gives_way_to_a_gui_job_waiting_for_its_root: real concurrent waiter, stale marker sweptscripts/test-glaeda-cmux-runner.py: 155 OKtest-glaeda-fleet-status.pyandtest-glaeda-cmux-runner-fleet.py: OK🤖 Generated with Claude Code