-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Optionally use download_queue
for brew install
#20245
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
dc046dc
to
9d06597
Compare
9d06597
to
76bf4d2
Compare
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't say I understand all of this, but it looks reasonable to me. Minor nits below.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to incorporate the retry logic in
brew/Library/Homebrew/bottle.rb
Lines 123 to 132 in e804860
rescue DownloadError | |
raise unless fallback_on_error? | |
retry | |
rescue Resource::BottleManifest::Error | |
raise if @fetch_tab_retried | |
@fetch_tab_retried = true | |
resource.clear_cache | |
retry |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 don't see where that PR changes this
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
def verify_download_integrity(_filename) | |
# We don't have a checksum, but we can at least try parsing it. | |
tab | |
end |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bo98 gotcha, thanks, on it (and holding release on it)
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.
@Bo98 Not blocking release but working on a fix for this as it only affects download queue case.
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.
Allowing using
HOMEBREW_DOWNLOAD_CONCURRENCY
to use theDownloadQueue
forbrew install
by downloading and extracting bottles in parallel.This requires some fixes in e.g.
Dependency
andFormulaInstaller
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.
Performance testing on my M1 Max MacBook Pro (that we do
make -j10
on):