MatrixAI / Polykey

Polykey Core Library
https://polykey.com
GNU General Public License v3.0
29 stars 4 forks source link

Apply bin packing algorithms to the setup of our parallel CI/CD test runners #393

Open emmacasolin opened 2 years ago

emmacasolin commented 2 years ago

Specification

We want to introduce test load balancing to better parallelise and speed up our CI/CD tests. Part of this task is determining the most efficient number of shards to use, since we want to have the lowest number of parallel runners with the highest rate test completion. Such a task falls under the scope of a bin packing problem, which is NP-hard, however there are approximations we can use to make the problem easier.

On top of simply choosing the best number of shards to use, we want the shards themselves to be evenly balanced so that every test runner finishes at approximately the same time. We can use cached timing information from previous test runs to help to make this decision.

Additional context

Tasks

  1. ...
  2. ...
  3. ...
CMCDragonkai commented 2 years ago

To do this, a custom test sequencer that overrides the shard method would need to be used. This experimented with prior in https://github.com/MatrixAI/TypeScript-Demo-Lib/pull/65