Skip to content

[code-infra] Migrate CircleCI jobs to Gen2 resource classes#48593

Merged
LukasTy merged 4 commits into
mui:masterfrom
LukasTy:circleci-gen2
May 29, 2026
Merged

[code-infra] Migrate CircleCI jobs to Gen2 resource classes#48593
LukasTy merged 4 commits into
mui:masterfrom
LukasTy:circleci-gen2

Conversation

@LukasTy

@LukasTy LukasTy commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

CircleCI shipped Gen2 x86 Docker resource classes (GA 2026-05-04). They cost +20% per minute over Gen1 but advertise ~1.4× wall-clock speedup, so anything faster than 1.2× is a net credit win.

We just landed the same migration on mui-x in mui/mui-x#22610 (~21% credit reduction). This PR replicates that for material-ui: an all-Gen2 lift, then revert any job that doesn't clear 1.20× comfortably.

Per-job results

Four PR runs on this branch (one with a partial failure on test_browser_legacy, excluded from that row only). PR averages vs master 24h Insights median.

Job Final class Master median PR avg (Gen2) Speedup Decision
test_browser medium+.gen2 399s 196.3s 2.03× Keep Gen2
test_browser_legacy medium+.gen2 378s 227.9s 1.66× Keep Gen2
test_unit medium.gen2 180s 114.1s 1.58× Keep Gen2
test_lint medium.gen2 116s 76.3s* 1.52× Keep Gen2
test_types medium+.gen2 460s 321.2s 1.43× Keep Gen2
test_regressions medium (Gen1) 276s 226.2s 1.22× Revert
test_bundle_size_monitor medium (Gen1) 186s 151.4s 1.23× Revert
test_static medium (Gen1) 200s 181.3s 1.10׆ Revert
test_e2e medium (Gen1) 69s 60.5s 1.14× Revert
test_e2e_website medium (Gen1) 83.2s n/a Revert

* test_lint run #2 had a 150s ESLint step (vs 9-20s normally on every other run including master) — treated as a transient infra hiccup and excluded.
† test_static N=2 valid Gen2 runs (run #1 failed at the dedupe check, fixed in 485751e6).
‡ test_e2e_website doesn't run on master (triggered after docs deploy), so no master baseline. Reverted in line with the rest of the e2e jobs — all IO-bound (image pull + pnpm install + Playwright dominates wall-clock).

Run #4 (commit cf72803021) validates the five reverts — each ran on its expected medium Gen1 executor.

Credit math

Per pipeline run, using master medians × Gen1 rates vs PR Gen2 averages × Gen2 rates (Gen1 jobs use master median as the steady-state estimate).

Per pipeline run
Master baseline (Gen1 everywhere) 480 cr
This PR (Gen2 for 5 CPU-bound jobs, Gen1 elsewhere) 383 cr
Reduction −97 cr (−20.2%)

Where the savings come from:

Job Master Gen1 Post-PR Δ
test_browser 100 cr 59 cr −41 cr
test_browser_legacy 95 cr 68 cr −27 cr
test_types 115 cr 96 cr −19 cr
test_unit 30 cr 23 cr −7 cr
test_lint 19 cr 15 cr −4 cr
5 reverted jobs 121 cr 121 cr ±0 cr

In line with mui-x's −21 to −23% range.

Caveats / follow-ups

  • N=3-4 PR runs is still a small sample. The three borderline reverts (test_static / test_bundle_size_monitor / test_regressions) sat between 1.10× and 1.23×; if a future iteration sees them consistently above 1.25× on master, flipping them back to Gen2 in a follow-up is a one-line change each.
  • test_lint had a one-run ESLint outlier (150s vs ~10-20s normally). If it recurs on master, it's a Gen2-specific issue to investigate, not a Gen1 reversion candidate.

Test plan

🤖 Generated with Claude Code

Switch every resource_class declaration to its .gen2 counterpart for an
all-Gen2 baseline. Per-job overrides for jobs where Gen2 doesn't pay off
will follow once we have CI duration data to compare against the master
24h Insights median.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@code-infra-dashboard

code-infra-dashboard Bot commented May 29, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48593--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@LukasTy LukasTy added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). labels May 29, 2026
@LukasTy LukasTy self-assigned this May 29, 2026
LukasTy and others added 3 commits May 29, 2026 14:20
Resolves lockfile drift on eslint-plugin-import — its
eslint-import-resolver-typescript reference was being expanded into a
nested form that simplifies away after dedupe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test_e2e and test_e2e_website are IO-bound (image pull + pnpm install +
Playwright dominates the wall-clock), so Gen2 saved very little
wall-clock while still charging the +20% per-minute premium:

  test_e2e: 69s Gen1 → 60.5s Gen2 (1.14× speedup, below 1.20× break-even)
  test_e2e_website: 83s on Gen2 (no master baseline in pipeline workflow,
    follows the same mui-x precedent for e2e jobs)

Same pattern we saw on mui-x in mui#22610.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test_static (1.18×), test_bundle_size_monitor (1.20×), and
test_regressions (1.21×) all hover right around the 1.20× break-even
threshold where Gen2 stops paying for itself. With N=2 PR runs the
signal is too noisy to call them solidly above break-even, and the
credit math is essentially flat either way.

Reverting them to Gen1 makes the per-job behavior more predictable and
removes the risk of an unlucky variance swing pushing them below
break-even on master.

Net credit reduction vs master stays at ~-20% per pipeline run; the
remaining four CPU-bound jobs (test_browser, test_browser_legacy,
test_unit, test_lint, test_types) all cleared 1.4× or better and
carry the savings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@LukasTy LukasTy marked this pull request as ready for review May 29, 2026 13:03
@LukasTy LukasTy requested a review from a team May 29, 2026 13:03

@Janpot Janpot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice, we could potentially experiment with upgrading test_regressions resource class and increased parallelism as well

@LukasTy LukasTy merged commit ad77f4e into mui:master May 29, 2026
18 checks passed
@LukasTy LukasTy deleted the circleci-gen2 branch May 29, 2026 14:58
@cherniavskii

Copy link
Copy Markdown
Member

It looks like this PR broke CircleCI job on master: https://app.circleci.com/pipelines/gh/mui/material-ui/175498

LukasTy added a commit to LukasTy/material-ui that referenced this pull request Jun 1, 2026
mui#48557 added `resource_class: 'medium+'` and mui#48593 added
`resource_class: medium` to the test_regressions job ~3h apart. Neither
produced a textual conflict (different lines), so the merged config ended
up with two `resource_class` keys — invalid YAML. CircleCI fails to parse
config.yml and every pipeline on master errors before any job runs.

Consolidate to a single `resource_class: medium+` directly under
`<<: *default-job`, matching the other executor jobs (test_browser,
test_e2e, ...). medium+ is still a Gen1 class — honoring mui#48593's revert
off Gen2 — while preserving mui#48557's bump for the parallelized visual
regression screenshots.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasTy

LukasTy commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

It looks like this PR broke CircleCI job on master: https://app.circleci.com/pipelines/gh/mui/material-ui/175498

Sorry. Fixed already. Caused by merging without syncing with master, which got different related changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants