ビルドシャーディング (Build Sharding) とは?
ビルドシャーディングは、大量の作業 (通常はテストスイートやbuild) を複数の互いに素なshardに分割し、異なるrunner上で同時に実行します。各shardはtargetの一部を担当し、結果は最後にマージされます。遅いスイートに並列性を投入する最もシンプルな方法です。
なぜ重要か
単一のrunnerが長いテストスイートをシリアルに実行すると、pipeline時間に固い下限が生じます。N個のrunnerに分割すれば、それを1/Nに近づけることができます。難しいのは、最も遅いshardが支配しないようにshardのバランスを取ることと、N倍のrunner並列度を管理することです。マネージドrunnerでは、これはコストと速度を直接調整するレバーになります。
実践上の留意点
- shardは数だけでなく過去の実行時間でバランスを取る
- shard間でカバレッジと結果をマージする
- shardが増えるほど並列するrunner時間も増える
関連ガイド
What Is Predictive Test Selection?Predictive test selection uses a model of past results to run only the tests most likely affected by a change…
What Is a Distributed Build?A distributed build splits compilation and test work across many machines in parallel, cutting wall-clock bui…
What Is a Build Farm?A build farm is a managed pool of machines dedicated to running builds, providing the shared compute that dis…