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

Multiple CI Enhancements #7453

Merged
merged 8 commits into from Jan 20, 2023
Merged

Multiple CI Enhancements #7453

merged 8 commits into from Jan 20, 2023

Conversation

microdev1
Copy link
Collaborator

This contains the following CI enhancements:

  • Cache common submodules: extmod/ulab, lib/ and tools/.
  • Share CP version across jobs to avoid fetching tags in each and every job.
  • Change submodule fetching strategy:
    • tags[Y]: use git submodule update --init for frozen.
    • tags[N]: use git submodule update --init --depth=1 for everything else.
  • Only build mpy-cross when required by the board.
  • Refactor and alphabetically arrange matrix jobs.
  • Use python 3.x for everything except espressif which is on 3.10.

Through multiple CI runs in my fork, I have found the following way of fetching submodules to be ideal:

  • For large submodules (e.g. ports/): A shallow-clone with --depth=1.
  • For smaller submodules (e.g. extmod/ulab, lib/, tools/): Caching has proven effective.
  • For smaller submodules with tags (e.g. frozen): A normal fetch. I tried partial-clone with --filter=tree:0 but it doesn't produce a significant difference for small repos.

- selectively fetch submodule tags
- conditionally build mpy-cross
- remove frozen from submodule cache
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I saw the build time of the main jobs as 1 hr 10min, which seems like a big improvement, but it's hard to compare with other runs, whose times include delays waiting for runners.

One query inline.

Did you test partial clone with --filter=tree:0 vs depth 1 for the large repos like esp-idf and the broadcom firmware repo?

If we used a partial clone for the main repo, would that make it easier to do the "what is changed checks" without invoking deeper and deeper shallow clones?

.github/workflows/build.yml Outdated Show resolved Hide resolved
@microdev1
Copy link
Collaborator Author

it's hard to compare with other runs, whose times include delays waiting for runners...

Yes, comparing two check suites won't paint the correct picture, I have even noticed a difference of seconds-to-minutes for the same task between runners. I suggest you to take look at individual steps of a job.

Did you test partial clone with --filter=tree:0 vs depth 1 for the large repos like esp-idf and the broadcom firmware repo?

Yes, without tags --depth=1 is better and with tags --filter=tree:0 takes the lead when compared to a normal fetch for these.

If we used a partial clone for the main repo, would that make it easier to do the "what is changed checks" without invoking deeper and deeper shallow clones?

Using partial-clone does take less time when compared to the current --shallow-since and it also removes the need for a fetch in the "what is changed checks" but the difference is in the order of seconds and for a single job it doesn't justify moving away from actions/checkout and dealing with all that complexity.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Let's try these as well.

@dhalbert dhalbert merged commit 9c06682 into adafruit:main Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants