-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Use Appveyor matrix for faster PR builds #6945
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
Conversation
…that can run in parallel.
… does not exist for the packaging build)
|
Seems we don't want publish packages if tests failed. doesn't help. |
|
Restoring build cache take 4 minutes! Unzipping - can we cache unzipped data? |
… forks for a fail-fast approach and to get deliverables early) -Remove caching dotnet, which does not seem to pay off due to high zipping and unzipping costs -Set DOTNET_SKIP_FIRST_TIME_EXPERIENCE to 1 to save 1 minute for unnecessary cache initialization since now we always install the sdk from fresh
|
@iSazonov |
|
Make sense set DOTNET_SKIP_FIRST_TIME_EXPERIENCE in second job too? |
… it makes the 2nd build slower (it did before but maybe it was a bad run
|
Seems we could decouple still two job - for admin tests and xUnit tests. If first we start CI-tagged tests and then packaging, admin-tagged tests and xUnit tests we get minimal time about 14 minutes. |
|
Yes, that's why this PR is not supposed to close the issue but yes, this is the way to go, I have outlined ideas like that in the issue. This PR is just the first step to show the direction without disadvantages for builds on a fork with a free account. Bear in mind that for every additional build job, people on non-free AppVeyor accounts incur a 2 minute penalty on their fork builds (i.e. their own builds before they have submitted a PR) due to it having to bootstrap the environment. |
|
I'm not sure this will speed things up. It may actually slow things down as we often hit our maximum number of jobs. We would need more budget to make this actually work. @SteveL-MSFT What do you think? |
|
I ran this also on my fork (which has only a concurrency of 1 because I am cheap 😛 ), the time was the same (due to time savings of dumping the dotnet caching and skipping the dotnet initialization). Therefore at least, when job pipelines are available (which probably applies more to me due due to my difference in time-zone and more frequent weekend work), then there will be a speedup. Of course a more efficient split-up would be to do something more expensive than packaging in the 2nd build but this is just the first step to show the future path |
|
|
||
| # cache version - netcoreapp.2.1-sdk.2.1.300-rc1 | ||
| cache: | ||
| - '%LocalAppData%\Microsoft\dotnet -> appveyor.yml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is here for reliability. Please don't remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying the download of the SDK sometimes fails? Usually cache makes things less reliable due to leftovers. The reason for removal was the amount of time it was taking and the fact that it often also fails due to its size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any download sometimes fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but then shouldn't we rather cache just what we have downloaded instead of caching the appdata folder of dotnet?
|
Does |
|
@TravisEz13 |
| # version is set in tools\appveyor.psm1 - Invoke-AppVeyorInstall | ||
| environment: | ||
| POWERSHELL_TELEMETRY_OPTOUT: 1 | ||
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add this link somewhere near here
http://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @DarqueWarrior 😄
TravisEz13
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good if we add a comment about what the skip first-time experience variable means.
…o AppVeyorMatrix and add requested comment # Conflicts: # appveyor.yml
…Shell into AppVeyorMatrix # Conflicts: # appveyor.yml
|
@TravisEz13 Ok, done. What are your thoughts on the concern about reliability due to removing the CLI cache and instead always just installing it from scratch. PSScriptAnalyzer does this as well and I have not seen a sporadic failure due to that yet. |
|
@bergmeister I think we can try it and see what happens. |
| matrix: | ||
| fast_finish: true | ||
|
|
||
| # cache version - netcoreapp.2.1-sdk.2.1.300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please leave this comment in place? It's needed to flush the nuget package cache when we update the sdk or runtime for the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I didn't notice this. Yes, please add this back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, added back
appveyor.yml
Outdated
| # version is set in tools\appveyor.psm1 - Invoke-AppVeyorInstall | ||
| environment: | ||
| POWERSHELL_TELEMETRY_OPTOUT: 1 | ||
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 # avoid expensive initialization of dotnet cli, see: http://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is better to place comments on new line.
| image: Visual Studio 2017 | ||
| # Stop all jobs in the matrix if any one them fail | ||
| matrix: | ||
| fast_finish: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we split jobs should we fast stop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was: if the build itself is broken, then both jobs will fail at the same stage anyway because they both need to build. The only undesired case would be when adding/updating new 3rd party packages and packaging is broken then the tests would abort early. I am happy to revert this if you wish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Closed.
|
@bergmeister Thanks for the contribution! |
… time by another 5 minutes (#7021) Closes #6944 Following PR #6945, further, reduce the total build time (without any disadvantages) by around 5 minutes by making sure there is a more even split between the 2 build jobs (the 2nd build job used to be much shorter). Therefore this PR moves also the xUnit and Pester-Admin tests into the 2nd build job. If it is a daily/feature test commit, then the feature tests will also happen (only) in the 2nd build job. Because both jobs now run tests, the failfast option was removed. The final question from my side is whether running tests in 2 build jobs is OK for the daily build, which uploads code coverage results? The time to wait for the AppVeyor build results is now 15 +/- 2 minutes, which is a huge improvement to what used to be around 28 minutes before the build matrix was introduced.
PR Summary
Related: #6944
Reduce PR build time by 5 minutes by:
DOTNET_SKIP_FIRST_TIME_EXPERIENCEto1because the initialization of the dotnet cli cache (1 minute) does not pay off for the whole build.The total build time of builds on a fork that is on a free AppVeyor account and therefore do not have parallelism, remains the same due to the time saving of redundant caching.
This is just a simple example of what we can easily achieve, we could continue this pattern and split the test runs as per the referenced issue to bring PR builds down to 10 minutes (but this will incur an increase for fork builds on free AppVeyor accounts)
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests