perf(ci): parallelize monorepo build via mise DAG dependencies#203
Open
scottschreckengaust wants to merge 3 commits into
Open
perf(ci): parallelize monorepo build via mise DAG dependencies#203scottschreckengaust wants to merge 3 commits into
scottschreckengaust wants to merge 3 commits into
Conversation
Restructures task execution from sequential to parallel: Root mise.toml: changes build from sequential `run = [...]` to parallel `depends = [agent, cdk, cli, docs]`. All packages now build concurrently. cdk/mise.toml: adds `depends = [":compile"]` to test and synth:quiet so they wait for TypeScript compilation, while eslint runs immediately. Removes compile from build's depends (it's now pulled in transitively). DAG execution order: t=0: agent:quality + cdk:compile + cdk:eslint + cli:build + docs:build t=35: cdk:test + cdk:synth (after compile finishes) t=185: all done Critical path: cdk:compile (35s) → cdk:synth (150s) = ~3min vs. previous serial: ~12min Also removes redundant //docs:sync (already a dependency of //docs:build). Refs #201 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bef35a0 to
5f9c277
Compare
38358be to
5e22e9c
Compare
Probes whether larger runners are available to the org. If the job queues and runs, mise parallelism should actually benefit from 4 real cores vs 2. If it fails, we know larger runners aren't enabled. Adds nproc/RAM logging and SECONDS timing to measure the difference. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5e22e9c to
39ee2ab
Compare
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.
Summary
Restructures the monorepo build from sequential execution to parallel DAG-based execution using mise's native dependency resolution. Also adds dynamic runner selection via repo variable or PR label.
Changes (2 files + build.yml runner config)
Root
mise.toml:run = [cdk, cli, docs]to paralleldepends = [agent, cdk, cli, docs]//docs:sync(already a dep of//docs:build)cdk/mise.toml:testnow declaresdepends = [":compile"]— waits for tsc before running Jestsynth:quietnow declaresdepends = [":compile"]— waits for tsc before synthesizingeslinthas no compile dependency — starts immediately (operates on .ts source)builddepends on[":test", ":eslint", ":synth:quiet"]— compile is pulled in transitivelybuild.ymlrunner selection:Resulting DAG
Also fixes
testandsynthran in parallel withcompile(no ordering guarantee). Now they explicitly depend on compile completing first.Test plan
mise tasks deps buildshows correct DAG (verified locally)mise run build --dry-runshows parallel executionmise run buildpasses (all tests, synth, lint, docs green)ubuntu-latesthas only 2 vCPU, so parallel tasks contend for CPU rather than running concurrently. The DAG is correct but the speedup requires larger runners (4+ cores). See dynamic runner selection above — setvars.DEFAULT_RUNNER_LABELor add PR labelubuntu-latest-4-coreswhen available.mise //cdk:teststill works standalone — confirmed via successful CI build (DAG pulls in compile first)mise //cdk:synthstill works standalone — confirmed via successful CI build (DAG pulls in compile first)Refs #201
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com