You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tries to allow concurrency on the plugin installation phase. The dynamic plugin installer so far allowed only sequential installation.
According to my benchmarks it can reduce 2x or 3x the time needed to install the plugins for your RHDH instance.
Key changes:
Plugin installation now runs in a ThreadPoolExecutor which defaults to 5 workers, but that's configurable via MAX_CONCURRENT_INSTALLS.
The OCI manifest inspection process is now pre-fetched and outside of the merge loop, as the merge loop has to be sequential. That allows us to run the skopeo inspect in parallel and use cached values in the sequential loop.
For the above we use a shared _oci_path_cache dict avoids redundant inspects across plugins from the same image.
A threading.Lock guards all concurrent writes to plugin_path_by_hash.
As the previous logging flow would not work with concurrent installs I've added PluginStatusDisplay just to help the user read more easy what is happening.
Please make sure that the following steps are complete:
GitHub Actions are completed and successful
Unit Tests are updated and passing
E2E Tests are updated and passing
Documentation is updated if necessary (requirement for new features)
Add a screenshot if the change is UX/UI related
How to test changes / Special notes to the reviewer
I've tested this both locally but also on a custom image I've built. I'll need for sure some guidance if futhre testing is required from my side.
Note, that intentionally I didn't want to do a lot of structural changes, like removing the skopeo dependency cause I feel this set of changes is more straightforward and with less risk involved. Looking at the benchmarks I feel it worths the effort.
For sure according to my experiments, removing the skopeo dependency will make this process even faster, mostly because the skopeo copy needs to fetch everything while we're ok downloading only a part of each image.
FYI I've tried to run a test instance of the ai-rolling-demo-gitops using the quay.io/rhdh-community/rhdh:pr-4491 image. The comparison between this one and quay.io/rhdh/rhdh-hub-rhel9/rhdh:1.10-87 can be seen below. The suggested approach took 1.19 mins to end while the current one finished after 3.25 mins.
The reason will be displayed to describe this comment to others. Learn more.
@thepetk Looks like this is being superseded by #4574, which is rewriting the Python script to TypeScript with similar support for concurrent installs among other things. PTAL at that PR to compare the improvements in your environment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Tries to allow concurrency on the plugin installation phase. The dynamic plugin installer so far allowed only sequential installation.
According to my benchmarks it can reduce 2x or 3x the time needed to install the plugins for your RHDH instance.
Key changes:
ThreadPoolExecutorwhich defaults to 5 workers, but that's configurable viaMAX_CONCURRENT_INSTALLS.skopeo inspectin parallel and use cached values in the sequential loop._oci_path_cachedict avoids redundant inspects across plugins from the same image.threading.Lockguards all concurrent writes toplugin_path_by_hash.PluginStatusDisplayjust to help the user read more easy what is happening.Which issue(s) does this PR fix
PR acceptance criteria
Please make sure that the following steps are complete:
How to test changes / Special notes to the reviewer
I've tested this both locally but also on a custom image I've built. I'll need for sure some guidance if futhre testing is required from my side.
Note, that intentionally I didn't want to do a lot of structural changes, like removing the skopeo dependency cause I feel this set of changes is more straightforward and with less risk involved. Looking at the benchmarks I feel it worths the effort.
For sure according to my experiments, removing the skopeo dependency will make this process even faster, mostly because the skopeo copy needs to fetch everything while we're ok downloading only a part of each image.