Repository navigation
ci: overflow hosted Mac e2e to EC2 during queue peaks - #322
Conversation
Sample the account backlog with the caller token, cache bounded reads, and let the pure planner choose EC2 without moving home or measured work. Preserve retry notices, name overflow jobs, and keep peer/refusal/alert consumers aware of that placement. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Cover complete queue pagination, status-transition deduplication and the deadline in the sampler tests. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55aad66987
ℹ️ 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".
| case $gates in | ||
| all|*e2e:*|*unit*) backlog_trailer=$(node "$(dirname "$0")/ci-gate-backlog.mjs") || backlog_trailer='' ;; | ||
| esac | ||
| [[ -z $backlog_trailer ]] || trailers+=$'\n'"$backlog_trailer" |
There was a problem hiding this comment.
Exclude the backlog timestamp from the default ref identity
For direct-route calls without --label, adding this trailer before deriving the label makes each refreshed sample change the ref, even when queue depths and resulting placement are identical. scripts/ci-gate-identity.mjs hashes Mac-Backlog: verbatim because its advisory-trailer filter does not exclude it, so changing only the sample's at produces a different label. Since .github/workflows/gate.yml:73-75 scopes cancellation to github.ref, an otherwise identical relaunch after the 60-second cache expires no longer supersedes its queued or running predecessor, allowing duplicate work to compound the backlog. Exclude the advisory sample from the identity hash while retaining the resolved placement outputs.
Useful? React with 👍 / 👎.
…tity Reject short final pages before advising EC2 overflow. Strip queue samples before both identity hashing and its committed-planner call so identical work still supersedes itself. Record the fail-open stale-lock takeover race for the next CI-hygiene wave. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…C2 Mac at queue peaks (#322) Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…'s start rows.ts keeps O8 M5's memberNames import and takes repoProjectId from @shared/machine/project-ids, where M3 moved it. Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Summary
When the account's hosted-Mac queue is backed up, place direct-hosted-eligible e2e groups on ci-kit-mac-ec2 only if its queue is shorter. Nothing moves without a fresh readable sample. Home, measured, live, secret, pool, reserved-final and otherwise non-hosted work retain their existing routing. The mini is never an overflow target.
The architect owns landing. This worker will not merge.
Proposed Decision Log entry (architect to number)
ci-gate samples the hosted macOS jobs queued/running across SSFSKIM/MAWS, cua, doperpowers, ci-kit and private manim-master, plus the EC2 runner's state and its compatible queued jobs. It uses the caller's gh token, not GITHUB_TOKEN. A
Mac-Backlog:JSON trailer carries the sample into the tested commit. A 60-second atomic per-machine cache shares reads; an in-flight count never makes a sibling wait. Each sample has at most 60 requests and a 45-second deadline; each request has at most 10 seconds. Failed, missing, malformed, future or older-than-five-minute samples preserve existing placement. Offline EC2 never receives overflow.The MAWS self-hosted count must finish; truncating it would incorrectly favor EC2. Every MAWS runners/runs/jobs page, including the final page, must contain exactly the number of rows its total_count implies; a mismatch fails open. Once it is complete, hitting the call cap in another repository yields an explicitly disclosed hosted lower bound, which favors today's hosted placement. An unreadable repository is a failed sample, not silently omitted. The caller's token successfully read all five repositories in the observed sample.
The backlog trailer is excluded from both the default-ref hash and the committed planner inputs used to derive that identity, so a relaunch of the same work supersedes its predecessor regardless of either placement. The planner is pure: its caller supplies the current time. In gate order, EC2 jobs ahead are
busy + EC2 queued + this run's overflowed groups; hosted full rounds ahead aremax(0, floor((hosted queued + running + this run's hosted groups - 5) / 5)). Overflow only when the former is strictly smaller; a tie stays hosted. These are queue-depth estimates, not duration predictions or reservations.Overflow requests
[self-hosted, macOS, ARM64, ci-kit-mac-ec2], uses the self-hosted setup and the group's minutes plus the ten-minute exclusive-instance start wait, and keeps direct hosting's one Playwright retry and aggregateMAWS flakyannotation. Its job name ise2e:<group> (EC2 overflow), preserved in ci-gate's tail. Peer holders/waiters and refusal relaunches recognize the suffix; artifacts and group identities remain unchanged. Existing prefix-based flake collection still recognizes the job and its runner. The preflight checks the EC2-specific label, so a free mini cannot mask an EC2 alert.HOSTED_MAC_ONLY_E2Ein gate.yml is the exclusion list for EC2-only reds. It is initially empty for the reasons below. Decision Log 123 remains binding: an EC2-only red is rerun on the mini before counting as a regression, and a group proved red only on EC2 leaves overflow immediately.Parity audit before this PR
Hosted reference: job 123180082301, image macos-26-arm64 20261013.0424.1. EC2 reference: read-only SSH checks and job 123162480732. No host setting was changed; no osascript ran over SSH.
/Library/Developer/CommandLineTools; Apple clang 21.0.0.github/ci-setup.shinstalls MesloLGM Nerd Font Mono 3.5.1 (confirmed in hosted log)No hosted-only setup step is copied to EC2. Display, Dock, scrollbar preferences and cask state are not changed by this feature.
Every supplied EC2 red
passRelay(page)after a direct fork and lacks ci: admit unsigned packaged gate to direct hosted Macs #297 / 4c3dd29. ci: admit unsigned packaged gate to direct hosted Macs #297 documents the same bug on the mini (40471243073) and corrects the test to assert the inherited direct route. These are not current-tree EC2 parity evidence. Neither packaged nor default is newly eligible for overflow.ci/o8m5f-53f147ef): its tree has ci: admit unsigned packaged gate to direct hosted Macs #297 but predates 54aab1a and contains O8 M5's unconditional People hover button, which steals the center click on the narrow project row. The architect identified and fixed that branch regression on hosted. This is not an EC2-only failure; default never overflows.Hosted-only list: empty. None of the supplied reds establishes the same tree green elsewhere and red only on EC2. This is not per-group EC2 admission. Every current
HOSTED_MAC_E2Egroup and the direct peer groupcross-buildrelies on its existing mini baseline, rather than a newly collected same-tree EC2 comparison. The historic successful connectors-oauth runs are not overflow admission: that group remains secret/non-hosted. The live run below is additional evidence only for its named groups.Verification
All four logs show
MAWS_E2E_RETRY: 1; none needed a retry or emitted a flaky notice. All names and ci-gate's final success lines include(EC2 overflow). Total: 41 passed, no failures. These four groups now have this additional EC2 evidence; the other eligible groups still rely on their mini baselines. This is not a full same-tree cross-runner admission campaign.Verified review fixes and final head
Final head: 97eda58. CI-opt verified the reviewer-medium findings and requested these changes:
Mac-Backlogbefore both hashing the identity and invoking its committed planner. The regression exercises absent, overflowing and non-overflowing samples: the placements differ when planned normally, but all three produce the same default label.docs/tech-debt-tracker.mdrecords the stale-lock takeover race, its duplicate-read / ENOENT fail-open consequence, and ownership-safe takeover plus per-process temporary files as the closing condition. No lock-race fix was added.Both behavior regressions were observed failing before implementation; the focused sampler file now passes 10/10 and identity file 8/8. Final-head remote static through the pristine master launcher is GREEN, 40804968791: typechecks, lint, build and 402/402 gate-script tests passed.
Strict-check live sampling
Ten direct
sampleBacklog()calls bypassed the cache, with 20 seconds between completed calls, from 2026-10-29 02:10:34Z to 02:15:13Z. 10/10 succeeded; 0/10 failed open (0%); 0 strict-pagination mismatches; no truncated counts. Each call read all five repositories. Durations were 8.1–12.6 seconds; observed hosted queues ranged from 8 to 11, running jobs from 4 to 5, and EC2 was idle with no compatible queued work. The strict rule was not loosened. This is a finite live sample, not a guarantee that GitHub's filtered totals never drift.The earlier live run remains the placement evidence: all four actual runner names were
ci-kit-mac-ec2, 41 tests passed, with the retry flag set and no retries needed. It was intentionally not repeated after these sampler/identity-only review fixes.Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)