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

Improve CI build times, esp. on Ubuntu #107

Closed
repi opened this issue Oct 22, 2020 · 8 comments
Closed

Improve CI build times, esp. on Ubuntu #107

repi opened this issue Oct 22, 2020 · 8 comments
Labels
c: meta Issues specific to the GitHub repository. README, CI, etc.

Comments

@repi
Copy link
Contributor

repi commented Oct 22, 2020

These are our current CI build times through our GitHub Action:

  • Mac: 3m 9s
  • Windows: 8m 22s
  • Ubuntu: 13m 22s

Ubuntu is spending 8 min just installing spirv-tools, this we should fix so we at least get down to 8m total build times instead of 13 min.

Just download the spriv-tools executables directly instead of using apt? think was some discussion in chat. cc @Jake-Shadle

@repi repi added the c: meta Issues specific to the GitHub repository. README, CI, etc. label Oct 22, 2020
@Jake-Shadle
Copy link
Member

It was originally downloading the executables directly, but was changed in #63 to use brew instead, not sure why exactly, but you can see the CI runs before that PR were around ~6m which is still fairly high, but a lot better.

@repi
Copy link
Contributor Author

repi commented Oct 22, 2020

Oh, does sound like we should go back!

@khyperia
Copy link
Contributor

khyperia commented Oct 22, 2020

It looks like we're building at least some crates twice from the split cargo test. My guess:

current ci.yaml:

      - run: cargo test --workspace --exclude example-runner
      - if: ${{ runner.os != 'macOS' }}
        run: cargo test --workspace example-runner

probably better ci.yaml:

      - if: ${{ runner.os != 'macOS' }}
        run: cargo test --workspace
      - if: ${{ runner.os == 'macOS' }}
        run: cargo test --workspace --exclude example-runner

edit: this has been done

@khyperia
Copy link
Contributor

khyperia commented Nov 2, 2020

now that CI is downloading spirv-tools instead of brew installing (and therefore building) them, is there anything left to do in this issue?

current times:

mac: 10m (2m installing spirv-tools, 7m running tests)
ubuntu: 9m30s (45 seconds installing native deps+spirv-tools, 7m30s running tests)
windows: 11m30s (13 seconds installing spirv-tools, 9m running tests)

seems like most time is spent in running tests (mostly building our boatload of dependencies, I think), so not really much we can improve on the CI side.

@Jake-Shadle
Copy link
Member

We could add support for sccache, but that does add some complexity, I could do a quick and dirty pr to see if the speedup is worth it?

@khyperia
Copy link
Contributor

khyperia commented Nov 2, 2020

I don't actually know, is sccache significantly better than the github cache action? We used to do that, but it was broken since rustup upgrades wouldn't invalidate the cache, so we removed it. Might be relatively easier to fix that instead.

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
${{ runner.os }}-

(Or, y'know, the github cache action might have been doing absolutely nothing, because checked-out files are newer than the cache modification date or something like that, idk)

@Jake-Shadle
Copy link
Member

We'd have to test to see, but yes, if you switch nightlies often that would problematic for both of them, then again, as the project grows and there are more contributions, even a modest decrease in build times pays back quickly.

@khyperia
Copy link
Contributor

khyperia commented Apr 1, 2021

I think at this point, CI is just a lost cause, there's too much to build and test. We should also track specific improvements we should do, like #549

@khyperia khyperia closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: meta Issues specific to the GitHub repository. README, CI, etc.
Projects
None yet
Development

No branches or pull requests

3 participants