Skip to content

RFC: Parallelizing across machines in CI #1811

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

Closed
jamiebuilds opened this issue May 25, 2018 · 1 comment
Closed

RFC: Parallelizing across machines in CI #1811

jamiebuilds opened this issue May 25, 2018 · 1 comment
Labels

Comments

@jamiebuilds
Copy link
Contributor

Many CI systems support splitting up a single task across multiple machines. This can drastically speed up CI times even when you are duplicating some of the work compiling or whatever.

From what I've seen, they mostly work like this:

steps:
  - label: test
    commands:
      - yarn install
      - yarn test
    parallelism: 5
# on machine 1
CI_JOB=0 CI_JOB_COUNT=5 yarn install
CI_JOB=0 CI_JOB_COUNT=5 yarn test

# on machine 2
CI_JOB=1 CI_JOB_COUNT=5 yarn install
CI_JOB=1 CI_JOB_COUNT=5 yarn test

# on machine 3
CI_JOB=2 CI_JOB_COUNT=5 yarn install
CI_JOB=2 CI_JOB_COUNT=5 yarn test
...

For example: https://buildkite.com/docs/builds/parallel-builds

It would be awesome if there was an easy way to integrate this with Ava such that you could automatically chunk tests up so that they can be run across machines.

I imagine you'd have to discover all the tests and then have some stable way of splitting them up, either by counting the tests or by splitting the files up.

I think you could even automatically do this without any additional setup from developers. I created a module to help you do just that: https://github.com/jamiebuilds/ci-parallel-vars

@jamiebuilds jamiebuilds changed the title Parallelizing across machines in CI RFC: Parallelizing across machines in CI Jun 3, 2018
@novemberborn
Copy link
Member

Landed in #1812.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants