New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rush] add support for sharding phases #4652
base: main
Are you sure you want to change the base?
Conversation
libraries/rush-lib/src/logic/operations/OperationExecutionRecord.ts
Outdated
Show resolved
Hide resolved
...dis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/e/config/rush-project.json
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShardedPhaseOperationPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShardedPhaseOperationPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/OperationMetadataManager.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShellOperationRunnerPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts
Outdated
Show resolved
Hide resolved
Also, I think CI is failing due to mismatched versions of rush - the |
…ger for all output logs
@dmichon-msft I trimmed out the heft changes - this should be good for another 👀 |
@iclanton @dmichon-msft Are we ready to merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits for performance, but otherwise looks about good to go.
libraries/rush-lib/src/logic/operations/PhasedOperationPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShardedPhaseOperationPlugin.ts
Outdated
Show resolved
Hide resolved
...dis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/a/config/rush-project.json
Outdated
Show resolved
Hide resolved
...ests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/a/package.json
Outdated
Show resolved
Hide resolved
...dis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/b/config/rush-project.json
Outdated
Show resolved
Hide resolved
build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/build.js
Outdated
Show resolved
Hide resolved
build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/build.js
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShardedPhaseOperationPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShardedPhaseOperationPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShardedPhaseOperationPlugin.ts
Outdated
Show resolved
Hide resolved
libraries/rush-lib/src/logic/operations/ShardedPhaseOperationPlugin.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Ian Clanton-Thuon <[email protected]>
The conversations that I've left unresolved above I have open questions around. Current state of things,
|
Summary
This PR adds support for sharding to rush phases. This allows plugins that support sharding, like jest, to be split into multiple shards and run independently. It does this by adding a new set of options to
rush-project.json
under a newsharding
key. example:Details
This is the initial chunk of work to support sharding in the operation graph. It includes both the sharding nodes as well as a collator node that can run a script after all of the shard nodes are complete.
I originally attempted this with heft plugins, however tying into rush parallelism + cobuilds is one of our end goals with this work and heft plugins at the moment don't allow that.
How it was tested
I've been locally testing with
node apps/rush/lib/start-dev test --to heft-jest-shards-test -p 6
and varying parallelism flags. The tests inheft-jest-shards-test
run for 10 seconds and then pass and there are 6 of those files, so-p 6
should run in ~10 seconds,-p 3
in 20 seconds and so on. I also added asharded-repo
to the existing cobuild suite to ensure this works with cobuilds.TODO:
Impacted documentation