Optionally use download_queue for brew install#20245
Conversation
dc046dc to
9d06597
Compare
9d06597 to
76bf4d2
Compare
Allowing using `HOMEBREW_DOWNLOAD_CONCURRENCY` to use the `DownloadQueue` for `brew install` by downloading and extracting bottles in parallel. This requires some fixes in e.g. `Dependency` and `FormulaInstaller` to be able to front-load all downloads and handle parallelisation of bottle pouring. Behaviour without `HOMEBREW_DOWNLOAD_CONCURRENCY` set should be unchanged. Attestations are not handled for now and the UI should be improved before we roll this out to users. Post-install upgrades are not yet parallelised. Co-authored-by: Carlo Cabrera <github@carlo.cab>
2467a1a to
5cc6722
Compare
| if (download_queue = self.download_queue) && | ||
| (bottle = formula.bottle) && | ||
| (manifest_resource = bottle.github_packages_manifest_resource) | ||
| download_queue.enqueue(manifest_resource) | ||
| else | ||
| begin | ||
| formula.fetch_bottle_tab(quiet: quiet) | ||
| rescue DownloadError, Resource::BottleManifest::Error | ||
| # do nothing | ||
| end | ||
| end |
There was a problem hiding this comment.
Need to incorporate the retry logic in
brew/Library/Homebrew/bottle.rb
Lines 123 to 132 in e804860
fetch_bottle_tab anymore. Perhaps by some custom callbacks from the queue or something
The final # Do nothing rescue in the installer is also important for CI when we enable it there.
There was a problem hiding this comment.
I don't see where that PR changes this
There was a problem hiding this comment.
@Bo98 This is triggering a manual retry on bottle manifest download errors. That PR is automatically triggering a manual retry on any bottle manifest errors under the download queue.
Do you mean this logic needs reincorporated for the non-download queue case and that's missing/changed and still needs resolved beyond #20282?
There was a problem hiding this comment.
Oh right I see what you mean - I misunderstood there.
We do however also need a retry (with a clear_cache) if it gets a Resource::BottleManifest::Error triggered by verify_download_integrity of the bottle manifest:
brew/Library/Homebrew/resource.rb
Lines 316 to 319 in 6261551
Try modify a locally-cached manifest to e.g. remove all arm64 bottles and see if that works as a reproducer. (I've not retested this after the changes yet.)
There was a problem hiding this comment.
@Bo98 gotcha, thanks, on it (and holding release on it)
There was a problem hiding this comment.
@Bo98 Not blocking release but working on a fix for this as it only affects download queue case.
Allowing using
HOMEBREW_DOWNLOAD_CONCURRENCYto use theDownloadQueueforbrew installby downloading and extracting bottles in parallel.This requires some fixes in e.g.
DependencyandFormulaInstallerto be able to front-load all downloads and handle parallelisation of bottle pouring.Behaviour without
HOMEBREW_DOWNLOAD_CONCURRENCYset should be unchanged.Attestations are not handled for now and the UI should be improved before we roll this out to users.
Post-install upgrades are not yet parallelised.
Performance testing on my M1 Max MacBook Pro (that we do
make -j10on):