Skip to content
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

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

Closed
emmacasolin opened this issue Jun 29, 2022 · 2 comments
Labels
enhancement New feature or request r&d:polykey:supporting activity Supporting core activity

Comments

@emmacasolin
Copy link
Contributor

emmacasolin commented Jun 29, 2022

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
Copy link
Member

CMCDragonkai commented Jun 29, 2022

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

@teebirdy teebirdy added r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management and removed r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management labels Jul 24, 2022
@CMCDragonkai CMCDragonkai added the r&d:polykey:supporting activity Supporting core activity label Jul 10, 2023
@CMCDragonkai
Copy link
Member

CMCDragonkai commented Aug 16, 2024

Doesn't seem relevant anymore, testing is pretty quick now by spreading the workload between Polykey and Polykey-CLI.

The sharding system is still being used (even in the migration to GitHub in https://github.com/MatrixAI/Orchestrator/issues/10), as can be seen by:

scripts/build-platforms-generate.sh
10:# Using shards to optimise tests
14:# Number of parallel shards to split the test suite into
136:    - npm test -- --ci --coverage --shard="$CI_NODE_INDEX/$CI_NODE_TOTAL" --maxWorkers=50%
164:    - npm test -- --ci --coverage --shard="$CI_NODE_INDEX/$CI_NODE_TOTAL" --maxWorkers=50%

However it's just relying on whatever jest's default sharing allocation algorithm is.

@CMCDragonkai CMCDragonkai closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request r&d:polykey:supporting activity Supporting core activity
Development

No branches or pull requests

3 participants